/* Live Match Banner CSS */
.live-banner {
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(255, 8, 68, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse-banner 2s ease-in-out infinite;
}

.live-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 8, 68, 0.4);
}

@keyframes pulse-banner {
    0%,
    100% {
        box-shadow: 0 8px 25px rgba(255, 8, 68, 0.3);
    }

    50% {
        box-shadow: 0 8px 35px rgba(255, 8, 68, 0.5);
    }
}

.live-banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: white;
    flex: 1;
}

.live-badge-icon {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: blink-live 1.5s ease-in-out infinite;
}

.live-badge-icon i {
    font-size: 1.8rem;
    color: white;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

@keyframes blink-live {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.live-banner-text h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.live-banner-text p {
    margin: 0.25rem 0 0 0;
    font-size: 1rem;
    opacity: 0.95;
}

.live-banner-action {
    background: white;
    color: #ff0844;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.live-banner:hover .live-banner-action {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.match-count-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 0.5rem;
}

@media (max-width: 768px) {
    .live-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .live-banner-content {
        flex-direction: column;
        gap: 1rem;
    }

    .live-banner-text h3 {
        font-size: 1.25rem;
    }

    .live-banner-text p {
        font-size: 0.9rem;
    }

    .live-banner-action {
        width: 100%;
    }
}

/* Match Display Styles */
.hover-link {
    transition: all 0.2s ease;
}

.hover-link:hover {
    opacity: 0.8;
    text-decoration: underline !important;
}

.match-week {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.match-week h5 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #16a34a;
    display: inline-block;
}

.match-card {
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb !important;
}

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

.team {
    transition: all 0.2s ease;
}

.team--win {
    background: linear-gradient(90deg, #dcfce7 0%, #bbf7d0 100%);
    border-radius: 8px;
    padding: 8px;
    color: #166534;
}

.team--draw {
    background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    padding: 8px;
    color: #92400e;
}

.score-pill {
    background: #f3f4f6;
    color: #374151;
}

.score-pill--p1 {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.score-pill--p2 {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.score-pill--draw {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.border-thick-win {
    border-width: 3px !important;
}

.leg-chip {
    font-size: 0.8rem;
}

.leg-chip--p1 {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #16a34a !important;
}

.leg-chip--p2 {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #16a34a !important;
}

.penalty-indicator {
    color: #f59e0b;
    font-style: italic;
    font-weight: 500;
}

.meta-badges .badge {
    margin: 0 2px;
    font-size: 0.75rem;
}

.bg-gradient-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.bg-gradient-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
}

/* Desktop Avatar & Logo Styles (outside mobile) */
.results-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center top;
    transition: all 0.2s ease;
    display: block;
    margin-right: 4px;
}

.results-logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
    background: #fafafa;
    transition: all 0.2s ease;
    display: block;
    margin-right: 4px;
}

/* For right-aligned team (P2), use margin-left instead */
.d-flex.flex-row-reverse .results-avatar,
.d-flex.flex-row-reverse .results-logo {
    margin-right: 0;
    margin-left: 4px;
}

/* Hover Effects for Desktop */
.results-avatar:hover {
    transform: scale(1.05);
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.results-logo:hover {
    transform: scale(1.02);
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile Specific Styles */
@media (max-width: 767px) {
    .match-week {
        margin-bottom: 20px;
        padding: 15px;
    }

    .match-week h5 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .match-card {
        margin-bottom: 15px !important;
    }

    .card-body {
        padding: 12px !important;
    }

    /* Mobile Match Layout */
    .mobile-match-layout {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-match-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .mobile-team {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
        /* Important for text truncation */
    }

    .mobile-team.team--win {
        background: linear-gradient(90deg, #dcfce7 0%, #bbf7d0 100%);
        border-radius: 8px;
        padding: 8px;
    }

    .mobile-team.team--draw {
        background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
        border-radius: 8px;
        padding: 8px;
    }

    /* Mobile Results Avatar & Logo Styles */
    .mobile-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid #e5e7eb;
        flex-shrink: 0;
        object-fit: cover;
        object-position: center top;
        display: block;
    }

    .mobile-logo {
        width: 40px;
        height: 40px;
        border-radius: 6px;
        border: 1px solid #f3f4f6;
        flex-shrink: 0;
        object-fit: contain;
        object-position: center;
        background: #fafafa;
        display: block;
    }

    .winner-avatar {
        border-color: #16a34a !important;
        border-width: 3px !important;
        box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
    }

    .team-info {
        min-width: 0;
        flex: 1;
    }

    .team-name {
        font-weight: 600;
        font-size: 0.9rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* VS Section */
    .mobile-vs-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .vs-line {
        width: 20px;
        height: 1px;
        background: #cbd5e1;
    }

    .mobile-score {
        font-weight: 700;
        font-size: 1.1rem;
        padding: 6px 12px;
        border-radius: 20px;
        min-width: 60px;
        text-align: center;
    }

    /* Match Details */
    .mobile-match-details {
        border-top: 1px solid #f1f5f9;
        padding-top: 12px;
    }

    .mobile-meta-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        margin-bottom: 8px;
    }

    .meta-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
        border-radius: 12px;
        font-weight: 500;
        text-decoration: none;
    }

    .meta-badge--round {
        background: #1f2937;
        color: white;
    }

    .meta-badge--group {
        background: #6b7280;
        color: white;
    }

    .meta-badge--date {
        background: #3b82f6;
        color: white;
    }

    .meta-badge--live {
        background: #ef4444;
        color: white;
        animation: pulse 2s infinite;
    }

    .meta-badge--ai {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .meta-badge--ai:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    /* Legs Section */
    .mobile-legs-section {
        margin-top: 8px;
    }

    .legs-title {
        font-size: 0.75rem;
        font-weight: 600;
        color: #6b7280;
        margin-bottom: 6px;
        text-align: center;
    }

    .legs-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .leg-item {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
        border: 1px solid #e5e7eb;
    }

    .leg-item--p1 {
        background: #dcfce7;
        color: #166534;
        border-color: #16a34a;
    }

    .leg-item--p2 {
        background: #dcfce7;
        color: #166534;
        border-color: #16a34a;
    }

    .leg-item--draw {
        background: #fef3c7;
        color: #92400e;
        border-color: #f59e0b;
    }

    .leg-number {
        font-weight: 600;
    }

    .leg-score {
        font-weight: 700;
    }

    .penalty-score {
        font-size: 0.65rem;
        color: #f59e0b;
        font-style: italic;
        font-weight: 500;
        margin-left: 4px;
    }

    /* Animation */
    @keyframes pulse {
        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.7;
        }
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    .match-week {
        padding: 18px;
    }

    .team--win,
    .team--draw {
        padding: 7px;
    }

    .results-avatar,
    .results-logo {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .match-week {
        padding: 25px;
    }

    .match-card {
        margin-bottom: 12px !important;
    }

    .results-avatar,
    .results-logo {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .mobile-avatar,
    .mobile-logo {
        width: 36px !important;
        height: 36px !important;
    }

    .team-name {
        font-size: 0.85rem !important;
    }
}
