/* ============================================================
   TEMAN'S - Elegant Orange Theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #E8650A;
    --primary-light: #F28C28;
    --primary-lighter: #FDEBD0;
    --primary-dark: #C45500;
    --primary-darken: #9A4000;
    --accent: #FF6B35;
    --accent-light: #FF8F5E;

    --bg: #FAF7F4;
    --bg-warm: #F5EDE5;
    --bg-card: #FFFFFF;
    --bg-input: #F5EDE5;
    --bg-nav: rgba(255,255,255,0.97);
    --bg-overlay: rgba(30,15,5,0.55);

    --text: #2D1B0E;
    --text-sub: #7A6555;
    --text-muted: #B0A090;
    --text-inv: #FFFFFF;

    --border: #E8DDD2;
    --border-focus: #E8650A;

    --success: #22C55E;
    --danger: #EF4444;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(45,27,14,0.06);
    --shadow-md: 0 4px 20px rgba(45,27,14,0.08);
    --shadow-lg: 0 8px 32px rgba(45,27,14,0.1);
    --shadow-xl: 0 16px 48px rgba(45,27,14,0.12);
    --shadow-glow: 0 4px 24px rgba(232,101,10,0.35);

    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --nav-h: 70px;
    --header-h: 56px;
    --max-w: 440px;
}

[data-theme="dark"] {
    --bg: #1A1210;
    --bg-warm: #241C18;
    --bg-card: #2A211B;
    --bg-input: #2A211B;
    --bg-nav: rgba(26,18,16,0.97);
    --text: #F5EDE5;
    --text-sub: #C4B5A5;
    --text-muted: #8A7A6A;
    --border: #3A302A;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: #EDE5DD;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

#app {
    width: 100%;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
    overflow-x: hidden;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(232,101,10,0.45); transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg-warm);
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-social {
    background: var(--bg-card);
    color: var(--text);
    border: 1.5px solid var(--border);
    font-weight: 600;
}
.btn-social:hover { border-color: var(--primary); color: var(--primary); }

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    color: var(--text-sub);
    position: relative;
}
.icon-btn:hover { background: var(--bg-warm); color: var(--text); }
.icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================================
   FORM INPUTS
   ============================================================ */
.input-group {
    margin-bottom: 18px;
    width: 100%;
}
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
}
.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
}
.input-wrapper input:has(~ .input-icon),
.input-wrapper input.has-icon {
    padding-left: 46px;
}
.input-wrapper:has(.input-icon) input {
    padding-left: 46px;
}
.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(232,101,10,0.1);
    background: var(--bg-card);
}
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper select { cursor: pointer; appearance: none; -webkit-appearance: none; }
.input-wrapper select option { color: var(--text); background: var(--bg-card); }

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    resize: vertical;
    outline: none;
}
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(232,101,10,0.1);
}

/* Toggle Switch */
.setting-item.toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.toggle input[type="checkbox"] {
    width: 48px;
    height: 26px;
    appearance: none;
    -webkit-appearance: none;
    background: #D1C5B8;
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}
.toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input[type="checkbox"]:checked { background: var(--primary); }
.toggle input[type="checkbox"]:checked::before { transform: translateX(22px); }

input[type="range"] {
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: var(--radius-full);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(232,101,10,0.4);
}

/* ============================================================
   AUTH PAGES - RESPONSIVE SPLIT SCREEN
   ============================================================ */

/* ---- ROOT OVERRIDE: Remove mobile-only max-width for auth pages ---- */
#app.auth-mode {
    background: #fff;
}

.auth-page {
    min-height: 100vh;
    display: none;
    position: relative;
    background: var(--bg);
}
.auth-page.active { display: flex; }

/* ===== SPLIT LAYOUT ===== */
.auth-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* LEFT PANEL - Image Side */
.auth-image-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: none; /* hidden on mobile */
}

.auth-image-panel img.auth-bg-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 8s ease;
}
.auth-image-panel:hover img.auth-bg-photo {
    transform: scale(1.04);
}

/* Gradient overlay that blends image into form panel */
.auth-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(30, 10, 0, 0.25) 0%,
        rgba(232, 101, 10, 0.18) 60%,
        rgba(255, 255, 255, 0.98) 100%
    );
    z-index: 1;
}

/* Text content on top of the image */
.auth-image-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 40px;
    z-index: 2;
    background: linear-gradient(to top, rgba(20, 7, 0, 0.75) 0%, transparent 100%);
}
.auth-image-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 10px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.auth-image-content p {
    font-size: 15px;
    color: rgba(255,255,255,0.82);
    max-width: 360px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.auth-image-badges {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.auth-image-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* Floating stats card */
.auth-stats-card {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 2;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    padding: 16px 22px;
    color: #fff;
    animation: floatShape 6s ease-in-out infinite;
}
.auth-stats-card .stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}
.auth-stats-card .stat-label {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* RIGHT PANEL - Form Side */
.auth-form-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: #fff;
    position: relative;
    overflow-y: auto;
    min-height: 100vh;
}

/* Subtle warm gradient background for form panel */
.auth-form-panel::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(232,101,10,0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-form-panel::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(232,101,10,0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Logo area */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

/* Sembunyikan heading sambutan pada versi Web/Desktop (min-width: 992px) karena logo sudah cukup mewakili */
@media (min-width: 992px) {
    .auth-form-heading { display: none; }
}
.auth-logo .back-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: var(--bg-warm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: all 0.2s;
    border: 1.5px solid var(--border);
}
.auth-logo .back-btn:hover { background: var(--border); color: var(--text); }

.auth-logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(232,101,10,0.35);
    animation: bounceIn 0.6s ease-out;
}
.auth-logo-img {
    width: 120px;
    height: auto;
    margin: 0 auto 16px;
    animation: bounceIn 0.6s ease-out;
    filter: drop-shadow(0 8px 16px rgba(232,101,10,0.15));
}
.logo-icon {
    font-size: 3rem;
}
.auth-logo h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}
.auth-logo p {
    font-size: 14px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* Form heading above form */
.auth-form-heading {
    margin-bottom: 32px;
}
.auth-form-heading h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.auth-form-heading p {
    font-size: 15px;
    color: #64748B;
    line-height: 1.5;
}

/* Form itself */
.auth-form {
    width: 100%;
    animation: slideUp 0.5s ease-out;
    background: #ffffff;
    padding: 36px 32px;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.03);
    margin-top: 10px;
}

/* Captcha padding fix */
.auth-form .input-wrapper input#login-captcha,
.auth-form .input-wrapper input#reg-captcha {
    padding-left: 110px !important;
}

/* Input styles for light form panel */
.auth-form .input-group label {
    color: var(--text-sub);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.auth-form .input-wrapper input,
.auth-form .input-wrapper select {
    background: #F8F9FA !important;
    border: 1.5px solid #CBD5E1 !important;
    color: #0F172A !important;
    border-radius: 12px;
    font-size: 15px;
    padding: 16px 16px !important;
    width: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.3s ease;
}
.auth-form .input-wrapper:has(.input-icon) input,
.auth-form .input-wrapper input.has-icon {
    padding-left: 48px !important;
}
.auth-form .input-wrapper input::placeholder { color: #94A3B8 !important; }
.auth-form .input-wrapper input:focus,
.auth-form .input-wrapper select:focus {
    background: #FFFFFF !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(232,101,10,0.1) !important;
}
.auth-form .input-wrapper .input-icon { color: #64748B !important; }
.auth-form .input-wrapper select option { color: var(--text); background: white; }

/* Captcha */
.captcha-row { display:flex; gap:10px; align-items:stretch; }
.captcha-row .input-wrapper { margin-bottom:0; }
.captcha-question { pointer-events:none; user-select:none; letter-spacing:1px; }
.captcha-row .captcha-refresh {
    background: var(--bg-warm) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text-sub) !important;
    border-radius: var(--radius) !important;
    padding: 14px 16px !important;
    flex-shrink: 0 !important;
    transition: all 0.2s;
}
.captcha-row .captcha-refresh:hover {
    background: var(--border) !important;
    color: var(--text) !important;
}

/* Submit Button */
.auth-form .btn-primary {
    margin-top: 8px;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 6px 24px rgba(232,101,10,0.35);
    letter-spacing: 0.02em;
}
.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(232,101,10,0.45);
}
.auth-form .btn-primary svg { color: rgba(255,255,255,0.8); }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-divider span {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Social / secondary button */
.auth-form .btn-social {
    background: var(--bg-warm);
    color: var(--text);
    border: 1.5px solid var(--border);
    font-weight: 700;
}
.auth-form .btn-social:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.auth-form .btn-social svg { color: var(--primary); }

/* Auth link at bottom */
.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-sub);
}
.auth-link a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }

/* Error toast inside form */
.auth-error {
    background: #FFF0EF;
    border: 1.5px solid #FFCBC7;
    color: #C0392B;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
    align-items: center;
    gap: 8px;
}
.auth-error.show { display: flex; }

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet & up: show image panel */
@media (min-width: 992px) {
    .auth-image-panel { display: block; min-width: 45%; max-width: 55%; }
    .auth-form-panel { width: auto; flex: 1; min-width: 380px; }
    
    /* Remove the bleed-right gradient on mobile */
    .auth-image-overlay {
        background: linear-gradient(
            to right,
            rgba(30, 10, 0, 0.2) 0%,
            rgba(232, 101, 10, 0.15) 60%,
            rgba(255, 255, 255, 0.97) 100%
        );
    }
}

/* Large desktop: wider image panel */
@media (min-width: 1200px) {
    .auth-image-panel { min-width: 55%; }
    .auth-form-panel { min-width: 420px; padding: 48px 56px; }
    .auth-image-content h2 { font-size: 2.4rem; }
}

/* Mobile & Tablet: full-width form with warm gradient background */
@media (max-width: 991px) {
    .auth-form-panel {
        background: linear-gradient(160deg, #9A4000 0%, #C45500 25%, #E8650A 55%, #F28C28 80%, #FDEBD0 100%);
        padding: 48px 24px;
    }
    .auth-form-panel::before, .auth-form-panel::after { display: none; }

    .auth-logo h1 { color: #fff; }
    .auth-logo p { color: rgba(255,255,255,0.85); }
    .auth-logo-icon { box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

    .auth-form-heading h2, .auth-form-heading p { color: rgba(255,255,255,0.9); }

    .auth-form .input-group label { color: rgba(255,255,255,0.8); }
    .auth-form .input-wrapper input,
    .auth-form .input-wrapper select {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.25);
        color: #fff;
    }
    .auth-form .input-wrapper input::placeholder { color: rgba(255,255,255,0.55); }
    .auth-form .input-wrapper input:focus,
    .auth-form .input-wrapper select:focus {
        background: rgba(255,255,255,0.22);
        border-color: rgba(255,255,255,0.5);
        box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
    }
    .auth-form .input-wrapper .input-icon { color: rgba(255,255,255,0.55); }

    .captcha-row .captcha-refresh {
        background: rgba(255,255,255,0.15) !important;
        border-color: rgba(255,255,255,0.25) !important;
        color: rgba(255,255,255,0.8) !important;
    }

    .auth-form .btn-primary {
        background: #fff;
        color: var(--primary-dark);
        box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    }
    .auth-form .btn-primary svg { color: var(--primary); }

    .auth-divider::before, .auth-divider::after { background: rgba(255,255,255,0.25); }
    .auth-divider span { color: rgba(255,255,255,0.65); }

    .auth-form .btn-social { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); color: #fff; }
    .auth-form .btn-social svg { color: rgba(255,255,255,0.8); }

    .auth-link { color: rgba(255,255,255,0.75); }
    .auth-link a { color: #fff; }

    .auth-logo .back-btn {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.25);
        color: #fff;
    }
}


.auth-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #9A4000 0%, #C45500 25%, #E8650A 50%, #F28C28 75%, #FDEBD0 100%);
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatShape 8s ease-in-out infinite;
}
.auth-bg::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,107,53,0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatShape 10s ease-in-out infinite reverse;
}

.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 36px;
    position: relative;
}
.auth-logo .back-btn {
    position: absolute;
    left: -60px;
    top: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.auth-logo .back-btn:hover { background: rgba(255,255,255,0.25); }

.logo-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
    animation: bounceIn 0.6s ease-out;
}

.auth-logo h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.auth-logo p {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

.auth-form {
    width: 100%;
    max-width: 380px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    animation: slideUp 0.5s ease-out;
}

.auth-form .input-group label {
    color: rgba(255,255,255,0.8);
}
.auth-form .input-wrapper input,
.auth-form .input-wrapper select {
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: var(--radius);
}
.auth-form .input-wrapper input::placeholder { color: rgba(255,255,255,0.55); }
.auth-form .input-wrapper input:focus,
.auth-form .input-wrapper select:focus {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}
.auth-form .input-wrapper .input-icon { color: rgba(255,255,255,0.5); }
.auth-form .input-wrapper select option { color: var(--text); background: white; }
.captcha-row { display:flex;gap:10px;align-items:stretch; }
.captcha-row .input-wrapper { margin-bottom:0; }
.captcha-row .captcha-refresh:hover { background:rgba(255,255,255,0.25) !important; }
.captcha-question { pointer-events:none;user-select:none;letter-spacing:1px; }

.auth-form .btn-primary {
    margin-top: 8px;
    padding: 16px;
    font-size: 16px;
    border-radius: var(--radius-lg);
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.auth-form .btn-primary svg { color: var(--primary); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.2);
}
.auth-divider span {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.auth-form .btn-social svg { color: var(--text-sub); }

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}
.auth-link a {
    color: white;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   PAGES
   ============================================================ */
.page {
    display: none;
    min-height: 100vh;
    background: var(--bg);
}
.page.active { display: block; animation: fadeIn 0.25s ease; }
.main-page { padding-bottom: calc(var(--nav-h) + 16px); }

/* Play Game Page - Full Screen Override */
#play-game-page {
    padding-bottom: 0 !important;
    height: 100vh;
    height: 100dvh;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#play-game-page.active {
    display: flex !important;
    animation: fadeIn 0.25s ease;
}
#play-game-page .page-content {
    flex: 1;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    position: relative;
}
#play-game-page .page-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Hide bottom nav when playing game */
#play-game-page.active ~ #bottom-nav {
    display: none !important;
}

/* Immersive Landscape Mode for Games */
@media screen and (orientation: landscape) and (max-width: 991px) {
    #play-game-page .page-header {
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 8px !important;
    }
    #play-game-page .page-header h2 {
        font-size: 13px !important;
    }
    #play-game-page .back-btn {
        width: 28px;
        height: 28px;
    }
    #play-game-page .page-header svg {
        width: 18px;
        height: 18px;
    }
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--header-h);
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.page-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-left, .header-right { display: flex; align-items: center; }
.page-content { padding: 16px; }

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    transition: all 0.2s;
}
.back-btn:hover { background: var(--bg-warm); color: var(--text); }

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateZ(0); /* Hardware acceleration */
    width: 100%;
    max-width: var(--max-w);
    height: var(--nav-h);
    background: var(--bg-nav);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-top: 1px solid rgba(232, 221, 210, 0.4);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    z-index: 500;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
}
.bottom-nav::-webkit-scrollbar {
    display: none;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
    min-width: 68px;
    flex: 0 0 auto;
    will-change: transform, color;
}
.nav-item:active { transform: scale(0.92) translateZ(0); }
.nav-item .nav-icon { transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); width:22px; height:22px; will-change: transform, width, height; }
.nav-item .nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; transition: color 0.3s ease; }
.nav-item.active { color: var(--primary); position: relative; top: -10px; }
.nav-item.active .nav-icon { 
    width: 46px; 
    height: 46px; 
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 20px rgba(232,101,10,0.4);
    transform: translateY(-2px);
}
.nav-item.active .nav-label { margin-top: 6px; color: var(--primary); font-weight: 800; }

/* ============================================================
   STORIES
   ============================================================ */
.stories-bar {
    display: flex;
    gap: 14px;
    padding: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.story-item span {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 600;
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.story-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 3px;
    background: var(--border);
    position: relative;
    transition: transform 0.2s;
}
.story-ring:hover { transform: scale(1.06); }
.story-ring.unviewed {
    background: linear-gradient(135deg, var(--primary), var(--accent), #FBBF24);
    box-shadow: 0 2px 12px rgba(232,101,10,0.3);
}
.story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--bg);
}
.story-ring .add-story-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    border: 2px solid var(--bg);
}

/* ============================================================
   SWIPE CARDS
   ============================================================ */
.swipe-area {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
    flex: 1;
}
.cards-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
}
.swipe-card {
    position: absolute;
    width: 100%;
    max-width: 380px;
    height: 430px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    cursor: grab;
    user-select: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
    will-change: transform;
}
.swipe-card:active { cursor: grabbing; }
.swipe-card .card-image { width: 100%; height: 100%; position: relative; }
.swipe-card .card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    pointer-events: none;
}
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    color: white;
    z-index: 2;
}
.card-info h2 { font-size: 1.4rem; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.card-location { font-size: 13px; opacity: 0.9; margin: 4px 0; }
.card-bio { font-size: 13px; opacity: 0.85; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.card-like-overlay, .card-nope-overlay, .card-super-overlay {
    position: absolute;
    top: 30px;
    padding: 8px 20px;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.card-like-overlay { left: 20px; color: #22C55E; border: 4px solid #22C55E; transform: rotate(-15deg); }
.card-nope-overlay { right: 20px; color: #EF4444; border: 4px solid #EF4444; transform: rotate(15deg); }
.card-super-overlay { left: 50%; transform: translateX(-50%); color: #FBBF24; border: 4px solid #FBBF24; bottom: 100px; top: auto; }
.swiping-right .card-like-overlay, .swiping-left .card-nope-overlay { opacity: 1; }

.swipe-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}
.action-btn {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    border: none;
    cursor: pointer;
}
.action-nope {
    width: 56px;
    height: 56px;
    background: white;
    color: #EF4444;
    border: 2px solid #FECACA;
    box-shadow: var(--shadow-sm);
}
.action-nope:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(239,68,68,0.25); background: #FEF2F2; }
.action-super {
    width: 46px;
    height: 46px;
    background: white;
    color: #F59E0B;
    border: 2px solid #FDE68A;
    box-shadow: var(--shadow-sm);
}
.action-super:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(245,158,11,0.25); }
.action-like {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: var(--shadow-glow);
}
.action-like:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(232,101,10,0.45); }

/* ============================================================
   MATCH POPUP
   ============================================================ */
.match-popup { display: none; z-index: 1000; }
.match-popup.active {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
}
.match-content {
    text-align: center;
    padding: 40px;
    animation: matchBounce 0.6s ease-out;
    color: white;
}
.match-hearts { position: relative; height: 70px; margin-bottom: 16px; }
.heart { position: absolute; font-size: 2rem; animation: heartFloat 2s ease-in-out infinite; }
.heart-1 { left: 15%; }
.heart-2 { left: 50%; transform: translateX(-50%); animation-delay: 0.3s; }
.heart-3 { right: 15%; animation-delay: 0.6s; }
.match-content h2 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.match-content p { font-size: 16px; opacity: 0.9; margin-bottom: 28px; }
.match-avatars { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 28px; }
.match-avatars img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid white; }
.match-heart { font-size: 1.8rem; animation: pulse 1.5s ease-in-out infinite; }
.match-actions { display: flex; flex-direction: column; gap: 12px; }
.match-actions .btn-primary { background: white; color: var(--primary-dark); }
.match-actions .btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 1.5px solid rgba(255,255,255,0.3); }

/* ============================================================
   CONVERSATIONS
   ============================================================ */
.search-bar-wrapper {
    padding: 0 16px 12px;
    position: relative;
}
.search-bar-wrapper .search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(calc(-50% - 6px));
    color: var(--text-muted);
    pointer-events: none;
}
.search-bar-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}
.search-bar-wrapper input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(232,101,10,0.1); }

.conversation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}
.conversation-item:hover { background: var(--bg-warm); }

.conv-avatar { position: relative; flex-shrink: 0; }
.conv-avatar img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.online-indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--border);
    border: 2.5px solid var(--bg-card);
}
.online-indicator.online { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.conv-info { flex: 1; min-width: 0; }
.conv-info h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.conv-last-msg { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item.unread .conv-last-msg { color: var(--text); font-weight: 600; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conv-time { font-size: 11px; color: var(--text-muted); }
.conv-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-page { display: none; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-page.active { display: flex; }
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.chat-partner { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.chat-partner img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-partner h4 { font-size: 15px; font-weight: 700; }
.chat-partner .online-text { font-size: 11px; color: var(--success); font-weight: 600; }
.chat-actions { display: flex; gap: 4px; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg);
    scroll-behavior: smooth;
}
.message { display: flex; gap: 10px; max-width: 82%; animation: messageIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.message.own { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; align-self: flex-end; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.msg-bubble {
    padding: 12px 18px;
    border-radius: 22px;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.message.own .msg-bubble {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 6px 20px rgba(232,101,10,0.3);
}
.message.other .msg-bubble {
    background: var(--bg-card);
    color: var(--text);
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.msg-bubble p { font-size: 15px; line-height: 1.5; margin: 0; }
.msg-time { display: block; font-size: 11px; opacity: 0.7; margin-top: 6px; text-align: right; font-weight: 500; }
.message.own .msg-time { color: rgba(255,255,255,0.85); }
.message.other .msg-time { color: var(--text-sub); }
.chat-image { max-width: 220px; border-radius: var(--radius-sm); cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.typing-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
    background: var(--bg);
}
.typing-indicator.active { display: flex; }
.typing-indicator span {
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
    opacity: 0.7;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}
.chat-input-wrapper { flex: 1; }
.chat-input-wrapper input {
    width: 100%;
    padding: 14px 20px;
    border: 1.5px solid var(--border);
    border-radius: 25px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.25s ease;
}
.chat-input-wrapper input:focus { 
    border-color: var(--primary); 
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(232,101,10,0.15); 
}
.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(232,101,10,0.4);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: none;
    cursor: pointer;
}
.send-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(232,101,10,0.5);
}
.send-btn:active {
    transform: scale(0.95);
}
.attach-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.attach-btn:hover {
    background: var(--border);
    color: var(--primary);
}


/* ============================================================
   PROFILE REDESIGN (ELEGANT & PREMIUM)
   ============================================================ */
.profile-header {
    position: relative;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding-bottom: 16px;
}
.profile-cover {
    height: 200px;
    position: relative;
    background: linear-gradient(135deg, #FF7E40 0%, #E8650A 50%, #9A4000 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.profile-cover:hover img {
    transform: scale(1.03);
}
.profile-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.4) 100%);
}
.btn-change-cover {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-change-cover:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}
.profile-avatar-section {
    display: flex;
    justify-content: center;
    margin-top: -64px;
    position: relative;
    z-index: 5;
}
.profile-avatar-wrapper {
    position: relative;
    border-radius: 50%;
    padding: 4px;
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.profile-avatar-wrapper:hover {
    transform: scale(1.03);
}
.profile-avatar-wrapper.vip {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #D97706 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}
.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-card);
}
.btn-change-avatar {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 3px solid var(--bg-card);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 6;
}
.btn-change-avatar:hover {
    background: var(--accent);
    transform: scale(1.1);
}
.verified-badge, .premium-badge {
    position: absolute;
    bottom: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--bg-card);
    font-size: 12px;
    z-index: 6;
}
.verified-badge {
    right: 4px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
}
.premium-badge {
    left: 4px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}
.profile-info {
    text-align: center;
    padding: 16px 24px 8px;
    background: var(--bg-card);
    border-radius: 0 0 24px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.profile-location {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.profile-bio {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 18px;
    line-height: 1.6;
    padding: 12px 16px;
    background: var(--bg-warm);
    border-radius: 12px;
    font-style: italic;
    border-left: 4px solid var(--primary);
    text-align: left;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}
.profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 22px;
}
.profile-tags .tag {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(232, 101, 10, 0.15);
    transition: all 0.2s ease;
}
.profile-tags .tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}
.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}
.profile-actions .btn {
    flex: 1;
    max-width: 140px;
    padding: 12px 16px;
    font-size: 14px;
}
.profile-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 12px;
}
.profile-secondary-actions .btn {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
}
.profile-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.profile-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-warning-card {
    background: linear-gradient(135deg, #FFFDF9 0%, #FFF9EC 100%);
    border: 1.5px solid #FCD34D;
    color: #92400E;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(245,158,11,0.05);
}
.profile-warning-card .warning-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: 1px;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.photo-item {
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--bg-warm);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-md);
}
.photo-item img, .photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-primary-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(232, 101, 10, 0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.video-play-overlay {
    position: absolute;
    font-size: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}
.photo-item:hover .video-play-overlay {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}
.profile-edit-section {
    padding: 8px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-section { margin-bottom: 24px; }
.settings-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding-left: 16px;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
@media (min-width: 576px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
    .settings-grid .full-width {
        grid-column: 1 / -1;
    }
}
.settings-grid .form-group {
    margin-bottom: 0;
}
.settings-grid label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
}
.settings-grid input[type="number"],
.settings-grid select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text);
    font-weight: 600;
    text-align: left;
    font-size: 14px;
    transition: all 0.2s;
}
.settings-grid input[type="number"]:focus,
.settings-grid select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,101,10,0.1);
    outline: none;
}
.settings-grid .toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: 10px;
    border: 1.5px solid var(--border);
}
.settings-grid .toggle-group label {
    margin-bottom: 0;
}
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border-bottom: 1px solid var(--border);
}
.setting-item:last-child {
    border-bottom: none;
}
.setting-item label { font-size: 15px; font-weight: 600; }
.setting-item input[type="number"],
.setting-item select {
    width: 90px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    transition: border-color 0.2s;
}
.setting-item input[type="number"]:focus,
.setting-item select:focus {
    border-color: var(--primary);
    outline: none;
}
.setting-item span { font-size: 13px; color: var(--text-sub); font-weight: 600; margin-left: 12px; }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}
.notification-item.unread { background: var(--primary-lighter); }
.notif-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.notif-content { flex: 1; }
.notif-content strong { font-size: 15px; font-weight: 700; display: block; margin-bottom: 2px; }
.notif-content p { font-size: 13px; color: var(--text-sub); }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

/* ============================================================
   MATCHES
   ============================================================ */
.match-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}
.match-item:hover { background: var(--bg-warm); }
.match-avatar { position: relative; }
.match-avatar img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-lighter); }
.match-info { flex: 1; }
.match-info h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.match-info p { font-size: 13px; color: var(--text-muted); }
.match-time { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   CALLS
   ============================================================ */
.call-page { display: none; flex-direction: column; height: 100vh; background: linear-gradient(160deg, #9A4000 0%, #E8650A 50%, #F28C28 100%); color: white; }
.call-page.active { display: flex; }
.call-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.call-avatar-ring {
    width: 120px; height: 120px;
    border-radius: 50%; padding: 4px;
    background: rgba(255,255,255,0.2);
    margin-bottom: 24px;
    animation: callPulse 2s ease-in-out infinite;
}
.call-avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid white; }
.call-container h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.call-container #call-type { font-size: 15px; opacity: 0.8; margin-bottom: 16px; }
.call-timer { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 48px; }
.call-video-area { position: fixed; top: 0; left: 0; right: 0; bottom: 120px; display: grid; gap: 8px; }
.call-video-area video { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.call-actions { display: flex; gap: 24px; }
.call-action-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}
.call-action-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.08); }
.call-end-btn {
    background: var(--danger) !important;
    width: 64px; height: 64px;
    box-shadow: 0 4px 20px rgba(239,68,68,0.5);
}

/* ============================================================
   STORY VIEWER
   ============================================================ */
.story-viewer { display: none; position: fixed; inset: 0; background: #000; z-index: 1000; }
.story-viewer.active { display: flex; align-items: center; justify-content: center; }
.story-container { width: 100%; max-width: var(--max-w); height: 100%; position: relative; display: flex; flex-direction: column; }
.story-header {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; gap: 12px;
    padding: 16px; background: linear-gradient(180deg, rgba(0,0,0,0.6), transparent);
    color: white; z-index: 2;
}
.story-header img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid white; }
.story-header span { flex: 1; font-weight: 700; }
.story-header button { color: white; padding: 4px; }
.story-media { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; color: white; text-align: center; }
.story-media p { font-size: 1.3rem; font-weight: 700; }
.story-media img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); }

/* ============================================================
   TAGS
   ============================================================ */
.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
}

/* ============================================================
   GIFTS
   ============================================================ */
.gifts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px 0; }
.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
}
.gift-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gift-icon { font-size: 2rem; }
.gift-name { font-size: 11px; font-weight: 700; color: var(--text-sub); }
.gift-price { font-size: 10px; color: var(--primary); font-weight: 700; }

/* ============================================================
   LOADING & EMPTY
   ============================================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-muted);
}
.pulse-loader {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-lighter);
    position: relative;
    animation: pulse 1.5s ease-in-out infinite;
}
.pulse-loader::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    animation: spin 1s linear infinite;
}

.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; animation: bounce 2s ease-in-out infinite; }
.empty-state h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
}
.modal-overlay.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.3s ease-out;
}
.modal-overlay.image-viewer.active {
    align-items: center;
}
.image-viewer-content-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.anti-screenshot-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: transparent;
    pointer-events: auto; /* Catch clicks */
}
.protected-image {
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none; /* Prevent context menu directly on image */
}
.modal-sheet {
    width: 100%;
    max-width: var(--max-w);
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -8px 36px rgba(0,0,0,0.12);
}
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: var(--radius-full); margin: 0 auto 20px; }
.modal-sheet h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; }
.modal-content-center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.photo-preview { margin: 12px 0; text-align: center; }
.photo-preview img { max-width: 200px; max-height: 200px; border-radius: var(--radius); object-fit: cover; margin: 0 auto; }

/* Form group di dalam modal */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(232,101,10,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 380px;
    pointer-events: none;
}
.toast {
    padding: 14px 18px;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes floatShape { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-20px) rotate(5deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes matchBounce { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
@keyframes heartFloat { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-12px) scale(1.15); } }
@keyframes callPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.3); } 50% { box-shadow: 0 0 0 20px rgba(255,255,255,0); } }
@keyframes messageIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ============================================================
   NEARBY PAGE
   ============================================================ */
#nearby-page .page-content { display:flex; flex-direction:column; gap:12px; padding-bottom:80px; }
.nearby-card { display:flex; align-items:center; gap:14px; padding:14px 16px; background:var(--bg-secondary); border-radius:var(--radius); border:1px solid var(--border); transition:0.2s; }
.nearby-card:active { transform:scale(0.98); }
.nearby-avatar { position:relative; flex-shrink:0; }
.nearby-avatar img { width:52px; height:52px; border-radius:50%; object-fit:cover; border:2px solid var(--primary); }
.nearby-distance { position:absolute; bottom:-4px; right:-6px; background:var(--primary); color:#fff; font-size:10px; font-weight:700; padding:2px 6px; border-radius:999px; white-space:nowrap; }
.nearby-info { flex:1; min-width:0; }
.nearby-info h4 { font-size:15px; font-weight:700; margin-bottom:2px; }
.nearby-info p { font-size:13px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nearby-info .nearby-username { font-size:11px; color:var(--primary); opacity:0.7; }
.nearby-action { flex-shrink:0; width:36px; height:36px; border-radius:50%; border:none; background:var(--bg-hover); color:var(--text); display:flex; align-items:center; justify-content:center; cursor:pointer; }
#nearby-content .loading-ring { text-align:center; padding:80px 20px; }
#nearby-content .loading-ring p { margin-top:16px; color:var(--text-muted); font-size:14px; }

/* ============================================================
   RECOMMENDATIONS / FRIENDS
   ============================================================ */
.rec-card { display:flex;align-items:center;gap:14px;padding:14px 16px;background:var(--bg-secondary);border-radius:var(--radius);border:1px solid var(--border);transition:0.2s;cursor:pointer; }
.rec-card:active { transform:scale(0.98); }
.rec-avatar img { width:52px;height:52px;border-radius:50%;object-fit:cover;border:2px solid var(--primary); }
.rec-info { flex:1;min-width:0; }
.rec-info h4 { font-size:15px;font-weight:700;margin-bottom:2px; }
.rec-info p { font-size:13px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.rec-badge { font-size:11px;font-weight:700;padding:3px 8px;border-radius:999px;background:var(--primary);color:#fff; }
.rec-badge.hobby { background:var(--bg-hover);color:var(--text);border:1px solid var(--border); }
.tab-btn { padding:8px 16px;border:none;border-radius:var(--radius);background:var(--bg-secondary);color:var(--text);font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap; }
.tab-btn.active { background:var(--primary);color:#fff; }
.hobby-tag { display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border-radius:999px;background:var(--primary);color:#fff;font-size:13px;font-weight:600; }
.hobby-tag.hobby-suggestion { background:var(--bg-hover);color:var(--text);border:1px solid var(--border);cursor:pointer; }
.hobby-tag.hobby-suggestion:hover { border-color:var(--primary);color:var(--primary); }

/* ============================================================
   STORE / MARKETPLACE
   ============================================================ */
.product-card { background:var(--bg-secondary);border-radius:var(--radius);overflow:hidden;border:1px solid var(--border);cursor:pointer;transition:0.2s; }
.product-card:active { transform:scale(0.97); }
.product-img { height:120px;background:var(--bg-hover);display:flex;align-items:center;justify-content:center;overflow:hidden; }
.product-img img { width:100%;height:100%;object-fit:cover; }
.no-img { font-size:2rem;color:var(--text-muted); }
.product-info { padding:10px 12px; }
.product-info h4 { font-size:13px;font-weight:700;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.product-price { font-weight:800;color:var(--primary); }
.product-info small { font-size:11px;color:var(--text-muted); }

/* ============================================================
   MEMBERSHIP PLANS
   ============================================================ */
.plans-grid { display:flex;flex-direction:column;gap:12px;margin-top:16px; }
.plan-card { padding:16px;border-radius:var(--radius);border:2px solid var(--border);background:var(--bg-secondary);cursor:pointer;transition:0.2s;position:relative; }
.plan-card.active { border-color:var(--primary);background:rgba(232,101,10,0.05); }
.plan-card h4 { font-size:16px;font-weight:800; }
.plan-price { font-size:24px;font-weight:800;color:var(--primary);margin:4px 0; }
.plan-duration { font-size:12px;color:var(--text-muted); }
.plan-badge { position:absolute;top:12px;right:12px;padding:4px 10px;border-radius:999px;background:var(--primary);color:#fff;font-size:11px;font-weight:700; }
.plan-badge.free { background:var(--success); }
.current-plan { padding:12px 16px;background:rgba(232,101,10,0.1);border-radius:var(--radius);margin-bottom:12px;font-size:14px; }
.product-detail-modal h3 { font-size:18px;font-weight:800;margin-bottom:8px; }
.product-detail-modal .pd-images { display:flex;gap:8px;overflow-x:auto;margin-bottom:16px; }
.product-detail-modal .pd-images img { height:200px;border-radius:var(--radius);object-fit:cover; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

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

@media (max-width: 360px) {
    :root { --max-w: 100vw; }
    .swipe-card { height: 380px; }
}

/* ============================================================
   LIVE ROOMS
   ============================================================ */
.nav-live { position: relative; }
.nav-live .live-dot {
    position: absolute; top: 4px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #ff4444; display: none;
    animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.live-categories {
    display: flex; gap: 8px; padding: 12px 16px;
    overflow-x: auto; scrollbar-width: none;
}
.live-categories::-webkit-scrollbar { display: none; }
.cat-chip {
    padding: 6px 16px; border-radius: 999px; font-size: 13px;
    font-weight: 600; border: 1.5px solid var(--border);
    background: var(--bg-card); color: var(--text-sub);
    white-space: nowrap; cursor: pointer; transition: all 0.2s;
}
.cat-chip.active, .cat-chip:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

.live-rooms-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; padding: 12px 16px;
}
.live-room-card {
    position: relative; border-radius: 12px; overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    cursor: pointer; transition: transform 0.2s;
    aspect-ratio: 9/16; max-height: 280px;
}
.live-room-card:hover { transform: scale(1.02); }
.live-room-card .lrc-avatar {
    position: absolute; top: 10px; left: 10px;
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px solid var(--primary); object-fit: cover;
}
.live-room-card .lrc-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(255,0,0,0.85); color: #fff;
    font-size: 10px; font-weight: 700;
    animation: livePulse 1.5s infinite;
}
.live-room-card .lrc-viewers {
    position: absolute; top: 10px; right: 10px;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 11px;
}
.live-room-card .lrc-bottom {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 10px; background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
.live-room-card .lrc-title {
    color: #fff; font-size: 13px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-room-card .lrc-host {
    color: rgba(255,255,255,0.7); font-size: 11px; margin-top: 2px;
}

/* Live Room Viewer */
.live-room-page { display: none; }
.live-room-page.active { display: block; }
.live-room-container {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #000; display: flex; flex-direction: column;
    z-index: 1000;
}
.live-top-bar {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: linear-gradient(rgba(0,0,0,0.7), transparent);
    z-index: 10;
}
.live-host-info { display: flex; align-items: center; gap: 8px; }
.live-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--primary); }
.live-host-name { color: #fff; font-size: 13px; font-weight: 700; }
.live-viewer-count { color: rgba(255,255,255,0.7); font-size: 11px; }
.live-title-bar {
    flex: 1; display: flex; align-items: center; gap: 8px;
    color: #fff; font-size: 13px; overflow: hidden;
}
.live-badge {
    padding: 2px 8px; border-radius: 999px;
    background: rgba(255,0,0,0.85); color: #fff;
    font-size: 10px; font-weight: 700; white-space: nowrap;
}
.live-close-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: #fff;
    border: none; font-size: 16px; cursor: pointer;
}
.live-video-area {
    flex: 1; position: relative; display: flex;
    align-items: center; justify-content: center;
}
.live-video-area video { width: 100%; height: 100%; object-fit: cover; }
.live-waiting {
    position: absolute; display: flex; flex-direction: column;
    align-items: center; gap: 12px; color: #fff;
}
.live-chat-area {
    position: absolute; bottom: 60px; left: 0; right: 0;
    max-height: 40%; display: flex; flex-direction: column;
    padding: 0 12px; z-index: 5;
}
.live-messages {
    flex: 1; overflow-y: auto; display: flex;
    flex-direction: column; gap: 6px; padding: 12px;
    max-height: 250px;
}
.live-msg {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 20px;
    background: rgba(0,0,0,0.6); color: #fff;
    font-size: 14px; max-width: 85%; backdrop-filter: blur(8px);
    width: fit-content; line-height: 1.4;
}
.live-msg.gift {
    background: rgba(232,101,10,0.4);
    border: 1px solid rgba(232,101,10,0.6);
}
.live-msg.join { 
    color: rgba(255,255,255,0.7); font-size: 12px; 
    align-self: flex-start;
}
.live-msg .msg-sender { font-weight: 700; color: var(--primary); }
.live-chat-input {
    display: flex; gap: 8px; padding: 8px 0;
}
.live-chat-input input {
    flex: 1; padding: 8px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; font-size: 13px; outline: none;
}
.live-chat-input input::placeholder { color: rgba(255,255,255,0.5); }
.live-bottom-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: linear-gradient(transparent, rgba(0,0,0,0.8));
    z-index: 10;
}
.live-actions-left, .live-actions-right { display: flex; gap: 10px; align-items: center; }
.live-action-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: #fff;
    border: none; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
}
.live-action-btn.muted { background: rgba(255,0,0,0.5); }
.live-gift-btn {
    padding: 8px 16px; border-radius: 999px;
    background: rgba(232,101,10,0.3); color: #fff;
    border: 1px solid rgba(232,101,10,0.5);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.live-points-display {
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255,255,255,0.15); color: #fff;
    font-size: 13px; font-weight: 600;
}

/* Gift Animation */
.gift-animation-container {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; z-index: 20;
}
.gift-floating {
    position: absolute; font-size: 3rem;
    animation: giftFloat 2s ease-out forwards;
    pointer-events: none;
}
@keyframes giftFloat {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-150px) scale(1); opacity: 0; }
}
.gift-toast {
    position: absolute; bottom: 80px; left: 16px; right: 16px;
    padding: 10px 16px; border-radius: 12px;
    background: rgba(232,101,10,0.9); color: #fff;
    font-size: 13px; font-weight: 600; text-align: center;
    animation: giftToastIn 0.3s ease-out;
    z-index: 25;
}
@keyframes giftToastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Go Live */
.go-live-preview { border-radius: 12px; overflow: hidden; background: #000; }
.go-live-form .input-group { margin-bottom: 12px; }
.go-live-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
.go-live-form .input-field {
    width: 100%; padding: 10px 14px; border-radius: 10px;
    border: 1.5px solid var(--border); font-size: 14px;
    background: var(--bg-card); color: var(--text-main);
}

/* Points Purchase */
.points-balance-card {
    padding: 20px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #ff8c00);
    color: #fff; text-align: center;
}
.points-balance-label { font-size: 13px; opacity: 0.9; }
.points-balance-value { font-size: 32px; font-weight: 800; margin-top: 4px; }
.points-balance-card .btn-outline { color: #fff; border-color: rgba(255,255,255,0.4); }
.points-packages-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.points-package-card {
    padding: 14px; border-radius: 12px; text-align: center;
    background: var(--bg-card); border: 2px solid var(--border);
    cursor: pointer; transition: all 0.2s;
}
.points-package-card.selected { border-color: var(--primary); background: rgba(232,101,10,0.05); }
.points-package-card .pkg-name { font-size: 14px; font-weight: 700; }
.points-package-card .pkg-points { font-size: 20px; font-weight: 800; color: var(--primary); margin: 4px 0; }
.points-package-card .pkg-bonus { font-size: 11px; color: var(--success); font-weight: 600; }
.points-package-card .pkg-price { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.payment-methods { display: flex; gap: 10px; }
.payment-method-card {
    flex: 1; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px;
    text-align: center; background: var(--bg-card);
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: block;
}
.payment-method-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}
.payment-method-card input { display: none; }
.payment-method-card.active { border-color: var(--primary); background: rgba(232,101,10,0.05); }
.pm-icon { font-size: 24px; margin-bottom: 4px; }
.pm-name { font-size: 13px; font-weight: 700; }
.pm-desc { font-size: 10px; color: var(--text-muted); }
.purchase-summary {
    padding: 16px; border-radius: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
}
.summary-row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 13px;
}
.summary-row.total { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* ============================================================
   DESKTOP 3-COLUMN LAYOUT (FACEBOOK-STYLE & DARK THEME)
   ============================================================ */
/* Default Mobile Sidebar hiding */
.desktop-sidebar { display: none; }

@media (min-width: 992px) {
    /* Set App to Grid and Dark Theme matching "Admin 3 Warna" / Facebook Dark */
    body {
        background: var(--bg) !important;
        overflow: hidden;
    }
    
    #app {
        display: grid;
        grid-template-columns: 280px 1fr 320px;
        height: 100vh;
        max-width: 100%;
        background: var(--bg);
        color: var(--text);
        box-shadow: none !important;
    }
    
    /* Exception: Auth pages should stay full screen block */
    #app:has(.auth-page.active) {
        display: block;
        background: var(--bg);
        overflow-y: auto;
    }
    #app:has(.auth-page.active) .desktop-sidebar {
        display: none !important;
    }

    /* Sidebars */
    .desktop-sidebar {
        display: block;
        height: 100vh;
        overflow-y: auto;
        background: var(--bg-card);
        padding: 24px;
        border-right: 1px solid var(--border);
        /* Scrollbar styling */
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
    }
    .desktop-sidebar::-webkit-scrollbar { width: 6px; }
    .desktop-sidebar::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 10px; }

    .desktop-sidebar.right-sidebar {
        border-right: none;
        border-left: 1px solid var(--border);
    }


    .sidebar-logo {
        margin-bottom: 32px;
        display: flex;
        align-items: center;
        padding: 0 8px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .sidebar-item {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 12px 16px;
        border-radius: 12px;
        color: var(--text);
        font-weight: 600;
        transition: background 0.2s;
        text-decoration: none;
        cursor: pointer;
    }
    .sidebar-item:hover {
        background: var(--bg-warm);
    }
    .sidebar-item.active {
        background: rgba(232,101,10,0.15); /* Primary tint */
        color: var(--primary);
    }
    .sidebar-item.active .sidebar-icon {
        color: var(--primary);
        stroke: var(--primary);
    }
    
    .sidebar-divider {
        border: none;
        border-top: 1px solid var(--border);
        margin: 16px 0;
    }

    .sidebar-heading {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-sub);
        margin-bottom: 16px;
    }

    /* Right Sidebar Custom Styles */
    .friend-request-item {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
        padding: 8px;
        border-radius: 8px;
        transition: background 0.2s;
        cursor: pointer;
    }
    .friend-request-item:hover {
        background: var(--bg-warm);
    }
    .friend-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        object-fit: cover;
    }
    .friend-info h4 { margin: 0; font-size: 14px; color: var(--text); font-weight: 600; }
    .friend-info p { margin: 2px 0 8px; font-size: 12px; color: var(--text-sub); }
    .friend-actions { display: flex; gap: 8px; }

    /* Center Content (Main Pages) Overrides */
    .page.main-page {
        height: 100vh;
        overflow-y: auto;
        background: var(--bg) !important;
        position: relative;
        padding-bottom: 40px;
        scrollbar-width: none;
    }
    .page.main-page::-webkit-scrollbar { display: none; }
    
    .page-header {
        background: var(--bg-nav) !important;
        border-bottom: 1px solid var(--border) !important;
        color: var(--text);
        backdrop-filter: blur(10px);
    }
    .page-header h2 { color: var(--text) !important; }
    .page-header .icon-btn { color: var(--text) !important; background: var(--bg-warm) !important; }
    
    /* Make the swipe area look good in the middle */
    .swipe-area {
        max-width: 480px;
        margin: 0 auto;
        height: calc(100vh - 180px);
        position: relative;
    }
    .stories-bar {
        max-width: 600px;
        margin: 0 auto;
        padding: 16px 20px;
        border-bottom: none;
    }
    
    /* Hide bottom nav globally on desktop */
    #bottom-nav { display: none !important; }
}

/* ============================================================
   STORY VIEWER — Full-screen Facebook/Instagram style
   ============================================================ */
#story-viewer-modal {
    display: none;
}
#sv-container {
    height: 100vh;
}
#sv-content {
    position: absolute;
    inset: 0;
}
#sv-content img,
#sv-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#sv-comment-input::placeholder {
    color: rgba(255,255,255,0.55);
}
/* Scrollbar hidden on story bubbles row */
#story-bubbles-row::-webkit-scrollbar { display: none; }
#story-bubbles-row { scrollbar-width: none; }
/* Story feed card thumbnail hover */
#stories-feed-list > div:hover { background: var(--bg-secondary, #f5f0eb); }


@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
