/* ===== WORLD CUP 2026 - COMPLETE CSS ===== */
:root {
    --wc-green-light: #E8F5E9;
    --wc-green-mid: #A5D6A7;
    --wc-green-dark: #388E3C;
    --wc-blue-light: #E3F2FD;
    --wc-blue-mid: #90CAF9;
    --wc-blue-dark: #1565C0;
    --wc-gold: #FFD700;
    --wc-gold-light: #FFF8E1;
    --wc-orange: #FF8F00;
    --wc-orange-light: #FFE0B2;
    --wc-white: #FFFFFF;
    --wc-gray: #374151;
    --wc-gray-light: #F9FAFB;
    --wc-gray-mid: #E5E7EB;
    --grad-hero: linear-gradient(135deg, #1a472a 0%, #1565C0 50%, #0d2137 100%);
    --grad-card: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    --grad-green: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    --grad-blue: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    --shadow-card: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-hover: 0 16px 48px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
}

* { box-sizing: border-box; }

body.wc-body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: linear-gradient(160deg, #f0fdf4 0%, #eff6ff 50%, #fefce8 100%);
    min-height: 100vh;
    color: var(--wc-gray);
    direction: rtl;
}

/* ===== NAVBAR ===== */
.wc-navbar {
    background: var(--grad-hero) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 0.6rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.wc-brand {
    color: #fff !important;
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
}

.brand-year {
    background: var(--wc-gold);
    color: #1a1a1a;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 3px;
}

.wc-nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.25s;
    font-size: 0.92rem;
}

.wc-nav-link:hover, .wc-nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.wc-nav-link i { margin-left: 5px; }

.wc-btn-login {
    background: var(--wc-gold);
    color: #1a1a1a !important;
    border-radius: 20px;
    padding: 0.4rem 1.2rem !important;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s;
    text-decoration: none;
}
.wc-btn-login:hover { background: #FFC200; transform: translateY(-1px); }

.wc-dropdown { border-radius: var(--radius-sm); border: none; box-shadow: var(--shadow-card); }
.wc-dropdown .dropdown-item { padding: 0.6rem 1rem; font-size: 0.9rem; }
.wc-dropdown .dropdown-item:hover { background: var(--wc-green-light); }
.wc-dropdown .dropdown-item i { margin-left: 8px; width: 16px; }

/* ===== MAIN ===== */
.wc-main { min-height: calc(100vh - 120px); }

/* ===== TOAST ===== */
.wc-toast {
    position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
    z-index: 9999; padding: 12px 20px; border-radius: 30px;
    font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px;
    animation: slideDown 0.3s ease; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    max-width: 90vw; text-align: center;
}
.success-toast { background: #E8F5E9; color: #1B5E20; border: 1px solid #A5D6A7; }
.error-toast { background: #FFEBEE; color: #B71C1C; border: 1px solid #FFCDD2; }
.wc-toast button { background: none; border: none; font-size: 1.1rem; cursor: pointer; opacity: 0.6; padding: 0 0 0 5px; }
@keyframes slideDown { from { opacity: 0; top: 60px; } to { opacity: 1; top: 80px; } }

/* ===== HERO SECTION ===== */
.wc-hero {
    background: var(--grad-hero);
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.wc-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wc-hero-title { color: #fff; font-size: 2.2rem; font-weight: 800; position: relative; }
.wc-hero-subtitle { color: rgba(255,255,255,0.85); font-size: 1.1rem; position: relative; }

/* ===== GLASS CARD ===== */
.glass-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    overflow: hidden;
}
.glass-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

/* ===== STAT CARD ===== */
.stat-card {
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius);
    padding: 1.4rem;
    text-align: center;
    border: 1px solid var(--wc-gray-mid);
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.stat-card.green::before { background: linear-gradient(90deg, #388E3C, #66BB6A); }
.stat-card.blue::before { background: linear-gradient(90deg, #1565C0, #42A5F5); }
.stat-card.gold::before { background: linear-gradient(90deg, #F9A825, #FFD54F); }
.stat-card.orange::before { background: linear-gradient(90deg, #E64A19, #FF7043); }

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: #6B7280; margin-top: 4px; font-weight: 500; }
.stat-icon { font-size: 1.6rem; margin-bottom: 8px; }

/* ===== MATCH CARD ===== */
.match-card {
    background: rgba(255,255,255,0.92);
    border-radius: var(--radius);
    border: 1px solid var(--wc-gray-mid);
    box-shadow: var(--shadow-card);
    padding: 1rem;
    margin-bottom: 12px;
    transition: all 0.3s;
}
.match-card:hover { box-shadow: var(--shadow-hover); border-color: var(--wc-blue-mid); }
.match-card.featured { border-right: 4px solid var(--wc-gold); }
.match-card.predicted { border-right: 4px solid var(--wc-green-dark); }
.match-card.closed { opacity: 0.8; }

.match-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow: hidden; }
.team-side { display: flex; flex-direction: column; align-items: center; min-width: 80px; max-width: 110px; overflow: hidden; }
.team-flag {
    width: 44px;
    height: 30px;
    max-width: 44px;
    max-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 4px;
    line-height: 1;
    font-size: 1.5rem;
    flex: 0 0 auto;
}
.team-flag img,
img.team-flag {
    width: 44px !important;
    height: 30px !important;
    max-width: 44px !important;
    max-height: 30px !important;
    object-fit: cover !important;
    object-position: center center;
    border-radius: 4px;
    display: block;
}
.team-name { font-size: 0.82rem; font-weight: 700; text-align: center; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.match-score { text-align: center; flex: 1; }
.score-display { font-size: 1.5rem; font-weight: 800; color: var(--wc-gray); letter-spacing: 2px; }
.score-vs { font-size: 0.8rem; color: #9CA3AF; font-weight: 600; }
.score-sep { color: #D1D5DB; }

.match-info { font-size: 0.75rem; color: #6B7280; margin-top: 8px; }
.match-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.badge-open { background: #DCFCE7; color: #166534; }
.badge-closed { background: #FEE2E2; color: #991B1B; }
.badge-live { background: #FEF3C7; color: #92400E; animation: pulse 1.5s infinite; }
.badge-finished { background: #F3F4F6; color: #374151; }
.badge-predicted { background: #DBEAFE; color: #1E40AF; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ===== PREDICTION INPUT ===== */
.pred-score-input {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin: 1.5rem 0;
}
.pred-team { text-align: center; min-width: 100px; }
.pred-team-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; }
.pred-number { display: flex; align-items: center; gap: 6px; }
.pred-number button {
    width: 38px; height: 38px; border-radius: 50%;
    border: 2px solid var(--wc-green-mid);
    background: white; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s; color: var(--wc-green-dark);
}
.pred-number button:hover { background: var(--wc-green-light); border-color: var(--wc-green-dark); }
.pred-number input {
    width: 60px; height: 55px; text-align: center;
    font-size: 1.8rem; font-weight: 800; border: 2px solid var(--wc-gray-mid);
    border-radius: var(--radius-sm); background: white;
}
.pred-number input:focus { border-color: var(--wc-green-dark); outline: none; }
.pred-separator { font-size: 1.8rem; font-weight: 800; color: #9CA3AF; }

/* ===== LEADERBOARD ===== */
.lb-row {
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--wc-gray-mid);
    transition: all 0.2s;
}
.lb-row:hover { box-shadow: var(--shadow-card); }
.lb-row.me { background: linear-gradient(135deg, #EFF6FF, #F0FDF4); border-color: var(--wc-blue-mid); }
.lb-row.top-1 { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border-color: #F9A825; }
.lb-row.top-2 { background: linear-gradient(135deg, #F9FAFB, #F3F4F6); border-color: #9CA3AF; }
.lb-row.top-3 { background: linear-gradient(135deg, #FFF7ED, #FFEDD5); border-color: #F97316; }

.lb-rank { min-width: 40px; font-weight: 800; text-align: center; font-size: 1rem; }
.lb-rank.medal-1 { color: #F9A825; }
.lb-rank.medal-2 { color: #9E9E9E; }
.lb-rank.medal-3 { color: #FF7043; }
.lb-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--wc-gray-mid); }
.lb-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.lb-points { font-weight: 800; font-size: 1rem; color: var(--wc-green-dark); }
.lb-change { font-size: 0.72rem; }
.lb-change.up { color: #16A34A; }
.lb-change.down { color: #DC2626; }

/* ===== ADMIN ===== */
.admin-sidebar {
    background: rgba(255,255,255,0.9);
    border-left: 1px solid var(--wc-gray-mid);
    min-height: calc(100vh - 70px);
    padding: 1rem 0;
}
.admin-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 0.7rem 1.2rem; color: var(--wc-gray);
    text-decoration: none; font-size: 0.9rem; font-weight: 500;
    border-radius: 0; transition: all 0.2s;
    border-right: 3px solid transparent;
}
.admin-nav-link:hover, .admin-nav-link.active {
    background: var(--wc-green-light);
    color: var(--wc-green-dark);
    border-right-color: var(--wc-green-dark);
}
.admin-nav-link i { width: 18px; }

/* ===== STAGES TIMELINE ===== */
.stages-timeline { display: flex; gap: 6px; overflow-x: auto; padding: 0.5rem 0; }
.stage-pill {
    flex-shrink: 0; padding: 6px 14px;
    border-radius: 20px; font-size: 0.8rem; font-weight: 700;
    border: 2px solid var(--wc-gray-mid); background: white;
    cursor: pointer; text-decoration: none; color: var(--wc-gray);
    transition: all 0.2s; white-space: nowrap;
}
.stage-pill:hover { border-color: var(--wc-green-dark); color: var(--wc-green-dark); }
.stage-pill.active { background: var(--wc-green-dark); color: white; border-color: var(--wc-green-dark); }

/* ===== GROUP TABLE ===== */
.group-table { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.group-table th { background: var(--grad-hero); color: white; font-weight: 600; font-size: 0.8rem; }
.group-table td { font-size: 0.85rem; vertical-align: middle; }
.group-table tr:hover td { background: var(--wc-green-light); }
.qualified-row td { background: rgba(232,245,233,0.5) !important; }

/* ===== COUNTDOWN ===== */
.countdown-widget {
    background: var(--grad-hero);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    color: white;
}
.countdown-units { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
.count-unit { text-align: center; }
.count-num { font-size: 1.8rem; font-weight: 800; background: rgba(255,255,255,0.15); border-radius: 8px; padding: 6px 12px; min-width: 54px; display: block; }
.count-label { font-size: 0.7rem; margin-top: 3px; opacity: 0.8; }

/* ===== FORMS ===== */
.wc-input {
    border: 1.5px solid var(--wc-gray-mid); border-radius: var(--radius-sm);
    padding: 0.7rem 1rem; font-family: 'Cairo', sans-serif;
    font-size: 0.9rem; width: 100%; transition: border 0.2s;
    background: white;
}
.wc-input:focus { border-color: var(--wc-green-dark); outline: none; box-shadow: 0 0 0 3px rgba(56,142,60,0.1); }

.wc-btn-primary {
    background: linear-gradient(135deg, #2E7D32, #388E3C);
    color: white; border: none; border-radius: var(--radius-sm);
    padding: 0.75rem 2rem; font-family: 'Cairo', sans-serif;
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.25s; width: 100%;
}
.wc-btn-primary:hover { background: linear-gradient(135deg, #1B5E20, #2E7D32); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,125,50,0.35); }

.wc-btn-secondary {
    background: white; color: var(--wc-gray); border: 2px solid var(--wc-gray-mid);
    border-radius: var(--radius-sm); padding: 0.65rem 1.5rem;
    font-family: 'Cairo', sans-serif; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.wc-btn-secondary:hover { border-color: var(--wc-green-dark); color: var(--wc-green-dark); }

/* ===== BOTTOM NAV ===== */
.wc-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--wc-gray-mid);
    display: flex; justify-content: space-around; align-items: center;
    padding: 8px 0; padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; color: #9CA3AF; text-decoration: none;
    font-size: 0.65rem; font-weight: 600; padding: 4px 16px;
    border-radius: 8px; transition: all 0.2s;
}
.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--wc-green-dark); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: var(--grad-hero);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.login-box {
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%; max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}
.login-logo { font-size: 3rem; text-align: center; margin-bottom: 0.5rem; }
.login-title { text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--wc-gray); margin-bottom: 0.25rem; }
.login-subtitle { text-align: center; font-size: 0.85rem; color: #6B7280; margin-bottom: 1.5rem; }

/* ===== FOOTER ===== */
.wc-footer {
    background: var(--grad-hero);
    color: rgba(255,255,255,0.7);
    padding: 1rem 0; text-align: center; font-size: 0.82rem;
    margin-top: 3rem;
}

/* ===== SECTION HEADERS ===== */
.section-header { margin-bottom: 1.5rem; }
.section-title { font-size: 1.3rem; font-weight: 800; color: var(--wc-gray); margin: 0; }
.section-title-line { width: 40px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #388E3C, #42A5F5); margin-top: 6px; }

/* ===== BADGE ACHIEVEMENTS ===== */
.achievement-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.badge-gold { background: #FEF3C7; color: #92400E; }
.badge-silver { background: #F3F4F6; color: #374151; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .wc-hero-title { font-size: 1.5rem; }
    .stat-value { font-size: 1.5rem; }
    .match-card { padding: 0.8rem; }
    .team-name { font-size: 0.75rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .login-box { padding: 1.8rem 1.2rem; }
    .pred-number input { width: 52px; height: 48px; font-size: 1.5rem; }
    .lb-row { padding: 0.6rem 0.8rem; gap: 8px; }
    .lb-name { font-size: 0.82rem; }
    .score-display { font-size: 1.2rem; }
}

@media (max-width: 360px) {
    .team-name { max-width: 65px; }
    .pred-number button { width: 32px; height: 32px; }
    .pred-number input { width: 46px; height: 44px; }
}

/* ===== UTILITIES ===== */
.text-green { color: var(--wc-green-dark) !important; }
.text-gold { color: var(--wc-orange) !important; }
.bg-green-light { background: var(--wc-green-light) !important; }
.bg-blue-light { background: var(--wc-blue-light) !important; }
.round-pill { border-radius: 50px !important; }
.fw-800 { font-weight: 800 !important; }
.cairo { font-family: 'Cairo', sans-serif !important; }

/* Admin table styles */
.admin-table th { background: #F9FAFB; font-size: 0.82rem; font-weight: 700; border-bottom: 2px solid var(--wc-gray-mid); }
.admin-table td { font-size: 0.85rem; vertical-align: middle; }
.admin-table tr:hover td { background: var(--wc-green-light); }

/* Point result colors */
.pts-exact { color: #16A34A; font-weight: 800; }
.pts-partial { color: #2563EB; font-weight: 700; }
.pts-wrong { color: #DC2626; }
.pts-pending { color: #92400E; }

/* ---- Utility: Font Weights ---- */
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
