/* =========================================================================
   VIDORA SaaS - Apple HIG & UI/UX Pro Max Design System
   Human Interface Guidelines Compliant | Precision Typography & Micro-Interactions
   ========================================================================= */

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

:root {
    /* Apple HIG Color Palette - Deep Dark Mode */
    --app-bg: #090a0f;
    --card-bg: rgba(18, 21, 30, 0.76);
    --card-bg-elevated: #161a26;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.16);
    --card-specular: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    --input-bg: rgba(11, 13, 20, 0.9);
    
    /* Apple Semantic Accents */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.32);
    
    --accent-blue: #007aff;
    --accent-cyan: #00f2fe;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
    
    /* Apple High-Contrast Text System */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    /* Apple Continuous Radii (Squircle-feel) */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --radius-full: 9999px;
    
    /* System Heights & Touch Targets */
    --bottom-nav-height: 68px;
    --header-height: 64px;
    --min-tap-target: 44px;
    
    /* Apple Fluid Springs & Curves */
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Plus Jakarta Sans", "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #06070a;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
    letter-spacing: -0.011em;
}

/* App Header */
.app-header {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: var(--header-height);
    background: rgba(9, 10, 15, 0.95);
    backdrop-filter: saturate(190%) blur(24px);
    -webkit-backdrop-filter: saturate(190%) blur(24px);
    border-bottom: 1px solid var(--card-border);
    border-left: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 90;
    display: flex;
    align-items: center;
}

.header-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 14px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.app-logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: white;
    font-size: 18px;
}

.header-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.header-title span {
    color: var(--primary);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: #a5b4fc;
}

/* App Container (Mobile Frame) */
.app-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 14px;
    background: #090a0f;
    border-left: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    min-height: calc(100vh - var(--header-height));
    padding-bottom: calc(var(--bottom-nav-height) + 36px + env(safe-area-inset-bottom, 16px)) !important;
}

@media (max-width: 480px) {
    body {
        background-color: #090a0f;
    }
    .app-header,
    .app-container {
        border-left: none;
        border-right: none;
        box-shadow: none;
    }
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-pane.active {
    display: block !important;
}

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

/* Sub-Tab Navigation (Apple iOS Segmented Control) */
.sub-tabs-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 20px;
    gap: 3px;
}

.sub-tab-btn {
    flex: 1;
    min-height: 38px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 11px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s var(--ease-spring);
    white-space: nowrap;
}

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

.sub-tab-btn:active {
    transform: scale(0.98);
}

.sub-tab-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cards (Apple HIG Depth & Deference) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.42), var(--card-specular);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color 0.2s ease;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Outfit", sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Product Image Upload Dropzone */
.upload-dropzone {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    background: rgba(12, 14, 21, 0.6);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.dropzone-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropzone-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
}

.image-preview-box {
    display: none;
    position: relative;
    width: 100%;
    max-height: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    background: #000;
}

.image-preview-box img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
}

.btn-remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-select, .form-input, .form-textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
    min-height: 95px;
    resize: vertical;
    line-height: 1.5;
}

/* Prompt Presets / Auto Action */
.prompt-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.btn-auto-prompt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-auto-prompt:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* Options Grid (Ratio, Durasi) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.options-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.option-btn {
    padding: 10px 6px;
    border-radius: var(--radius-md);
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.option-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: white;
}

/* Switch */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #272733;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #34c759; /* Apple System Green */ }
input:checked + .slider:before { transform: translateX(20px); }

/* Main Action Button (Apple HIG Precision Primary) */
.btn-generate {
    width: 100%;
    min-height: 50px;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s var(--ease-spring);
    margin-top: 14px;
}

.btn-generate:hover {
    background: linear-gradient(180deg, #6d70f7 0%, #5850ec 100%);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-generate:active {
    transform: scale(0.982);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-generate:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary Actions */
.btn-secondary {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Prompt Generator Result Box */
.prompt-result-card {
    background: #0d101a;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
    display: none;
}

.prompt-result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Account Manager List */
.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e1b4b;
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.account-email {
    font-weight: 600;
    font-size: 14px;
}

.account-status {
    font-size: 12px;
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    gap: 4px;
}

.limit-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--input-bg);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0 16px;
}

.limit-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #00f2fe);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Video Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

.video-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.video-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    background: #000;
    display: block;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.88) 100%);
    font-size: 11px;
}

.video-prompt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-weight: 500;
}

/* Mobile Bottom Navigation (Centered 480px) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(14, 16, 24, 0.98);
    backdrop-filter: saturate(190%) blur(24px);
    -webkit-backdrop-filter: saturate(190%) blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: var(--min-tap-target);
    min-height: var(--min-tap-target);
    gap: 3px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

/* Modal Popup */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-sheet {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.8), var(--specular-top);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Auth Segmented Control (Apple HIG) */
.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.auth-tab-btn.active {
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Bottom nav desktop styles now in mobile responsiveness section below */


/* =========================================================================
   AUTH MODAL & SESSION STYLES
   ========================================================================= */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
}

.auth-tab-btn {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.auth-tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.auth-notice {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 14px;
    text-align: center;
}

.btn-header-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    transition: transform 0.15s;
}

.btn-header-upgrade:hover {
    transform: translateY(-1px);
}

.btn-header-auth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.35);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-header-auth:hover {
    background: var(--primary);
    color: white;
}

/* =========================================================================
   FORM CO (CHECKOUT) STYLES
   ========================================================================= */
.co-plan-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.co-plan-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.co-plan-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.co-plan-card.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.co-plan-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.co-plan-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-cyan);
}

.co-plan-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    background: #f59e0b;
    color: #1e1b4b;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.payment-method-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.payment-method-item.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.qris-preview-box {
    background: white;
    padding: 14px;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qris-img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    margin-bottom: 8px;
}

.bank-info-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 14px 0;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.bank-row:last-child {
    margin-bottom: 0;
}

.btn-copy-account {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

.btn-copy-account:hover {
    background: var(--primary);
}

.btn-wa-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #10b981;
    color: white;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    margin-top: 14px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-wa-checkout:hover {
    background: #059669;
}

/* =========================================================================
   SUPER ADMIN DASHBOARD STYLES
   ========================================================================= */
.admin-badge-indicator {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #1e1b4b;
    font-weight: 800;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

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

@media (min-width: 640px) {
    .admin-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.admin-stat-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.admin-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.admin-sub-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.admin-sub-tabs::-webkit-scrollbar {
    display: none;
}

.admin-sub-tab-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-sub-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.admin-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.role-badge-user {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.role-badge-admin {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
}

.btn-table-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-table-action:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.connection-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.connection-status-pill.connected {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.connection-status-pill.disconnected {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot.green {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.red {
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
}

/* =========================================================================
   Subscription Gate & Non-Member Modal / Banner
   ========================================================================= */
.sub-required-modal {
    max-width: 440px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(15, 18, 30, 0.96);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 40px rgba(245, 158, 11, 0.15);
}

.sub-required-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(99, 102, 241, 0.22));
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto 16px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
}

.sub-required-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.sub-required-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
    padding: 0 6px;
}

.sub-required-action-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    margin-bottom: 14px;
}

.sub-plan-highlight {
    background: rgba(20, 24, 40, 0.8);
    border: 1.5px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.sub-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.sub-plan-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.sub-plan-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.sub-plan-price .price-val {
    font-size: 19px;
    font-weight: 800;
    color: var(--accent-cyan);
}

.sub-plan-price .price-period {
    font-size: 11px;
    color: var(--text-tertiary);
}

.sub-plan-perks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-plan-perks li {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-subscribe-cta {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 10px;
}

.btn-subscribe-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.6);
}

.btn-sub-later {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sub-later:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sub-warning-banner {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sub-warning-banner .banner-text {
    font-size: 12.5px;
    color: #fef08a;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.sub-warning-banner .btn-banner-upgrade {
    background: #f59e0b;
    color: #0b0f19;
    border: none;
    font-weight: 800;
    font-size: 11.5px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.sub-warning-banner .btn-banner-upgrade:hover {
    background: #fbbf24;
    transform: scale(1.02);
}


/* =========================================================================
   STYLE CHIPS — Quick Mood/Style selector (Video & Image generator)
   ========================================================================= */
.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.style-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s var(--ease-spring);
    user-select: none;
    white-space: nowrap;
}

.style-chip:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
    transform: translateY(-1px);
}

.style-chip:active { transform: scale(0.96); }

.style-chip.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: #e0e7ff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* =========================================================================
   PG MODE TOGGLE (Prompt Generator — Video / Foto)
   ========================================================================= */
.pg-mode-toggle {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    margin-top: 2px;
}

.pg-mode-btn {
    flex: 1;
    padding: 9px 14px;
    border-radius: calc(var(--radius-md) - 4px);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s var(--ease-spring);
}

.pg-mode-btn:hover { color: var(--text-primary); }

.pg-mode-btn.active {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* =========================================================================
   STYLE CARDS GRID — Visual mood picker (Prompt Generator)
   ========================================================================= */
.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

@media (min-width: 480px) {
    .style-grid { grid-template-columns: repeat(4, 1fr); }
}

.style-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    user-select: none;
}

.style-card:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.style-card:active { transform: scale(0.96); }

.style-card.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(99, 102, 241, 0.2);
}

.style-card-icon { font-size: 20px; margin-bottom: 4px; line-height: 1; }

.style-card-name {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.style-card-desc { font-size: 9.5px; color: var(--text-tertiary); line-height: 1.3; }

.style-card.active .style-card-name { color: #c7d2fe; }

/* =========================================================================
   MOBILE RESPONSIVENESS — Comprehensive overhaul
   ========================================================================= */

/* Sub-tabs: icon-only on tiny screens */
@media (max-width: 380px) {
    .sub-tab-btn { font-size: 11px; padding: 7px 6px; gap: 4px; }
    .sub-tab-btn span { display: none; }
    .sub-tab-btn.active span { display: inline; }
}

/* Sub-tabs: slightly compact on mobile */
@media (max-width: 480px) {
    .sub-tabs-bar { gap: 2px; padding: 2px; }
    .sub-tab-btn { font-size: 12px; padding: 8px 6px; min-height: 36px; gap: 4px; }
}

/* Style chips: smaller text on mobile */
@media (max-width: 420px) {
    .style-chip { font-size: 11px; padding: 5px 9px; }
    .style-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .style-card-icon { font-size: 18px; }
    .style-card-name { font-size: 10px; }
    .style-card-desc { display: none; }
}

/* Card padding tighter on small mobile */
@media (max-width: 480px) {
    .card { padding: 15px 13px; border-radius: var(--radius-md); }
    .app-container {
        padding: 14px 12px;
        padding-bottom: calc(var(--bottom-nav-height) + 36px + env(safe-area-inset-bottom, 16px)) !important;
        border-left: none;
        border-right: none;
    }
    .bottom-nav {
        border-left: none;
        border-right: none;
    }
    .card-title { font-size: 15px; }
    .card-title-row { margin-bottom: 12px; }
    .form-select, .form-input, .form-textarea { padding: 10px 12px; font-size: 14px; }
    .btn-generate { min-height: 48px; font-size: 14.5px; margin-bottom: 16px; }
}

/* Header: tighter on very small screens */
@media (max-width: 400px) {
    .header-container { padding: 0 12px; }
    .app-logo-badge { width: 30px; height: 30px; font-size: 16px; }
    .header-title { font-size: 18px; }
    .btn-header-upgrade span { display: none; }
    .user-badge span {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Sub-warning banner: stack on small screens */
@media (max-width: 520px) {
    .sub-warning-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .sub-warning-banner .btn-banner-upgrade { width: 100%; justify-content: center; }
}

/* Prompt result actions: stack on mobile */
.prompt-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .prompt-result-actions { flex-direction: column; }
    .prompt-result-actions .btn-secondary { width: 100%; justify-content: center; }
}

/* PG Mode toggle buttons */
@media (max-width: 380px) {
    .pg-mode-btn { font-size: 12px; padding: 8px 10px; gap: 4px; }
}

/* Admin table horizontal scroll */
@media (max-width: 640px) {
    .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-data-table { min-width: 500px; }
}

/* Modal: bottom sheet on mobile */
@media (max-width: 520px) {
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal-sheet {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-width: 100% !important;
        width: 100%;
        padding: 20px 16px 32px;
        max-height: 92vh;
        overflow-y: auto;
    }
}

/* Switch row compact */
@media (max-width: 480px) {
    .switch-row { padding: 8px 0; }
}

/* Options grid on tiny screens */
@media (max-width: 360px) {
    .options-grid-4 { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .option-btn { padding: 8px 4px; font-size: 11px; }
}

/* Gallery grid on mobile */
@media (max-width: 420px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Subscription modal plan card */
@media (max-width: 480px) {
    .sub-plan-card { padding: 14px; }
    .sub-plan-perks li { font-size: 11.5px; }
    .btn-subscribe-cta { font-size: 13px; padding: 12px 16px; }
}
