/**
 * Cricket Live Scores - Enhanced Frontend Styles
 * Modern responsive design for cricket scorecards
 */

/* ============================================
   GLOBAL STYLES & RESET
   ============================================ */

.cricket-match-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    background: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.cricket-match-container * {
    box-sizing: border-box !important;
}

/* ============================================
   MATCH HEADER
   ============================================ */

.cricket-match-container .cricket-match-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid #e8e8e8 !important;
}

.cricket-match-container .match-title-section {
    flex: 1 !important;
}

.cricket-match-container .match-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
}

.cricket-match-container .match-subtitle {
    font-size: 16px !important;
    color: #666 !important;
    margin: 0 !important;
}

.cricket-match-container .match-status-container {
    margin-left: 20px !important;
}

.cricket-match-container .status-badge {
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.cricket-match-container .status-badge.live-badge {
    background: linear-gradient(135deg, #ff3b30 0%, #ff1744 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(255, 23, 68, 0.4) !important;
    animation: live-glow 2s ease-in-out infinite !important;
}

@keyframes live-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 23, 68, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 23, 68, 0.6);
    }
}

.live-pulse {
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-badge.completed,
.status-badge.result {
    background: #28a745;
    color: #ffffff;
}

.status-badge.upcoming {
    background: #6c757d;
    color: #ffffff;
}

/* ============================================
   TEAMS SCORE SECTION
   ============================================ */

.cricket-match-container .teams-score-section {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 30px 0 !important;
    padding: 30px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border-radius: 15px !important;
    border: 1px solid #e8e8e8 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

.cricket-match-container .team-display {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.cricket-match-container .team-flag-name {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.cricket-match-container .team-flag {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    border: 3px solid #e8e8e8 !important;
    background: #ffffff !important;
    padding: 0px !important;
}

.cricket-match-container .team-flag-placeholder {
    width: 60px !important;
    height: 60px !important;
    background: #e8e8e8 !important;
    border-radius: 50% !important;
}

.cricket-match-container .team-name {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
}

.cricket-match-container .team-score-info {
    text-align: center !important;
}

.cricket-match-container .team-score {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    line-height: 1.2 !important;
}

.cricket-match-container .team-overs {
    font-size: 18px !important;
    color: #666 !important;
    margin-top: 5px !important;
}

.cricket-match-container .vs-separator {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #999;
    padding: 0 30px;
}

/* ============================================
   MATCH RESULT BANNER
   ============================================ */

.cricket-match-container .match-result-banner {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: #ffffff !important;
    padding: 15px 25px !important;
    border-radius: 10px !important;
    text-align: center !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 20px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3) !important;
}

.cricket-match-container .trophy-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

/* ============================================
   RECENT OVERS SECTION
   ============================================ */

.recent-overs-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
}

.overs-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f9fa;
}

.overs-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.overs-scroll-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.overs-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.overs-balls-list {
    display: flex;
    gap: 8px;
    padding: 10px 0;
}

.ball {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e8e8e8;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ball:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ball.wicket {
    background: #ff3b30;
    color: #ffffff;
    border-color: #ff3b30;
}

.ball.boundary {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.ball.six {
    background: #9c27b0;
    color: #ffffff;
    border-color: #9c27b0;
}

/* ============================================
   PLAYER OF THE MATCH WIDGET
   ============================================ */

.player-of-match-widget {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.potm-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.potm-badge svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.potm-name {
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   TABBED NAVIGATION
   ============================================ */

.cricket-match-container .cricket-tabs-container {
    margin-top: 30px !important;
}

.cricket-match-container .tabs-navigation {
    display: flex !important;
    gap: 5px !important;
    border-bottom: 2px solid #e8e8e8 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}

.cricket-match-container .tabs-navigation::-webkit-scrollbar {
    display: none !important;
}

.cricket-match-container .tab-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 20px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #666 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.cricket-match-container .tab-btn:hover {
    color: #1a1a1a !important;
    background: #f8f9fa !important;
}

.cricket-match-container .tab-btn.active {
    color: #007bff !important;
    border-bottom-color: #007bff !important;
}

.cricket-match-container .tab-btn svg {
    width: 16px !important;
    height: 16px !important;
}

.cricket-match-container .tabs-content-area {
    padding: 25px 0 !important;
}

.cricket-match-container .tab-panel {
    display: none !important;
}

.cricket-match-container .tab-panel.active {
    display: block !important;
    animation: fadeIn 0.3s ease !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LIVE TAB - MATCH INFO GRID
   ============================================ */

.match-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-card {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.info-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ============================================
   SCORECARD TAB
   ============================================ */

.cricket-match-container .innings-section {
    margin-bottom: 40px !important;
}

.cricket-match-container .innings-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: #ffffff !important;
    padding: 15px 20px !important;
    border-radius: 8px 8px 0 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.cricket-match-container .innings-header h3 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

.cricket-match-container .innings-score {
    font-size: 24px !important;
    font-weight: 700 !important;
}

.cricket-match-container .innings-overs {
    font-size: 16px !important;
    font-weight: 400 !important;
    opacity: 0.9 !important;
}

.cricket-match-container .scorecard-section {
    margin-bottom: 30px !important;
}

.cricket-match-container .scorecard-heading {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 20px 0 15px 0 !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #e8e8e8 !important;
}

.cricket-match-container .scorecard-table-wrapper {
    overflow-x: auto !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.cricket-match-container .scorecard-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #ffffff !important;
}

.cricket-match-container .scorecard-table thead {
    background: #f8f9fa !important;
}

.cricket-match-container .scorecard-table th {
    padding: 12px 15px !important;
    text-align: left !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #666 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 2px solid #e8e8e8 !important;
}

.cricket-match-container .scorecard-table td {
    padding: 12px 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px !important;
}

.cricket-match-container .scorecard-table tbody tr:hover {
    background: #f8f9fa !important;
}

.cricket-match-container .scorecard-table tbody tr:last-child td {
    border-bottom: none !important;
}

.cricket-match-container .player-col {
    min-width: 200px !important;
}

.cricket-match-container .player-name {
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin-bottom: 3px !important;
}

.dismissal-text {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.runs-col,
.wickets-col {
    font-weight: 700;
    color: #007bff;
}

/* ============================================
   SQUAD TAB
   ============================================ */

.squad-section {
    margin-bottom: 40px;
}

.squad-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 25px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

.squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.player-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.player-card:hover {
    background: #ffffff;
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
    transform: translateY(-3px);
}

.player-avatar {
    margin-bottom: 10px;
}

.player-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.player-card-role {
    font-size: 12px;
    color: #666;
}

/* ============================================
   HIGHLIGHTS TAB
   ============================================ */

.highlights-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e8e8e8;
    color: #1a1a1a;
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.highlights-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.highlight-card {
    display: flex;
    gap: 15px;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.highlight-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.highlight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
}

.icon-wicket,
.icon-six,
.icon-four {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.icon-wicket {
    background: #ff3b30;
}

.icon-six {
    background: #9c27b0;
}

.icon-four {
    background: #007bff;
}

.highlight-content {
    flex: 1;
}

.highlight-over {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.highlight-text {
    font-size: 15px;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.5;
}

.highlight-event-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #ffc107;
    color: #1a1a1a;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================
   COMMENTARY TAB
   ============================================ */

.commentary-container {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 10px;
}

.commentary-container::-webkit-scrollbar {
    width: 8px;
}

.commentary-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.commentary-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.commentary-row {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e8e8e8;
    transition: background 0.3s ease;
}

.commentary-row:hover {
    background: #f8f9fa;
}

.commentary-over-no {
    min-width: 60px;
    font-weight: 700;
    color: #007bff;
    font-size: 15px;
}

.commentary-content {
    flex: 1;
}

.commentary-players {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.commentary-players strong {
    color: #1a1a1a;
}

.commentary-description {
    font-size: 15px;
    color: #1a1a1a;
    margin: 5px 0;
    line-height: 1.5;
}

.commentary-event-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #ff9800;
    color: #ffffff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
}

.commentary-runs {
    min-width: 50px;
    text-align: right;
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
}

/* ============================================
   FACTS TAB
   ============================================ */

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.fact-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.fact-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.fact-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.fact-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.fact-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ============================================
   LIVE MATCHES WIDGET
   ============================================ */

.cricket-live-matches-widget {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cricket-widget-header h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.cricket-matches-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.cricket-match-card {
    min-width: 300px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.cricket-match-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.cricket-match-card.live {
    border-color: #28a745;
    background: #f0fff4;
}

.match-format-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #007bff;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.match-status {
    margin-bottom: 10px;
}

.status-live {
    color: #28a745;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

.match-competition {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.match-teams {
    margin: 15px 0;
}

.team {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.team-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.view-match-btn {
    display: block;
    text-align: center;
    background: #007bff;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}

.view-match-btn:hover {
    background: #0056b3;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .cricket-match-container {
        padding: 15px;
    }

    .cricket-match-header {
        flex-direction: column;
        gap: 15px;
    }

    .match-title {
        font-size: 22px;
    }

    .teams-score-section {
        flex-direction: column;
        padding: 20px;
    }

    .vs-separator {
        padding: 15px 0;
    }

    .team-score {
        font-size: 30px;
    }

    .tabs-navigation {
        gap: 2px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .tab-btn svg {
        display: none;
    }

    .match-info-grid {
        grid-template-columns: 1fr;
    }

    .squad-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .facts-grid {
        grid-template-columns: 1fr;
    }

    .commentary-row {
        flex-direction: column;
        gap: 10px;
    }

    .commentary-over-no {
        min-width: auto;
    }

    .commentary-runs {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .match-title {
        font-size: 20px;
    }

    .team-name {
        font-size: 18px;
    }

    .team-score {
        font-size: 26px;
    }

    .team-flag {
        width: 45px;
        height: 45px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .scorecard-table {
        font-size: 12px;
    }

    .scorecard-table th,
    .scorecard-table td {
        padding: 8px 10px;
    }

    .player-col {
        min-width: 150px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .tabs-navigation,
    .auto-refresh-indicator,
    .filter-btn {
        display: none;
    }

    .tab-panel {
        display: block !important;
        page-break-inside: avoid;
    }

    .cricket-match-container {
        box-shadow: none;
    }
}
