/* ============================================================
   JinnChat — Main Stylesheet
   Dark Ghost Theme | Glassmorphism | Neon Glow
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg: #06060f;
    --bg2: #0d0d1a;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-h: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-h: rgba(168, 85, 247, 0.4);

    --purple: #a855f7;
    --purple-d: #7c3aed;
    --purple-g: linear-gradient(135deg, #a855f7, #ec4899);
    --pink: #ec4899;
    --cyan: #06b6d4;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;

    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-muted: #475569;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.4);
    --glow-pink: 0 0 20px rgba(236, 72, 153, 0.3);
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--purple);
    text-decoration: none;
    transition: color .2s;
}

a:hover {
    color: var(--pink);
}

/* ── Particle canvas ────────────────────────────────────────── */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.4);
    border-radius: 3px;
}

/* ── Glass card ─────────────────────────────────────────────── */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Navigation ─────────────────────────────────────────────── */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 30px;
    background: rgba(6, 6, 15, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
}

.ghost-icon {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.brand-name {
    background: var(--purple-g);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.875rem;
}

.avatar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.star-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-ghost-sm {
    padding: 7px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all .2s;
}

.btn-ghost-sm:hover {
    border-color: var(--purple);
    color: var(--text);
}

.btn-primary-sm {
    padding: 7px 16px;
    background: var(--purple-g);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.btn-primary-sm:hover {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-ghost-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: var(--radius);
    color: var(--purple);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .25s;
}

.btn-ghost-outline:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--purple);
    color: var(--purple);
    box-shadow: var(--glow-purple);
}

.btn-start-chat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--purple-g);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all .3s;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4), var(--shadow);
}

.btn-start-chat:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.6), var(--shadow);
    color: #fff;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── Hero ───────────────────────────────────────────────────── */
.home-page {
    overflow: hidden;
}

.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
    text-align: center;
}

.hero-content {
    max-width: 700px;
}

.hero-title {
    font-family: var(--font-head);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, #c084fc, #ec4899, #818cf8);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.chat-disabled-notice {
    padding: 14px 28px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--red);
}

/* ── Ghost mascot (CSS art) ─────────────────────────────────── */
.floating-ghost {
    display: inline-block;
    position: relative;
    margin-bottom: 24px;
    animation: float 4s ease-in-out infinite;
}

.ghost-body {
    width: 80px;
    height: 80px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.3) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-radius: 50% 50% 0 0;
    position: relative;
    border: 1px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
    backdrop-filter: blur(10px);
    margin: 0 auto;
}

.ghost-eyes {
    display: flex;
    justify-content: space-around;
    padding: 22px 14px 0;
}

.ghost-eye {
    width: 14px;
    height: 14px;
    background: var(--purple);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--purple);
    animation: blink 4s ease-in-out infinite;
}

@keyframes blink {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

.ghost-mouth {
    width: 20px;
    height: 8px;
    border: 2px solid rgba(236, 72, 153, 0.7);
    border-radius: 0 0 10px 10px;
    border-top: none;
    margin: 6px auto 0;
}

.ghost-bottom {
    display: flex;
    justify-content: space-around;
    margin-top: -2px;
    width: 80px;
    margin: 0 auto;
}

.ghost-wave {
    width: 26px;
    height: 16px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.3), transparent);
    border-radius: 0 0 50% 50%;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-top: none;
}

.ghost-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-16px);
    }
}

/* ── Live stats bar ─────────────────────────────────────────── */
.live-stats {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 24px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.83rem;
    color: var(--text-dim);
    z-index: 10;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.pulse-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 6px var(--green);
    }

    50% {
        box-shadow: 0 0 14px var(--green);
    }
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: center;
    padding: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(6, 6, 15, 0.6);
    border-top: 1px solid var(--border);
}

.footer-sep {
    margin: 0 8px;
}

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.auth-logo {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ghost-icon-sm {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.auth-card {
    width: 100%;
    padding: 36px 32px;
}

.auth-title {
    font-family: var(--font-head);
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-sub {
    color: var(--text-dim);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.auth-alert {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.auth-success {
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    color: #6ee7b7;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-group label i {
    margin-right: 4px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.input-eye-wrap {
    position: relative;
}

.input-eye-wrap .form-input {
    padding-right: 42px;
}

.eye-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.form-checkbox input[type="checkbox"] {
    accent-color: var(--purple);
    width: 16px;
    height: 16px;
}

.btn-auth {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 13px;
    background: var(--purple-g);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.4;
}

.btn-auth:hover {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-dim);
    display: flex;
    justify-content: center;
    gap: 8px;
}

.auth-disabled-notice {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
}

/* ── CAPTCHA widget ─────────────────────────────────────────── */
.captcha-group {
    margin-bottom: 16px;
}

.captcha-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.captcha-img {
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    display: block;
    cursor: default;
    width: 160px;
    height: 52px;
}

.captcha-refresh {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 6px;
    color: var(--purple);
    cursor: pointer;
    padding: 8px 10px;
    font-size: 0.9rem;
    line-height: 1;
    transition: background .2s;
}

.captcha-refresh:hover {
    background: rgba(168, 85, 247, 0.3);
}

/* ── Ban overlay ────────────────────────────────────────────── */
.ban-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(6, 6, 15, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ban-card {
    text-align: center;
    padding: 48px 40px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    max-width: 400px;
}

.ban-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.ban-card h2 {
    color: var(--red);
    margin-bottom: 12px;
    font-family: var(--font-head);
}

.ban-card p {
    color: var(--text-dim);
    margin-bottom: 8px;
}

.ban-until {
    font-size: 0.9rem;
}

/* ── Utility ────────────────────────────────────────────────── */
.mt-2 {
    margin-top: 16px;
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-muted {
    color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .glass-nav {
        padding: 10px 16px;
    }

    .hero {
        padding: 70px 16px 100px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .live-stats {
        font-size: 0.75rem;
        padding: 8px 16px;
        gap: 10px;
    }

    .auth-card {
        padding: 28px 20px;
    }
}

/* ── Theme toggle button ────────────────────────────────────── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color .2s, transform .3s;
    flex-shrink: 0;
    color: var(--text);
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--purple);
    transform: rotate(20deg);
}

/* ── Light mode variables & overrides ───────────────────────── */
body.light-mode {
    --bg: #f3f4f8;
    --bg2: #e8eaf2;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-h: rgba(255, 255, 255, 0.95);
    --border: rgba(0, 0, 0, 0.1);
    --border-h: rgba(168, 85, 247, 0.5);
    --text: #1e293b;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background: var(--bg);
    color: var(--text);
}

body.light-mode #particle-canvas {
    opacity: 0.25;
}

body.light-mode .glass-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .live-stats {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-dim);
}

body.light-mode .site-footer {
    background: rgba(255, 255, 255, 0.75);
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .ban-overlay {
    background: rgba(243, 244, 248, 0.97);
}

body.light-mode .ban-card {
    background: rgba(239, 68, 68, 0.04);
}

body.light-mode .btn-ghost-sm {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-dim);
}

body.light-mode .user-badge {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .feature-pill {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Auth pages in light mode */
body.light-mode .auth-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .form-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text);
}

body.light-mode .form-input:focus {
    border-color: var(--purple);
}

body.light-mode .form-input::placeholder {
    color: var(--text-muted);
}