/* ==========================================
   TARAFTAR.LOL — Stil Dosyası
   Koyu / Açık Tema + Memleket.lol Esintili Modern Tasarım
   ========================================== */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0b131b;
    --bg-surface: #131e2b;
    --bg-surface-raised: #1a293a;
    --bg-hover: #1f3348;
    --bg-pill: rgba(255, 255, 255, 0.06);
    --pill-border: rgba(255, 255, 255, 0.12);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #4ecdc4;
    --accent-red: #e11d48;
    --accent-hover: #3dbdb5;
    --gold: #f59e0b;
    --gold-hover: #d97706;
    --danger: #ef4444;
    --success: #22c55e;
    --silver: #94a3b8;
    --bronze: #d97706;
    --border: #243547;
    --border-light: #2d4257;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 30px;
    --shadow: 0 4px 24px rgba(0,0,0,0.35);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.25);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --transition-theme: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-surface: #ffffff;
    --bg-surface-raised: #f8fafc;
    --bg-hover: #f1f5f9;
    --bg-pill: #fee2e2;
    --pill-border: #fecaca;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #0d9488;
    --accent-red: #dc2626;
    --accent-hover: #0f766e;
    --gold: #d97706;
    --gold-hover: #b45309;
    --danger: #dc2626;
    --success: #16a34a;
    --silver: #64748b;
    --bronze: #b45309;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-card: 0 2px 10px rgba(0,0,0,0.04);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: var(--transition-theme);
}

a { color: inherit; text-decoration: none; }

/* ---------- CONTAINER ---------- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 18px 48px;
}

/* ---------- HEADER & NAVBAR ---------- */
.header-wrapper {
    padding: 18px 0 14px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-theme);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header__logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease;
}

.header__logo:hover {
    transform: scale(1.02);
    text-decoration: none;
}

.header__logo-ball {
    font-size: 1.35rem;
}

.logo-lol {
    color: #f59e0b; /* Koyu Sarı / Amber Gold */
}

/* Desktop Navbar */
.header__nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
}

.nav-link:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.nav-link--crown {
    color: var(--gold) !important;
    font-weight: 800;
}

.nav-link--crown:hover {
    color: var(--gold-hover) !important;
}

.crown-emoji {
    font-size: 1.05rem;
}

.theme-toggle-btn {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
}

.theme-toggle-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.menu-toggle-btn {
    display: none; /* hidden on desktop */
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    box-shadow: var(--shadow-card);
}

/* ---------- HERO SECTION (MEMLEKET.LOL STYLE) ---------- */
.hero-section {
    text-align: center;
    padding: 16px 0 28px;
}

/* Stats Pill / Capsule */
.stats-pill-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-pill);
    border: 1px solid var(--pill-border);
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-card);
    transition: var(--transition-theme);
}

[data-theme="light"] .stats-pill {
    color: #991b1b;
}

.stats-pill__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.stats-pill__item strong {
    color: var(--text-primary);
    font-weight: 800;
}

[data-theme="light"] .stats-pill__item strong {
    color: #7f1d1d;
}

.stats-pill__divider {
    opacity: 0.4;
    font-size: 0.75rem;
}

.live-dot-green {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--success);
    animation: live-pulse 1.6s ease-in-out infinite;
}

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

/* Headline Typography */
.hero-title {
    font-size: 2.35rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.22;
    letter-spacing: -0.035em;
    margin-bottom: 12px;
}

.hero-title__highlight {
    color: var(--accent-red);
    position: relative;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 10px;
    line-height: 1.55;
    font-weight: 500;
}

.hero-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---------- LEADERBOARD CARD CONTAINER ---------- */
.leaderboard-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: var(--transition-theme);
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface-raised);
    flex-wrap: wrap;
    gap: 12px;
    transition: var(--transition-theme);
}

.section-card-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.section-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.section-card-header__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.legend-badge--crown {
    color: var(--gold) !important;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot--red { background: var(--danger); }

/* ---------- TABLE COMPONENT ---------- */
.leaderboard {
    width: 100%;
}

.leaderboard__header {
    display: grid;
    grid-template-columns: 56px 1fr 110px 88px;
    padding: 12px 18px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    background: var(--bg-surface);
    transition: var(--transition-theme);
}

.leaderboard__row {
    display: grid;
    grid-template-columns: 56px 1fr 110px 88px;
    padding: 14px 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease, transform 0.3s ease;
    cursor: default;
}

.leaderboard__row:last-child {
    border-bottom: none;
}

.leaderboard__row:hover {
    background: var(--bg-hover);
}

/* Rank medals */
.leaderboard__row[data-rank="1"] { background: rgba(245, 158, 11, 0.05); }
.leaderboard__row[data-rank="2"] { background: rgba(148, 163, 184, 0.04); }
.leaderboard__row[data-rank="3"] { background: rgba(217, 119, 6, 0.04); }

.rank {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank--gold { color: var(--gold); }
.rank--silver { color: var(--silver); }
.rank--bronze { color: var(--bronze); }

.team-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.team-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

.team-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.points {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-align: right;
    padding-right: 8px;
    letter-spacing: -0.02em;
}

.points-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
}

/* Vote Button */
.vote-btn {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: var(--font);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.vote-btn:hover:not(:disabled) {
    background: var(--accent);
    color: #ffffff;
    transform: scale(1.04);
}

.vote-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.vote-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.vote-btn--voted {
    background: rgba(78, 205, 196, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    opacity: 0.9;
    cursor: default;
}

.rank-change {
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 4px;
}
.rank-change--up { color: var(--success); }
.rank-change--down { color: var(--danger); }

/* ---------- FLOATING +1 PARTICLE ---------- */
.vote-particle {
    position: fixed;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent);
    pointer-events: none;
    z-index: 10000;
    animation: float-up 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes float-up {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-65px) scale(0.7); }
}

/* ---------- RECENT VOTES ---------- */
.recent-votes {
    margin-top: 24px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-theme);
}

.recent-votes__title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.recent-votes__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.recent-vote-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    background: var(--bg-surface-raised);
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.recent-vote-item__team {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-vote-item__team img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.recent-vote-item__plus { color: var(--accent); font-weight: 800; }
.recent-vote-item__time { color: var(--text-muted); font-size: 0.76rem; }

/* ---------- TRIBUN TAHTI SECTION ---------- */
.crown-banner {
    margin-top: 24px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-surface) 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition-theme);
}

.crown-banner__icon { font-size: 2.2rem; margin-bottom: 4px; }
.crown-banner__title { font-size: 1.15rem; font-weight: 900; color: var(--gold); }
.crown-banner__status { font-size: 0.9rem; color: var(--text-secondary); margin-top: 6px; }

/* ---------- FOOTER ---------- */
.footer {
    text-align: center;
    padding: 32px 0 10px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    transition: var(--transition-theme);
}

.footer__disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

.footer__brand {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 700;
}

/* ---------- VOTE LIMIT BANNER ---------- */
.vote-limit-banner {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 18px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    display: none;
}

.vote-limit-banner--visible { display: block; }

/* ---------- MOBILE DRAWER MENU ---------- */
.menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay--open { opacity: 1; pointer-events: auto; }

.menu-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    z-index: 9999;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.5);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), var(--transition-theme);
}

.menu-drawer--open { transform: translateX(0); }

.menu-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.menu-drawer__brand {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-primary);
}

.menu-drawer__brand span { color: #f59e0b; }

.menu-drawer__close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.menu-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.menu-drawer__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface-raised);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: all 0.2s ease;
}

.menu-drawer__link:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.nav-link--crown, .menu-drawer__link.nav-link--crown {
    color: var(--gold) !important;
}

.menu-drawer__footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
}

.menu-drawer__copy { font-size: 0.75rem; color: var(--text-muted); text-align: center; }

/* ---------- INFO MODAL ---------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay--open { opacity: 1; pointer-events: auto; }

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    padding: 24px;
    transform: scale(0.94);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), var(--transition-theme);
}

.modal-overlay--open .modal-card { transform: scale(1); }

.modal-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.modal-card__title { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.modal-card__close { background: transparent; border: none; color: var(--text-secondary); font-size: 1.3rem; cursor: pointer; }

.modal-card__content { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.65; }
.modal-card__content h4 { color: var(--text-primary); margin: 16px 0 6px; font-size: 1rem; font-weight: 700; }
.modal-card__content h4:first-child { margin-top: 0; }

/* ---------- RESPONSIVE BREAKPOINTS ---------- */
@media (max-width: 768px) {
    .header__nav .nav-link {
        display: none; /* hide text links on mobile, show hamburger */
    }
    .menu-toggle-btn {
        display: flex; /* show hamburger on mobile */
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .hero-subtitle {
        font-size: 0.95rem;
    }
    .stats-pill {
        font-size: 0.78rem;
        padding: 6px 14px;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .container { padding: 0 12px 30px; }
    .header-wrapper { padding: 12px 0 10px; margin-bottom: 16px; }
    .header__logo { font-size: 1.3rem; }
    
    .leaderboard__header {
        grid-template-columns: 38px 1fr 80px 70px;
        padding: 10px 12px;
        font-size: 0.65rem;
    }

    .leaderboard__row {
        grid-template-columns: 38px 1fr 80px 70px;
        padding: 12px 12px;
    }

    .team-logo { width: 30px; height: 30px; }
    .team-name { font-size: 0.9rem; }
    .points { font-size: 0.98rem; }
    .points-label { display: none; }
    .vote-btn { padding: 5px 8px; font-size: 0.75rem; }

    .section-card-header { padding: 14px 14px; }
    .section-card-title { font-size: 1.1rem; }
}

@media (max-width: 380px) {
    .leaderboard__header { grid-template-columns: 30px 1fr 64px 60px; }
    .leaderboard__row { grid-template-columns: 30px 1fr 64px 60px; }
    .team-logo { width: 24px; height: 24px; }
    .team-name { font-size: 0.82rem; }
    .points { font-size: 0.88rem; }
    .vote-btn { padding: 4px 6px; font-size: 0.7rem; }
}

/* ---------- ROW ANIMATION ---------- */
.leaderboard__row--moving-up { animation: row-up 0.5s ease; }
.leaderboard__row--moving-down { animation: row-down 0.5s ease; }

@keyframes row-up {
    0% { transform: translateY(20px); background: rgba(34, 197, 94, 0.12); }
    100% { transform: translateY(0); }
}

@keyframes row-down {
    0% { transform: translateY(-20px); background: rgba(239, 68, 68, 0.12); }
    100% { transform: translateY(0); }
}
