/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0A0E1A;
    --bg-card: #111827;
    --bg-card-hover: #1a2236;
    --bg-surface: #0f1629;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --accent: #E11D48;
    --accent-light: #FB7185;
    --gold: #F59E0B;
    --gold-light: #FCD34D;
    --green: #10B981;
    --blue: #3B82F6;
    --purple: #8B5CF6;
    --border: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --font: 'Outfit', sans-serif;
    --font-display: 'Bebas Neue', sans-serif;
    --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; }

/* ── Navigation ── */
.main-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; gap: 24px;
    padding: 0 20px; height: 64px;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    color: var(--text); font-family: var(--font-display);
    font-size: 24px; letter-spacing: 2px;
}
.logo-icon { font-size: 28px; }
.logo-year { color: var(--gold); }
.nav-links {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto;
}
.nav-link {
    color: var(--text-muted); padding: 8px 14px;
    border-radius: var(--radius-sm); font-weight: 500;
    font-size: 14px; transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--text); background: rgba(255,255,255,0.06);
}
.nav-admin { color: var(--gold) !important; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.stat-badge {
    background: var(--accent); color: white;
    padding: 4px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.nav-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: white; border: none; cursor: pointer;
    font-weight: 700; font-size: 14px; font-family: var(--font);
    transition: transform var(--transition);
}
.nav-avatar:hover { transform: scale(1.1); }
.dropdown-menu {
    position: absolute; right: 20px; top: 60px;
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 8px;
    min-width: 180px; display: none;
    box-shadow: var(--shadow);
}
.dropdown-menu.show { display: block; }
.dropdown-header { padding: 8px 12px; font-weight: 600; color: var(--text-muted); font-size: 13px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-menu a { display: block; padding: 8px 12px; color: var(--text); border-radius: var(--radius-sm); font-size: 14px; }
.dropdown-menu a:hover { background: rgba(255,255,255,0.06); }
.nav-mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ── Layout ── */
.main-content { max-width: 1200px; margin: 0 auto; padding: 24px 20px; min-height: calc(100vh - 180px); }
.main-footer { text-align: center; padding: 24px; color: var(--text-dim); font-size: 13px; border-top: 1px solid var(--border); }

/* ── Cards ── */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-family: var(--font-display); font-size: 28px; letter-spacing: 1px; }

/* ── Sticker Card (Panini style) ── */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.sticker {
    position: relative; aspect-ratio: 3/4;
    border-radius: var(--radius); overflow: hidden;
    cursor: pointer; transition: all 0.3s ease;
}
.sticker:hover { transform: translateY(-4px) scale(1.03); }
.sticker.collected {
    border: 2px solid var(--green);
}
.sticker.missing {
    border: 2px dashed var(--border-light);
    opacity: 0.4;
}
.sticker.missing .sticker-photo { filter: grayscale(1) brightness(0.3); }
.sticker-photo {
    width: 100%; height: 100%;
    object-fit: cover; background: var(--bg-surface);
}
.sticker-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 8px 10px 10px;
}
.sticker-name { font-size: 11px; font-weight: 600; color: white; line-height: 1.2; }
.sticker-number {
    position: absolute; top: 6px; left: 6px;
    background: rgba(0,0,0,0.6); color: var(--gold);
    font-size: 10px; font-weight: 700; padding: 2px 6px;
    border-radius: 4px;
}
.sticker-rarity {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
}
.sticker-rarity.common { background: #94A3B8; }
.sticker-rarity.uncommon { background: #3B82F6; }
.sticker-rarity.rare { background: #8B5CF6; }
.sticker-rarity.legendary { background: #F59E0B; box-shadow: 0 0 8px rgba(245,158,11,0.6); }
.sticker-duplicate {
    position: absolute; top: 6px; right: 6px;
    background: var(--accent); color: white;
    font-size: 10px; font-weight: 700; padding: 1px 5px;
    border-radius: 4px;
}

/* ── Team Section ── */
.team-section { margin-bottom: 32px; }
.team-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.team-flag { width: 32px; height: 22px; border-radius: 3px; object-fit: cover; }
.team-name { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; }
.team-progress {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-muted);
}
.team-progress-bar {
    width: 80px; height: 6px; background: var(--border);
    border-radius: 3px; overflow: hidden;
}
.team-progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.4s ease; }

/* ── Group Header ── */
.group-header {
    font-family: var(--font-display); font-size: 32px;
    color: var(--gold); letter-spacing: 2px;
    margin: 40px 0 20px; padding-bottom: 12px;
    border-bottom: 2px solid var(--gold);
    display: flex; align-items: center; gap: 12px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #BE1240; color: white; transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); color: white; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #D97706); color: #1a1a1a; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(245,158,11,0.3); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font); font-size: 14px;
    transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Alerts ── */
.alert {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1200px; margin: 12px auto; padding: 12px 20px;
    border-radius: var(--radius-sm); font-size: 14px;
}
.alert-success { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.alert-error { background: rgba(225,29,72,0.15); color: var(--accent-light); border: 1px solid rgba(225,29,72,0.3); }
.alert-info { background: rgba(59,130,246,0.15); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
.alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; }

/* ── Dashboard Grid ── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-stat {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    text-align: center;
}
.dash-stat-value { font-family: var(--font-display); font-size: 42px; color: var(--gold); }
.dash-stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Progress Ring ── */
.progress-ring {
    width: 120px; height: 120px; margin: 0 auto 12px;
    position: relative;
}
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; }
.progress-ring .bg { stroke: var(--border); }
.progress-ring .fill { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.progress-ring .value {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 28px; color: var(--text);
}

/* ── Card Pack Animation ── */
.pack-container {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 0;
}
.pack {
    width: 200px; height: 280px;
    background: linear-gradient(135deg, var(--accent), #7C1D3E);
    border-radius: var(--radius-lg); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px rgba(225,29,72,0.3);
    transition: all 0.3s ease; position: relative;
    overflow: hidden;
}
.pack::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: packShine 3s infinite;
}
@keyframes packShine { 0%,100% { transform: translateX(-200%); } 50% { transform: translateX(200%); } }
.pack:hover { transform: translateY(-8px) scale(1.03); box-shadow: 0 12px 40px rgba(225,29,72,0.4); }
.pack-label { font-family: var(--font-display); font-size: 28px; color: white; letter-spacing: 3px; z-index: 1; }
.pack-count { color: rgba(255,255,255,0.7); font-size: 14px; z-index: 1; margin-top: 8px; }

/* ── Reveal Cards ── */
.reveal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px; margin-top: 24px;
}
.reveal-card {
    aspect-ratio: 3/4; border-radius: var(--radius);
    perspective: 800px; cursor: pointer;
}
.reveal-card-inner {
    width: 100%; height: 100%;
    position: relative; transition: transform 0.6s;
    transform-style: preserve-3d;
}
.reveal-card.flipped .reveal-card-inner { transform: rotateY(180deg); }
.reveal-card-front, .reveal-card-back {
    position: absolute; inset: 0; border-radius: var(--radius);
    backface-visibility: hidden; overflow: hidden;
}
.reveal-card-front {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; border: 2px solid var(--border-light);
}
.reveal-card-back {
    transform: rotateY(180deg); border: 2px solid var(--green);
}
.reveal-card-back img { width: 100%; height: 100%; object-fit: cover; }
.reveal-card-back .sticker-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.85)); padding: 8px; }

/* ── Game Cards ── */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.game-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    text-align: center; transition: all var(--transition);
    cursor: pointer; position: relative; overflow: hidden;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.game-card.played { opacity: 0.5; pointer-events: none; }
.game-card.played::after {
    content: '✓ Bugün oynandı'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6); color: var(--green);
    font-weight: 600; font-size: 16px; border-radius: var(--radius-lg);
}
.game-icon { font-size: 48px; margin-bottom: 12px; }
.game-name { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; }
.game-desc { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.game-reward { color: var(--gold); font-size: 13px; font-weight: 600; margin-top: 12px; }

/* ── Leaderboard ── */
.lb-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
.lb-table th { text-align: left; padding: 8px 12px; color: var(--text-dim); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.lb-table td { padding: 12px; background: var(--bg-card); }
.lb-table tr td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.lb-table tr td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.lb-rank { font-family: var(--font-display); font-size: 22px; color: var(--text-muted); width: 50px; text-align: center; }
.lb-rank.gold { color: var(--gold); }
.lb-rank.silver { color: #CBD5E1; }
.lb-rank.bronze { color: #CD7F32; }
.lb-user { display: flex; align-items: center; gap: 10px; }
.lb-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.lb-bar { width: 100px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.lb-bar-fill { height: 100%; background: var(--green); border-radius: 3px; }

/* ── Trades ── */
.trade-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.trade-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.trade-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.trade-status.open { background: rgba(59,130,246,0.2); color: var(--blue); }
.trade-status.accepted { background: rgba(16,185,129,0.2); color: var(--green); }
.trade-status.rejected { background: rgba(225,29,72,0.2); color: var(--accent-light); }
.trade-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.trade-mini-card { width: 50px; height: 66px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.trade-mini-card img { width: 100%; height: 100%; object-fit: cover; }

/* ── Achievement Badges ── */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.badge {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; text-align: center;
    transition: all var(--transition);
}
.badge.earned { border-color: var(--gold); }
.badge.locked { opacity: 0.4; }
.badge-icon { font-size: 32px; margin-bottom: 8px; }
.badge-name { font-weight: 600; font-size: 13px; }
.badge-desc { color: var(--text-dim); font-size: 11px; margin-top: 4px; }

/* ── Auth Pages ── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 180px); }
.auth-card { width: 100%; max-width: 400px; }
.auth-title { font-family: var(--font-display); font-size: 36px; text-align: center; margin-bottom: 24px; letter-spacing: 2px; }

/* ── Admin ── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; min-height: calc(100vh - 180px); }
.admin-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; height: fit-content; position: sticky; top: 80px; }
.admin-sidebar a {
    display: block; padding: 10px 14px; color: var(--text-muted);
    border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 2px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.admin-content { min-width: 0; }

/* ── Tables (Admin) ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); padding: 12px; flex-direction: column; border-bottom: 1px solid var(--border); }
    .nav-links.show { display: flex; }
    .nav-mobile-toggle { display: block; margin-left: auto; }
    .nav-user { margin-left: 0; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
    .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .group-header { font-size: 24px; }
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
