/* PaperMogul — Dark Futuristic Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Core palette */
    --color-bg: #0a0e17;
    --color-bg-alt: #0f1520;
    --color-surface: #141b2b;
    --color-surface-hover: #1a2236;
    --color-surface-raised: #1e2740;

    /* Accent — electric cyan/teal */
    --color-primary: #00d4aa;
    --color-primary-dim: rgba(0, 212, 170, 0.15);
    --color-primary-glow: rgba(0, 212, 170, 0.3);
    --color-primary-dark: #00b894;

    /* Secondary accent — gold/amber for money vibes */
    --color-accent: #f0b232;
    --color-accent-dim: rgba(240, 178, 50, 0.12);

    /* Semantic */
    --color-success: #00e68a;
    --color-danger: #ff4d6a;
    --color-warning: #f0b232;
    --color-info: #4da6ff;

    /* Text */
    --color-text: #c9d1d9;
    --color-text-muted: #546178;
    --color-text-bright: #f0f4f8;
    --color-heading: #ffffff;

    /* Borders */
    --color-border: rgba(255, 255, 255, 0.06);
    --color-border-bright: rgba(255, 255, 255, 0.12);

    /* Effects */
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 20px rgba(0, 212, 170, 0.15);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { color: var(--color-heading); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
a { color: var(--color-primary); }
code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    background: var(--color-surface-raised);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    color: var(--color-primary);
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-admin {
    background: rgba(15, 10, 35, 0.92);
    border-bottom-color: rgba(124, 58, 237, 0.2);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-text-bright) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}
.navbar-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.2));
}
.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}
.navbar-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.navbar-links a:hover {
    color: var(--color-primary);
    background: var(--color-primary-dim);
}
.navbar-user {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.admin-link { color: #a78bfa !important; font-weight: 600; }
.admin-link:hover { background: rgba(167, 139, 250, 0.12) !important; }
.navbar-admin .navbar-links a { color: rgba(224, 231, 255, 0.5); }
.navbar-admin .navbar-links a:hover { color: #c4b5fd; background: rgba(167, 139, 250, 0.1); }

/* ─── Main Content ───────────────────────────────────────── */
.main-content { flex: 1; padding: 2rem 1.25rem; }

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    letter-spacing: 0.02em;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.5;
    letter-spacing: 0.01em;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #0a0e17;
    box-shadow: 0 2px 12px rgba(0, 212, 170, 0.25);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4); }
.btn-success {
    background: linear-gradient(135deg, #00e68a, #00cc7a);
    color: #0a0e17;
    box-shadow: 0 2px 12px rgba(0, 230, 138, 0.2);
}
.btn-danger {
    background: linear-gradient(135deg, #ff4d6a, #e6365e);
    color: #fff;
    box-shadow: 0 2px 12px rgba(255, 77, 106, 0.2);
}
.btn-warning {
    background: linear-gradient(135deg, #f0b232, #e6a020);
    color: #0a0e17;
    box-shadow: 0 2px 12px rgba(240, 178, 50, 0.2);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border-bright);
    color: var(--color-text);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-dim);
}
.btn-sm { padding: 0.3rem 0.85rem; font-size: 0.78rem; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--color-text-bright);
    background: var(--color-bg);
    transition: all var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-dim), var(--glow-primary);
    background: var(--color-bg-alt);
}
.form-control::placeholder { color: var(--color-text-muted); }
.form-control:disabled, .form-control[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
select.form-control {
    appearance: auto;
    color: var(--color-text-bright);
}
select.form-control option {
    background: var(--color-surface);
    color: var(--color-text);
}
.form-hint { font-size: 0.76rem; color: var(--color-text-muted); margin-top: 0.2rem; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    border: 1px solid transparent;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 0.25rem; }
.alert-danger { background: rgba(255, 77, 106, 0.08); border-color: rgba(255, 77, 106, 0.2); color: #ff8fa3; }
.alert-success { background: rgba(0, 230, 138, 0.08); border-color: rgba(0, 230, 138, 0.2); color: #66ffbd; }
.alert-warning { background: rgba(240, 178, 50, 0.08); border-color: rgba(240, 178, 50, 0.2); color: #ffd06a; }
.alert-info { background: rgba(77, 166, 255, 0.08); border-color: rgba(77, 166, 255, 0.2); color: #80c4ff; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color var(--transition);
}
.card:hover { border-color: var(--color-border-bright); }
.card-header {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th, td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th {
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    background: transparent;
}
tr { transition: background var(--transition); }
tr:hover { background: var(--color-surface-hover); }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-success { background: rgba(0, 230, 138, 0.12); color: #00e68a; }
.badge-warning { background: rgba(240, 178, 50, 0.12); color: #f0b232; }
.badge-danger { background: rgba(255, 77, 106, 0.12); color: #ff4d6a; }
.badge-info { background: rgba(77, 166, 255, 0.12); color: #4da6ff; }
.badge-neutral { background: rgba(255, 255, 255, 0.05); color: var(--color-text-muted); }

/* ─── Lobby Players ──────────────────────────────────────── */
.lobby-players { list-style: none; padding: 0; }
.lobby-players li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: background var(--transition);
}
.lobby-players li:last-child { border-bottom: none; }
.lobby-players li:hover { background: var(--color-surface-hover); }
.player-ready { color: var(--color-success); font-weight: 700; font-size: 0.82rem; }
.player-not-ready { color: var(--color-text-muted); font-size: 0.82rem; }

/* ─── Grid ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .navbar-logo { width: 60px; height: 60px; }
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 30px rgba(0, 212, 170, 0.2)) drop-shadow(0 0 60px rgba(240, 178, 50, 0.1));
    animation: hero-float 4s ease-in-out infinite;
}
@keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ─── Auth Forms ─────────────────────────────────────────── */
.auth-form { max-width: 420px; margin: 2rem auto; }
.auth-form .card {
    border: 1px solid var(--color-border-bright);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}
.auth-form .card-header {
    text-align: center;
    font-size: 1rem;
    color: var(--color-heading);
    text-transform: none;
    letter-spacing: -0.01em;
}

/* ─── Copy Helper ────────────────────────────────────────── */
.copy-wrap { display: flex; gap: 0.5rem; align-items: center; }
.copy-wrap input { flex: 1; }

/* ─── Custom Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-surface-raised); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ─── Selection ──────────────────────────────────────────── */
::selection { background: var(--color-primary-dim); color: var(--color-primary); }

/* ─── Spacing Utilities ──────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 0.85rem; }

/* ─── Hero Section ──────────────────────────────────────── */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem;
}

/* ─── Stat Values (admin dashboard, pricing) ────────────── */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

/* ─── Code Block (dark theme pre) ───────────────────────── */
.code-block {
    background: var(--color-bg);
    color: var(--color-primary);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    border: 1px solid var(--color-border);
}
