/* =====================================================
   FIFA World Cup 2026 Widget — Waathiq Template
   ===================================================== */

/* ── Widget Container ───────────────────────────────── */
.wc-widget {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}
.wc-widget:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ── Header ─────────────────────────────────────────── */
.wc-header {
    background: linear-gradient(135deg, #1A3A52 0%, #0a1e30 60%, #C41E3A 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}
.wc-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.wc-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(196,30,58,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.wc-trophy-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    position: relative;
    z-index: 1;
    animation: wc-trophy-pulse 3s ease-in-out infinite;
}
@keyframes wc-trophy-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.wc-header-text {
    position: relative;
    z-index: 1;
}
.wc-header-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.wc-header-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
    font-weight: 500;
}
.wc-header-badge {
    margin-right: auto;
    position: relative;
    z-index: 1;
}
.wc-countdown-badge {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.72rem;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.wc-countdown-badge .wc-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    animation: wc-live-blink 1.5s ease-in-out infinite;
}

/* ── Tabs ────────────────────────────────────────────── */
.wc-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    background: var(--light-bg);
}
.wc-tab-btn {
    flex: 1;
    padding: 0.85rem 0.5rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.wc-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.wc-tab-btn.active {
    color: var(--primary-color);
    background: var(--white);
}
.wc-tab-btn.active::after {
    width: 60%;
}
.wc-tab-btn:hover:not(.active) {
    color: var(--text-dark);
    background: rgba(0,0,0,0.02);
}
.wc-tab-icon {
    font-size: 1.05rem;
}

/* ── Tab Content ─────────────────────────────────────── */
.wc-tab-content {
    display: none;
    padding: 1.25rem;
    animation: wc-fade-in 0.3s ease;
}
.wc-tab-content.active {
    display: block;
}
@keyframes wc-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Loading State ───────────────────────────────────── */
.wc-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}
.wc-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: wc-spin 0.8s linear infinite;
}
@keyframes wc-spin {
    to { transform: rotate(360deg); }
}
.wc-loading-text {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Error State ─────────────────────────────────────── */
.wc-error {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
}
.wc-error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.wc-error-text {
    font-size: 0.85rem;
}
.wc-retry-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}
.wc-retry-btn:hover {
    background: var(--secondary-color);
}

/* ── Match Card ──────────────────────────────────────── */
.wc-matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.wc-match-card {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}
.wc-match-card:hover {
    border-color: rgba(196, 30, 58, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.wc-match-card.wc-live {
    border-color: #C41E3A;
    background: linear-gradient(135deg, rgba(196,30,58,0.03) 0%, var(--light-bg) 100%);
}
.wc-match-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-light);
}
.wc-match-group-badge {
    background: var(--secondary-color);
    color: #fff;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}
.wc-match-type-badge {
    background: linear-gradient(135deg, #C41E3A, #a01530);
    color: #fff;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
}
.wc-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #C41E3A;
    color: #fff;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    animation: wc-live-glow 2s ease-in-out infinite;
}
.wc-live-indicator .wc-live-dot-sm {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: wc-live-blink 1.5s ease-in-out infinite;
}
@keyframes wc-live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes wc-live-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(196, 30, 58, 0.3); }
    50% { box-shadow: 0 0 12px rgba(196, 30, 58, 0.6); }
}
.wc-match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.wc-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}
.wc-team-flag {
    width: 42px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.08);
}
.wc-team-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wc-match-score {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.wc-score-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    min-width: 28px;
    text-align: center;
    line-height: 1;
}
.wc-score-separator {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-light);
}
.wc-match-time {
    text-align: center;
    min-width: 60px;
    flex-shrink: 0;
}
.wc-match-time-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}
.wc-match-time-sub {
    font-size: 0.65rem;
    color: var(--text-light);
}
.wc-match-date {
    font-size: 0.7rem;
    color: var(--text-light);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

/* ── Groups Tab ──────────────────────────────────────── */
.wc-groups-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    justify-content: center;
}
.wc-group-filter-btn {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
}
.wc-group-filter-btn:hover,
.wc-group-filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.wc-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.wc-group-card {
    background: var(--light-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.wc-group-card:hover {
    border-color: rgba(196, 30, 58, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.wc-group-name {
    background: linear-gradient(135deg, var(--secondary-color), #0a1e30);
    color: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.5px;
}
.wc-group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}
.wc-group-table th {
    background: rgba(0,0,0,0.04);
    padding: 0.4rem 0.3rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wc-group-table th:first-child {
    text-align: right;
    padding-right: 0.6rem;
}
.wc-group-table td {
    padding: 0.45rem 0.3rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}
.wc-group-table tr:last-child td {
    border-bottom: none;
}
.wc-group-table td:first-child {
    text-align: right;
    padding-right: 0.5rem;
}
.wc-group-team-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.wc-group-team-flag {
    width: 22px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
}
.wc-group-team-name {
    font-weight: 600;
    font-size: 0.73rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
.wc-group-pts {
    font-weight: 800;
    color: var(--primary-color);
}

/* ── Teams Tab ───────────────────────────────────────── */
.wc-teams-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.wc-team-card {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: default;
}
.wc-team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}
.wc-team-card-flag {
    width: 48px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.08);
}
.wc-team-card-name {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.2;
}
.wc-team-card-group {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--white);
    background: var(--secondary-color);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

/* ── Footer ──────────────────────────────────────────── */
.wc-widget-footer {
    text-align: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--light-bg);
}
.wc-widget-footer-text {
    font-size: 0.65rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}
.wc-widget-footer-text a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ── Dark Mode ───────────────────────────────────────── */
html[data-theme="dark"] .wc-widget {
    background: #162230;
    border-color: #2A3A4A;
}
html[data-theme="dark"] .wc-widget:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .wc-tabs {
    background: #1A2736;
    border-bottom-color: #2A3A4A;
}
html[data-theme="dark"] .wc-tab-btn.active {
    background: #162230;
}
html[data-theme="dark"] .wc-tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.03);
}
html[data-theme="dark"] .wc-match-card {
    background: #1A2736;
    border-color: #2A3A4A;
}
html[data-theme="dark"] .wc-match-card:hover {
    border-color: rgba(196, 30, 58, 0.4);
}
html[data-theme="dark"] .wc-match-card.wc-live {
    background: linear-gradient(135deg, rgba(196,30,58,0.06) 0%, #1A2736 100%);
}
html[data-theme="dark"] .wc-group-card {
    background: #1A2736;
    border-color: #2A3A4A;
}
html[data-theme="dark"] .wc-group-card:hover {
    border-color: rgba(196, 30, 58, 0.4);
}
html[data-theme="dark"] .wc-group-table th {
    background: rgba(255,255,255,0.04);
}
html[data-theme="dark"] .wc-group-table td {
    border-bottom-color: #2A3A4A;
}
html[data-theme="dark"] .wc-group-filter-btn {
    background: #1A2736;
    border-color: #2A3A4A;
    color: var(--text-light);
}
html[data-theme="dark"] .wc-group-filter-btn:hover,
html[data-theme="dark"] .wc-group-filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
html[data-theme="dark"] .wc-team-card {
    background: #1A2736;
    border-color: #2A3A4A;
}
html[data-theme="dark"] .wc-team-card:hover {
    border-color: var(--primary-color);
}
html[data-theme="dark"] .wc-team-flag,
html[data-theme="dark"] .wc-team-card-flag,
html[data-theme="dark"] .wc-group-team-flag {
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .wc-widget-footer {
    background: #1A2736;
    border-top-color: #2A3A4A;
}
html[data-theme="dark"] .wc-score-num {
    color: #e0e0e0;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .wc-widget {
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
    .wc-header {
        padding: 1rem 1.25rem;
    }
    .wc-header-title {
        font-size: 1.05rem;
    }
    .wc-header-sub {
        font-size: 0.7rem;
    }
    .wc-countdown-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }
    .wc-tab-btn {
        font-size: 0.78rem;
        padding: 0.7rem 0.3rem;
    }
    .wc-tab-content {
        padding: 1rem;
    }
    .wc-groups-grid {
        grid-template-columns: 1fr;
    }
    .wc-teams-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .wc-team-card-flag {
        width: 40px;
        height: 27px;
    }
    .wc-team-card-name {
        font-size: 0.68rem;
    }
    .wc-team-flag {
        width: 36px;
        height: 24px;
    }
    .wc-team-name {
        font-size: 0.75rem;
    }
    .wc-score-num {
        font-size: 1.3rem;
    }
    .wc-trophy-icon {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .wc-header {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }
    .wc-header-title {
        font-size: 0.95rem;
    }
    .wc-countdown-badge {
        display: none;
    }
    .wc-tab-btn {
        font-size: 0.72rem;
        padding: 0.6rem 0.25rem;
        gap: 0.25rem;
    }
    .wc-tab-icon {
        font-size: 0.9rem;
    }
    .wc-tab-content {
        padding: 0.75rem;
    }
    .wc-match-card {
        padding: 0.75rem;
    }
    .wc-teams-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    .wc-team-card {
        padding: 0.5rem 0.3rem;
    }
    .wc-team-card-flag {
        width: 36px;
        height: 24px;
    }
    .wc-team-card-name {
        font-size: 0.63rem;
    }
    .wc-group-team-name {
        max-width: 55px;
        font-size: 0.65rem;
    }
}
