/* ═══════════════════════════════════════════════════════════════════════
   Agent TCG — Immersive TCG Design System v3
   Holographic effects · Rarity glows · Energy colors · Card aesthetics
   ═══════════════════════════════════════════════════════════════════════ */

/* === @PROPERTY for animated gradients === */
@property --holo-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}
@property --shimmer-pos {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}
@property --glow-hue {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/* === DESIGN TOKENS === */
:root {
    /* Brand — inspired by Pokemon card gold borders */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* Surfaces — dark playmat feel */
    --bg: #080c18;
    --bg-card: rgba(16, 22, 40, 0.88);
    --bg-card-solid: #10162a;
    --bg-input: rgba(12, 16, 30, 0.92);
    --bg-elevated: rgba(24, 32, 56, 0.7);

    /* Text */
    --text: #e4e9f2;
    --text-muted: #6b7a94;
    --text-bright: #f4f7fc;

    /* Accent — Pikachu lightning energy yellow + water energy blue */
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.18);
    --accent-warm: #f8d030;

    /* Semantic */
    --success: #34d399;
    --success-glow: rgba(52, 211, 153, 0.12);
    --danger: #f87171;
    --danger-glow: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;
    --warning-glow: rgba(251, 191, 36, 0.12);

    /* Pokemon Energy Type Colors */
    --energy-fire: #F08030;
    --energy-water: #6890F0;
    --energy-grass: #78C850;
    --energy-lightning: #F8D030;
    --energy-psychic: #F85888;
    --energy-fighting: #C03028;
    --energy-dark: #705848;
    --energy-metal: #B8B8D0;
    --energy-fairy: #EE99AC;
    --energy-dragon: #7038F8;
    --energy-colorless: #A8A878;

    /* Rarity Glow System */
    --rarity-common: #6b7280;
    --rarity-uncommon: #22c55e;
    --rarity-rare: #3b82f6;
    --rarity-holo: #60a5fa;
    --rarity-ultra: #f59e0b;
    --rarity-secret: #f472b6;
    --rarity-mythic: #ea580c;

    /* PSA Grading */
    --psa-red: #e52327;
    --psa-gold: #cfb53b;
    --bgs-black: #1a1a1a;
    --bgs-gold: #d4a928;

    /* Pokeball red */
    --pokeball-red: #ee1515;

    /* Borders */
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(99, 102, 241, 0.25);
    --border-gold: rgba(207, 181, 59, 0.3);

    /* Radius */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px var(--primary-glow);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.25s;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Dark playmat background with subtle TCG energy pattern */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse 70% 50% at 15% 15%, rgba(112, 56, 248, 0.06), transparent),
        radial-gradient(ellipse 50% 40% at 85% 20%, rgba(248, 208, 48, 0.04), transparent),
        radial-gradient(ellipse 60% 50% at 50% 80%, rgba(104, 144, 240, 0.05), transparent),
        radial-gradient(ellipse 40% 30% at 70% 60%, rgba(248, 88, 136, 0.03), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Pokeball watermark in background */
body::after {
    content: '';
    position: fixed;
    bottom: -15vh;
    right: -10vw;
    width: 50vh;
    height: 50vh;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 8%, transparent 8.5%),
        linear-gradient(to bottom, rgba(238, 21, 21, 0.025) 48%, rgba(255,255,255,0.015) 48%, rgba(255,255,255,0.015) 52%, rgba(238, 21, 21, 0.01) 52%);
    border: 2px solid rgba(255, 255, 255, 0.02);
    pointer-events: none;
    z-index: 0;
}

#app, .topbar, .footer, .toast-container { position: relative; z-index: 1; }

/* === TOPBAR === */
.topbar {
    position: sticky;
    top: 0;
    background: rgba(8, 12, 24, 0.82);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
/* Holographic line under nav */
.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--energy-psychic) 15%,
        var(--energy-water) 30%,
        var(--energy-lightning) 50%,
        var(--energy-grass) 70%,
        var(--energy-fire) 85%,
        transparent 100%);
    opacity: 0.3;
}
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 2rem;
    max-width: 1320px;
    margin: 0 auto;
}

/* Logo with Pokeball accent */
.logo {
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}
.logo::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, white 3px, rgba(255,255,255,0.5) 3.5px, transparent 4px),
        linear-gradient(to bottom, var(--pokeball-red) 48%, white 48%, white 52%, #ccc 52%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}
.logo {
    background: linear-gradient(135deg, var(--accent-warm), var(--energy-fire), var(--pokeball-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; gap: 0.2rem; align-items: center; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    position: relative;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-links a.active {
    color: var(--accent-warm);
    background: rgba(248, 208, 48, 0.08);
}
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: linear-gradient(135deg, var(--pokeball-red), #c51010);
    color: white;
    box-shadow: 0 2px 16px rgba(238, 21, 21, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(238, 21, 21, 0.35);
}
/* Subtle shine on primary buttons */
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    animation: btnShine 4s ease-in-out infinite;
}
@keyframes btnShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-hover);
    color: var(--text);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; }
.btn-outline {
    border: 1px solid var(--border-hover);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    background: transparent;
}
.btn-outline:hover { border-color: var(--accent-warm); color: var(--accent-warm); }

/* === FORMS === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.form-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: all var(--duration) var(--ease);
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 3px rgba(248, 208, 48, 0.15);
}
.form-input::placeholder { color: var(--text-muted); opacity: 0.5; }
select.form-input { appearance: auto; }

/* === CARDS — Glass + TCG card aesthetic === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.35s var(--ease);
    position: relative;
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}
.card h3 { color: var(--accent); margin-bottom: 0.5rem; font-size: 0.92rem; font-weight: 600; }
.card p { color: var(--text-muted); font-size: 0.88rem; }

/* === PAGE LAYOUT === */
.page { max-width: 1320px; margin: 0 auto; padding: 2rem; min-height: 60vh; }
.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.03em; }
.page-subtitle { color: var(--text-muted); margin-bottom: 2rem; }

/* === GRID === */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Card browse items */
.card-browse { padding: 0.75rem 1rem; transition: border-color 0.2s; }
.card-browse:hover { border-color: var(--accent, #e94560); }
.card-browse-header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.card-browse-header h3 { margin: 0 0 0.3rem; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════
   HERO — Immersive TCG entrance
   ═══════════════════════════════════════ */
.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
/* Holographic orb behind hero */
.hero::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background:
        radial-gradient(circle at 30% 30%, rgba(248, 208, 48, 0.1), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(104, 144, 240, 0.08), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(238, 21, 21, 0.06), transparent 60%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    animation: heroOrb 12s ease-in-out infinite alternate;
}
@keyframes heroOrb {
    0% { transform: translateX(-50%) scale(1) rotate(0deg); }
    100% { transform: translateX(-50%) scale(1.15) rotate(5deg); }
}
/* Floating energy particles */
.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, var(--energy-lightning) 50%, transparent 51%),
        radial-gradient(1px 1px at 60% 20%, var(--energy-water) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 80% 50%, var(--energy-fire) 50%, transparent 51%),
        radial-gradient(1px 1px at 40% 70%, var(--energy-grass) 50%, transparent 51%),
        radial-gradient(1px 1px at 15% 60%, var(--energy-psychic) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 90% 75%, var(--energy-dragon) 50%, transparent 51%);
    opacity: 0.4;
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
}
@keyframes particleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-30px); }
}

.hero h1 {
    font-size: 3.8rem;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    position: relative;
    z-index: 1;
}
/* Gradient text with TCG energy colors */
.hero h1 {
    background: linear-gradient(135deg,
        var(--text-bright) 0%,
        var(--text) 30%,
        var(--accent-warm) 60%,
        var(--energy-fire) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 540px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}
.cta-group { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; position: relative; z-index: 1; }
.cta-group .btn-primary { padding: 0.85rem 2.2rem; font-size: 0.95rem; }

/* ═══════════════════════════════════════
   FEATURE CARDS — with energy-type top borders
   ═══════════════════════════════════════ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    backdrop-filter: blur(12px);
    transition: all 0.4s var(--ease);
    position: relative;
    overflow: hidden;
}
/* Each feature card gets a unique energy-color top bar */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.feature-card:nth-child(1)::before { background: var(--energy-lightning); }
.feature-card:nth-child(2)::before { background: var(--energy-water); }
.feature-card:nth-child(3)::before { background: var(--energy-fire); }
.feature-card:nth-child(4)::before { background: var(--energy-psychic); }
.feature-card:nth-child(5)::before { background: var(--energy-grass); }
.feature-card:nth-child(6)::before { background: var(--energy-dragon); }

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}
.feature-card:hover::before { opacity: 1; }

/* Subtle holo shimmer on feature card hover */
.feature-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.6s var(--ease);
    pointer-events: none;
}
.feature-card:hover::after { left: 100%; }

.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.feature-card h3 { margin-bottom: 0.5rem; color: var(--text-bright); font-size: 1rem; font-weight: 600; }
.feature-card p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.65; }

/* Staggered entrance */
.feature-card { animation: cardEntrance 0.5s var(--ease) both; }
.feature-card:nth-child(1) { animation-delay: 0s; }
.feature-card:nth-child(2) { animation-delay: 0.07s; }
.feature-card:nth-child(3) { animation-delay: 0.14s; }
.feature-card:nth-child(4) { animation-delay: 0.21s; }
.feature-card:nth-child(5) { animation-delay: 0.28s; }
.feature-card:nth-child(6) { animation-delay: 0.35s; }
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════
   PRICING CARDS — with rarity glow
   ═══════════════════════════════════════ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.4s var(--ease);
    position: relative;
    overflow: hidden;
}
/* Common tier */
.pricing-card:nth-child(1) { border-color: rgba(107, 114, 128, 0.2); }
/* Uncommon tier */
.pricing-card:nth-child(2) { border-color: rgba(34, 197, 94, 0.15); }
/* Rare tier — popular */
.pricing-card.popular {
    border-color: rgba(248, 208, 48, 0.35);
    box-shadow: 0 0 30px rgba(248, 208, 48, 0.1), inset 0 0 30px rgba(248, 208, 48, 0.02);
}
.pricing-card.popular::before {
    content: 'Populaire';
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-warm), var(--energy-fire));
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.2rem 1rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
/* Ultra tier */
.pricing-card:nth-child(4) { border-color: rgba(112, 56, 248, 0.2); }

.pricing-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.pricing-card h3 { color: var(--text-bright); margin-bottom: 0.5rem; font-size: 1.1rem; }
.pricing-card .price {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 1rem 0;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.pricing-card .price span { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.pricing-card ul { list-style: none; margin: 1.5rem 0; text-align: left; }
.pricing-card li { padding: 0.45rem 0; color: var(--text-muted); font-size: 0.85rem; }
.pricing-card li::before { content: "\2713  "; color: var(--success); font-weight: 700; }

/* === SEARCH BAR === */
.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.search-bar .form-input { flex: 1; }

/* === TABLE === */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
td { color: var(--text); font-variant-numeric: tabular-nums; }
tr { transition: background var(--duration) var(--ease); }
tr:hover td { background: rgba(248, 208, 48, 0.02); }

/* === STATS ROW === */
.stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    flex: 1;
    min-width: 150px;
    transition: all var(--duration) var(--ease);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* === BADGE with rarity variants === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success { background: var(--success-glow); color: var(--success); }
.badge-warning { background: var(--warning-glow); color: var(--warning); }
.badge-danger { background: var(--danger-glow); color: var(--danger); }
.badge-info { background: var(--accent-glow); color: var(--accent); }

/* Rarity badges */
.badge-common { background: rgba(107, 114, 128, 0.12); color: var(--rarity-common); }
.badge-uncommon { background: rgba(34, 197, 94, 0.12); color: var(--rarity-uncommon); }
.badge-rare { background: rgba(59, 130, 246, 0.12); color: var(--rarity-rare); }
.badge-ultra { background: rgba(245, 158, 11, 0.12); color: var(--rarity-ultra); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-secret {
    background: linear-gradient(135deg, rgba(248, 88, 136, 0.1), rgba(112, 56, 248, 0.1));
    color: var(--rarity-secret);
    border: 1px solid rgba(244, 114, 182, 0.2);
}

/* PSA grade badge */
.badge-psa {
    background: linear-gradient(135deg, var(--psa-red), #c51010);
    color: white;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
}

/* === UPLOAD ZONE === */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s var(--ease);
    background: rgba(255, 255, 255, 0.01);
    position: relative;
}
.upload-zone:hover {
    border-color: var(--accent-warm);
    background: rgba(248, 208, 48, 0.02);
}
.upload-zone.dragover {
    border-color: var(--accent-warm);
    background: rgba(248, 208, 48, 0.05);
    box-shadow: inset 0 0 40px rgba(248, 208, 48, 0.08);
}
.upload-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.7; }

/* === AUTH === */
.auth-page { max-width: 420px; margin: 4rem auto; padding: 2rem; }
.auth-page .card { padding: 2rem; box-shadow: var(--shadow-lg); border-color: var(--border-hover); }
.auth-page h2 { text-align: center; margin-bottom: 1.5rem; font-weight: 700; }

/* === TOAST === */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    animation: toastSlide 0.4s var(--ease-bounce);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-md);
}
.toast-success { background: rgba(52, 211, 153, 0.92); }
.toast-error { background: rgba(248, 113, 113, 0.92); }
.toast-info { background: rgba(99, 102, 241, 0.92); }
@keyframes toastSlide { from { opacity: 0; transform: translateX(30px) scale(0.9); } to { opacity: 1; transform: none; } }

/* === LOADER with energy colors === */
.loader {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent-warm);
    border-right-color: var(--energy-fire);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 3rem; }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }

/* ═══════════════════════════════════════
   SCAN — Card analysis UI
   ═══════════════════════════════════════ */
.scan-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.scan-upload-col { display: flex; flex-direction: column; gap: 1rem; }
.scan-result-col { display: flex; flex-direction: column; gap: 0.5rem; }

.scan-preview { text-align: center; }
.scan-preview-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    object-fit: contain;
    box-shadow: var(--shadow-md);
    transition: all 0.4s var(--ease);
}
/* Card tilt effect on preview hover */
.scan-preview-img:hover {
    box-shadow: 0 12px 40px rgba(248, 208, 48, 0.15), var(--shadow-md);
}
.scan-preview-name { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; }

/* Progress steps with energy indicators */
.progress-steps { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.progress-step {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.25rem;
    text-align: center;
    opacity: 0.3;
    transition: all 0.5s var(--ease);
    position: relative;
    overflow: hidden;
}
.progress-step::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: transparent;
    transition: all 0.5s var(--ease);
}
.progress-step.active {
    opacity: 1;
    border-color: var(--accent-warm);
    background: rgba(248, 208, 48, 0.04);
}
.progress-step.active::after { background: var(--accent-warm); }
.progress-step.done {
    opacity: 1;
    border-color: var(--success);
    background: rgba(52, 211, 153, 0.04);
}
.progress-step.done::after { background: var(--success); }
.step-icon { display: block; font-size: 1rem; margin-bottom: 0.1rem; }
.step-label { font-size: 0.62rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.progress-step.active .step-label { color: var(--accent-warm); }
.progress-step.done .step-label { color: var(--success); }
.loader-sm { width: 0.8rem; height: 0.8rem; border-width: 1.5px; margin: 0.15rem auto 0; }

/* Scan report */
.scan-report { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; }
.scan-report-image { text-align: center; }
.scan-report-image img { max-width: 100%; max-height: 280px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: contain; }
.scan-report-image .scan-preview-name { font-size: 0.7rem; }
.scan-report-data { display: flex; flex-direction: column; gap: 0.5rem; }

/* Scan result */
.scan-result { margin-top: 0; }
.scan-result .card { margin-bottom: 0.5rem; padding: 0.75rem 1rem; }
.scan-result .card h3 { font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--accent); }
.scan-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 0.75rem; }
.scan-card-grid div { font-size: 0.78rem; line-height: 1.4; }

/* Pricing compact */
.scan-price-row { display: flex; align-items: baseline; gap: 0.75rem; }
.scan-price-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent-warm), var(--energy-fire));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.scan-price-range { font-size: 0.72rem; color: var(--text-muted); }

/* Marketplace table */
.scan-result table { font-size: 0.78rem; width: 100%; }
.scan-result table th { font-size: 0.68rem; text-transform: uppercase; color: var(--text-muted); padding: 0.35rem 0.5rem; letter-spacing: 0.05em; }
.scan-result table td { padding: 0.35rem 0.5rem; }
.text-profit { color: var(--success); font-weight: 600; }
.text-loss { color: var(--danger); font-weight: 600; }
.text-muted { color: var(--text-muted); }
.best-row td {
    background: rgba(52, 211, 153, 0.05);
    border-bottom-color: rgba(52, 211, 153, 0.1);
}

/* Strategy badge */
.scan-strategy-inline { display: flex; align-items: center; gap: 0.75rem; }
.scan-strategy-inline .badge { font-size: 0.85rem; padding: 0.2rem 0.6rem; }
.scan-strategy-inline .text-muted { font-size: 0.78rem; }

/* Warnings */
.low-conf-warning {
    grid-column: 1 / -1;
    color: var(--warning);
    font-size: 0.72rem;
    padding: 0.4rem 0.6rem;
    background: var(--warning-glow);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--radius-sm);
    margin-top: 0.15rem;
}

/* Scan actions */
.scan-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.scan-actions .btn { font-size: 0.78rem; padding: 0.4rem 0.8rem; }
.scan-history { margin-top: 1.5rem; }

/* ═══════════════════════════════════════
   LISTING PREVIEW — MarketplaceAgent output
   ═══════════════════════════════════════ */
.listing-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}
/* Holo shimmer on listing preview */
.listing-preview::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(248, 208, 48, 0.02),
        rgba(104, 144, 240, 0.02),
        transparent);
    animation: listingShimmer 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes listingShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.listing-preview h4 {
    font-size: 0.78rem;
    color: var(--accent-warm);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.listing-variant-tabs { display: flex; gap: 0.3rem; margin-bottom: 0.5rem; }
.listing-variant-tab {
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.listing-variant-tab.active {
    background: rgba(248, 208, 48, 0.1);
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}
.listing-variant-tab:hover:not(.active) {
    border-color: var(--border-hover);
    color: var(--text);
}
.listing-title-preview {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-bright);
    padding: 0.5rem 0.6rem;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    margin-bottom: 0.3rem;
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
}
.listing-title-chars {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.listing-desc-toggle {
    font-size: 0.7rem;
    color: var(--accent-warm);
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
    font-weight: 600;
    padding: 0.25rem 0;
}
.listing-desc-toggle:hover { text-decoration: underline; }
.listing-desc-preview {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.65;
    padding: 0.6rem;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.3rem;
}
.listing-keywords { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-top: 0.4rem; }
.listing-keyword {
    font-size: 0.6rem;
    padding: 0.15rem 0.45rem;
    background: rgba(248, 208, 48, 0.06);
    border: 1px solid rgba(248, 208, 48, 0.12);
    border-radius: var(--radius-full);
    color: var(--accent-warm);
    font-weight: 500;
}
.listing-mp-badges { display: flex; gap: 0.3rem; margin-top: 0.5rem; }
.listing-mp-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-xs);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.listing-mp-badge.ebay { border-color: rgba(229, 35, 39, 0.25); color: #e95353; }
.listing-mp-badge.vinted { border-color: rgba(9, 137, 133, 0.25); color: #2ec4b6; }
.listing-mp-badge.cardmarket { border-color: rgba(0, 122, 255, 0.25); color: #5ba3f5; }

/* === CARD DETAIL === */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
.detail-grid div { display: flex; flex-direction: column; }
.detail-grid strong { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.15rem; letter-spacing: 0.04em; font-weight: 600; }
.detail-grid span { font-size: 0.92rem; }
.card-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* === FAQ === */
.faq details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; padding: 1.25rem; transition: border-color var(--duration) var(--ease); }
.faq details:hover { border-color: var(--border-hover); }
.faq details[open] { border-color: var(--border-accent); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 0.75rem; color: var(--text-muted); }

/* ═══════════════════════════════════════
   DASHBOARD — Collector HQ
   ═══════════════════════════════════════ */
.dash-welcome { font-size: 1.05rem; margin-bottom: 1.25rem; color: var(--text-muted); }
.dash-welcome strong { color: var(--text-bright); }
.dash-hero-stats .stat-card { animation: dashFadeIn 0.5s var(--ease) both; }
.dash-hero-stats .stat-card:nth-child(2) { animation-delay: 0.05s; }
.dash-hero-stats .stat-card:nth-child(3) { animation-delay: 0.1s; }
.dash-hero-stats .stat-card:nth-child(4) { animation-delay: 0.15s; }
.dash-hero-stats .stat-card:nth-child(5) { animation-delay: 0.2s; }
.dash-hero-stats .stat-highlight {
    border-color: rgba(248, 208, 48, 0.25);
    box-shadow: 0 0 25px rgba(248, 208, 48, 0.08);
}
.dash-hero-stats .stat-highlight .stat-value {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--accent-warm), var(--energy-fire));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@keyframes dashFadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.dash-health-card { overflow: hidden; }
.dash-health-row { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.dash-gauge { text-align: center; }
.dash-gauge-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.dash-health-details { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.5rem; }
.dash-alert { font-size: 0.8rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); }
.dash-alert-warning { background: var(--warning-glow); color: var(--warning); border-left: 3px solid var(--warning); }
.dash-alert-ok { background: var(--success-glow); color: var(--success); border-left: 3px solid var(--success); }
.dash-alert-info { background: var(--accent-glow); color: var(--accent); border-left: 3px solid var(--accent); }
.dash-market-trend { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; }
.dash-market-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.dash-market-stats div { text-align: center; padding: 0.6rem; background: rgba(8, 12, 24, 0.6); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.dash-market-stats strong { display: block; font-size: 1rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.dash-market-stats span { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dash-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-movers-col h4 { margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
.dash-mover-item { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.dash-timing { padding: 0.75rem; background: rgba(8, 12, 24, 0.6); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.dash-timing-factor { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.dash-timing-label { font-size: 0.85rem; color: var(--text-muted); }
.dash-timing-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-timing-advice { font-size: 0.85rem; color: var(--text); font-style: italic; }
.dash-signal-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.dash-pipeline { margin-top: 0.5rem; }
.dash-agents-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dash-agent-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(8, 12, 24, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    transition: all var(--duration) var(--ease);
}
.dash-agent-chip:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.dash-progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.dash-progress-bar { height: 100%; border-radius: 3px; transition: width 1s var(--ease); }

/* === SKELETON === */
.skel {
    display: block;
    background: linear-gradient(90deg, var(--bg-card-solid) 25%, rgba(248, 208, 48, 0.04) 50%, var(--bg-card-solid) 75%);
    background-size: 200% 100%;
    animation: skelShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skel-text { height: 1.8rem; }
.skel-big { height: 2.5rem; width: 80%; margin-bottom: 0.5rem; }
.skel-label { height: 0.8rem; width: 60%; }
.skel-block { height: 10rem; }
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    font-size: 0.82rem;
}

/* === SCROLLBAR (themed) === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(248, 208, 48, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(248, 208, 48, 0.3); }

/* === SELECTION === */
::selection { background: rgba(248, 208, 48, 0.2); color: var(--text-bright); }

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === MOBILE === */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero .subtitle { font-size: 0.95rem; }
    .nav { padding: 0.6rem 1rem; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: rgba(8, 12, 24, 0.98);
        backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
        gap: 0.15rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.7rem 1rem; border-radius: var(--radius-sm); }
    .nav-toggle { display: block; }
    .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
    .search-bar { flex-direction: column; }
    .stats-row { flex-direction: column; }
    .page { padding: 1rem; }
    .scan-layout { grid-template-columns: 1fr; }
    .scan-report { grid-template-columns: 1fr; }
    .progress-steps { flex-wrap: wrap; }
    .scan-card-grid { grid-template-columns: 1fr; }
    .dash-health-row { flex-direction: column; align-items: center; }
    .dash-movers { grid-template-columns: 1fr; }
    .dash-market-stats { grid-template-columns: 1fr; }
    .listing-variant-tabs { flex-wrap: wrap; }
    body::after { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.4rem; }
    .hero p { font-size: 0.9rem; }
}

/* === Small phones === */
@media (max-width: 480px) {
    .page { padding: 0.75rem; }
    .page-title { font-size: 1.1rem; }
    table { font-size: 0.75rem; }
    .btn { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
    .scan-actions { flex-direction: column; gap: 0.5rem; }
    .scan-actions .btn { width: 100%; }
}

/* === Tablet === */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
}

/* === Skip link === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-size: 0.85rem;
}
.skip-link:focus {
    top: 0.5rem;
}

/* === Focus visible === */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Grid helpers === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
