/* ===================================================
   European Football Player Valuation — Design System
   =================================================== */

/* ── CSS Custom Properties ──────────────────────── */
:root {
    /* Colors — Dark Theme */
    --bg-primary: #0A0E1A;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(17, 24, 39, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-sidebar: #0D1117;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(0, 245, 147, 0.3);

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-accent: #00F593;

    /* Accent Colors */
    --accent-green: #00F593;
    --accent-green-dim: rgba(0, 245, 147, 0.15);
    --accent-blue: #00B4D8;
    --accent-blue-dim: rgba(0, 180, 216, 0.15);
    --accent-gold: #FFBE0B;
    --accent-gold-dim: rgba(255, 190, 11, 0.15);
    --accent-red: #FF6B6B;
    --accent-red-dim: rgba(255, 107, 107, 0.15);
    --accent-purple: #A78BFA;
    --accent-purple-dim: rgba(167, 139, 250, 0.15);
    --accent-orange: #FB923C;

    /* Gradients */
    --grad-green: linear-gradient(135deg, #00F593, #00B4D8);
    --grad-gold: linear-gradient(135deg, #FFBE0B, #FB923C);
    --grad-blue: linear-gradient(135deg, #00B4D8, #A78BFA);
    --grad-red: linear-gradient(135deg, #FF6B6B, #FB923C);
    --grad-hero: linear-gradient(135deg, rgba(0, 245, 147, 0.08), rgba(0, 180, 216, 0.08));

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(0, 245, 147, 0.15);
    --shadow-glow-blue: 0 0 20px rgba(0, 180, 216, 0.15);

    /* Spacing */
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ── App Layout ─────────────────────────────────── */
#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    background: var(--grad-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Nav Items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-item.active {
    color: var(--accent-green);
    background: var(--accent-green-dim);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-green);
    border-radius: 0 4px 4px 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-badge, .data-freshness {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.model-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(0, 245, 147, 0.4);
}

.freshness-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.4);
}

/* ── Main Content ───────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Top Bar ────────────────────────────────────── */
.top-bar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    z-index: 50;
}

.search-container {
    position: relative;
    width: 400px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 16px 9px 42px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-green);
    box-shadow: var(--shadow-glow-green);
    background: var(--bg-secondary);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 360px;
    overflow-y: auto;
    z-index: 200;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--accent-green-dim);
}

.search-result-item .result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--grad-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.search-result-item .result-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .result-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.search-result-item .result-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.search-result-item .result-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-green);
    white-space: nowrap;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.market-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--accent-green-dim);
    color: var(--accent-green);
    font-size: 0.75rem;
    font-weight: 600;
}

.market-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
}

.market-dot.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(0, 245, 147, 0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 12px rgba(0, 245, 147, 0.6); }
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.notification-bell:hover {
    background: var(--bg-glass);
}

.notification-bell svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-red);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Page Container ─────────────────────────────── */
.page-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    scroll-behavior: smooth;
}

.page-container::-webkit-scrollbar {
    width: 6px;
}

.page-container::-webkit-scrollbar-track {
    background: transparent;
}

.page-container::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.page-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Page Transitions ───────────────────────────── */
.page-enter {
    animation: pageEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Shared Components ──────────────────────────── */

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-2px);
}

.card-static {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    backdrop-filter: blur(12px);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--grad-green));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.stat-change.positive {
    color: var(--accent-green);
    background: var(--accent-green-dim);
}

.stat-change.negative {
    color: var(--accent-red);
    background: var(--accent-red-dim);
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-green {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.badge-blue {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
}

.badge-gold {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

.badge-red {
    background: var(--accent-red-dim);
    color: var(--accent-red);
}

.badge-purple {
    background: var(--accent-purple-dim);
    color: var(--accent-purple);
}

/* Grids */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-glass);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--grad-green);
    color: var(--bg-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.75rem;
}

/* Selects */
.select-custom {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.select-custom:focus {
    border-color: var(--accent-green);
}

/* Player Card */
.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.player-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-3px);
}

.player-card .player-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--bg-primary);
    margin-bottom: 12px;
}

.player-card .player-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.player-card .player-club {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.player-card .player-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-green);
}

.player-card .player-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 4px;
}

.player-card .player-position {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Tag colors per position */
.pos-gk { background: var(--accent-gold-dim); color: var(--accent-gold); }
.pos-cb, .pos-lb, .pos-rb, .pos-def { background: var(--accent-blue-dim); color: var(--accent-blue); }
.pos-cm, .pos-cam, .pos-cdm, .pos-mid { background: var(--accent-purple-dim); color: var(--accent-purple); }
.pos-lw, .pos-rw, .pos-st, .pos-cf, .pos-fwd { background: var(--accent-red-dim); color: var(--accent-red); }

/* Confidence Bar */
.confidence-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.confidence-track {
    flex: 1;
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.confidence-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 3px;
    background: var(--grad-green);
}

.confidence-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Trend Arrows */
.trend-up { color: var(--accent-green); }
.trend-down { color: var(--accent-red); }
.trend-stable { color: var(--accent-gold); }

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 2px;
    background: var(--bg-glass);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.tab-item {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    background: var(--bg-secondary);
    color: var(--accent-green);
    box-shadow: var(--shadow-sm);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.82rem;
}

/* Filter Panel */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.filter-bar label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Page Title */
.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* Canvas container */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
}

/* ── Page-Specific: Dashboard ───────────────────── */
.dashboard-hero {
    background: var(--grad-hero);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 245, 147, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Riser/Faller rows */
.riser-row, .faller-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.riser-row:last-child, .faller-row:last-child {
    border-bottom: none;
}

.riser-rank {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
    font-weight: 700;
}

.riser-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--bg-primary);
    flex-shrink: 0;
}

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

.riser-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.riser-club {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.riser-change {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Page-Specific: Player Detail ───────────────── */
.player-hero {
    display: flex;
    gap: 32px;
    padding: 32px;
    background: var(--grad-hero);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.player-hero::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.player-hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--bg-primary);
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.15);
}

.player-hero-info {
    flex: 1;
    z-index: 1;
}

.player-hero-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.player-hero-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.player-hero-meta span {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-hero-valuation {
    z-index: 1;
    text-align: right;
    flex-shrink: 0;
}

.player-hero-val-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.player-hero-val-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--grad-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Page-Specific: Architecture ────────────────── */
.arch-layer {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition-base);
}

.arch-layer:hover {
    border-color: var(--border-active);
}

.arch-layer-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.arch-components {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.arch-component {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 140px;
    text-align: center;
}

.arch-component:hover {
    border-color: var(--accent-green);
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-2px);
}

.arch-component.expanded {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
    background: var(--accent-blue-dim);
}

.arch-component-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.arch-component-name {
    font-size: 0.78rem;
    font-weight: 700;
}

.arch-component-tech {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.arch-detail-panel {
    margin-top: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
    display: none;
}

.arch-detail-panel.visible {
    display: block;
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.arch-flow-arrow {
    display: flex;
    justify-content: center;
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 1.4rem;
    opacity: 0.4;
}

/* Tech badges */
.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* ── Page-Specific: Compare ─────────────────────── */
.compare-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 28px;
}

.compare-vs {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-muted);
}

.compare-stat-row {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.compare-stat-row:last-child { border-bottom: none; }

.compare-bar-left {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.compare-bar-right {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.compare-bar-track {
    height: 8px;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.compare-stat-label {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.compare-stat-value {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 40px;
}

.compare-winner {
    color: var(--accent-green) !important;
}

/* ── Transfer Simulator ─────────────────────────── */
.simulator-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.simulator-result {
    padding: 24px;
    background: var(--grad-hero);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-top: 20px;
    display: none;
}

.simulator-result.visible {
    display: block;
    animation: slideDown 0.3s ease forwards;
}

.sim-fee {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: var(--grad-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sim-quality {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 8px;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .grid-2, .grid-2-1 { grid-template-columns: 1fr; }
    .player-hero { flex-direction: column; }
    .player-hero-valuation { text-align: left; }
    .compare-header { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .page-container { padding: 16px; }
    .search-container { width: 200px; }
}

/* ── Loading animation ──────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-glass) 25%, rgba(255,255,255,0.06) 50%, var(--bg-glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Number counter animation ───────────────────── */
.animate-number {
    transition: all 0.5s ease;
}

/* Custom scrollbar for all scrollable areas */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
