/* ===== CSS Reset & Design Tokens ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.3);
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);

    --bg-body: #07070f;
    --bg-sidebar: #0c0c1a;
    --bg-main: #0e0e1c;
    --bg-card: rgba(20, 20, 40, 0.7);
    --bg-card-hover: rgba(30, 30, 55, 0.8);
    --bg-input: rgba(15, 15, 30, 0.8);
    --bg-topbar: rgba(14, 14, 28, 0.85);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #818cf8;

    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(99, 102, 241, 0.5);

    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);

    --sidebar-width: 260px;
    --topbar-height: 72px;
    --mobile-header-height: 60px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

a { color: var(--text-accent); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== App Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    min-width: 0;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-right var(--transition-smooth);
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition-smooth);
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    height: 36px;
    width: auto;
    filter: brightness(1.1);
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    position: relative;
    font-size: 0.92rem;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--glass-hover);
}

.nav-item.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 3px;
}

.nav-icon {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 16px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-credits-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.sidebar-credits-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--glass);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-balance {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.05);
    color: #f87171;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 190;
    transition: opacity var(--transition-smooth);
}

.sidebar-overlay.active {
    display: block;
}

/* ===== Mobile Header ===== */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 150;
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: var(--mobile-header-height);
    align-items: center;
    justify-content: space-between;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--glass-hover);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.hamburger-btn:hover { background: rgba(255,255,255,0.1); }

.mobile-logo {
    height: 30px;
    width: auto;
}

.mobile-credits-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-credits-btn:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* ===== Topbar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 24px;
}

.topbar-right { display: flex; flex-direction: column; gap: 2px; }

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.topbar-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-used {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.topbar-balance-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.topbar-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.topbar-balance {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
}

.topbar-balance-total {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.balance-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.balance-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.balance-progress-fill.warning { background: var(--gradient-warm); }
.balance-progress-fill.critical { background: var(--gradient-danger); }

.topbar-action-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--glass);
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.topbar-action-btn:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 28px 32px;
}

.container {
    max-width: 960px;
    margin: 0 auto;
}

/* ===== Back Button ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.back-btn:hover {
    color: var(--text-primary);
    background: var(--glass-hover);
    border-color: rgba(255,255,255,0.15);
}

.back-btn i { font-size: 0.75rem; }

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-title .icon { font-size: 1.2rem; }

/* ===== Choice Grid (Home Page) ===== */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.choice-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.choice-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.choice-card:hover::before { opacity: 0.06; }

.choice-card > * { position: relative; z-index: 1; }

.choice-icon {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.choice-card h4 {
    font-size: 1rem;
    font-weight: 700;
}

.choice-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Telegram Bot Button */
.telegram-bot-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: var(--radius-lg);
    background: rgba(34, 211, 238, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    text-align: right;
}

.telegram-bot-btn:hover {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.25);
    transform: translateY(-1px);
}

.telegram-icon { font-size: 1.6rem; }
.telegram-text { flex: 1; }
.telegram-text strong { display: block; font-size: 0.9rem; }
.telegram-text small { font-size: 0.78rem; color: var(--text-muted); }
.arrow-icon { color: var(--text-muted); font-size: 1.2rem; }

/* ===== Form Elements ===== */
.form-section {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    font-size: 0.7rem;
}

.label-icon { font-size: 1rem; }

.form-textarea,
.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    transition: all var(--transition-normal);
    resize: vertical;
}

.form-textarea:focus,
.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(20, 20, 40, 0.9);
}

.form-textarea::placeholder,
.form-input::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.field-hint-reg {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ===== Radio Options ===== */
.radio-grid,
.radio-grid-small {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-option {
    position: relative;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--glass);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--primary-light);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.1);
}

.radio-option:hover .radio-label {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.ratio-icon { font-size: 0.9rem; }

.radio-option.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.radio-option.disabled .radio-label {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

.radio-option.disabled:hover .radio-label {
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

.auto-select .radio-label {
    border-color: rgba(34, 211, 238, 0.2);
}

.auto-select input[type="radio"]:checked + .radio-label {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.4);
    color: var(--accent);
}

.res-cost-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    font-weight: 600;
}

/* ===== Model Cards ===== */
.model-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.model-card {
    position: relative;
    cursor: pointer;
}

.model-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.model-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--glass);
    transition: all var(--transition-normal);
    position: relative;
}

.model-card input[type="radio"]:checked ~ .model-card-content {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.model-card:hover .model-card-content {
    border-color: rgba(255,255,255,0.15);
    background: var(--glass-hover);
}

.model-card-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.model-card-icon.premium {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3));
}

.model-card-info { flex: 1; min-width: 0; }

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

.model-card-description {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.model-card-credits { display: flex; gap: 6px; }

.credit-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent);
    font-weight: 600;
}

.credit-badge.premium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.model-card-check {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    transition: all var(--transition-normal);
}

.model-card input[type="radio"]:checked ~ .model-card-content .model-card-check {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: #fff;
}

.pro-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    padding: 2px 10px;
    border-radius: 0 var(--radius-lg) 0 var(--radius-md);
    background: var(--gradient-warm);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-icon { font-size: 1rem; }
.btn-label { font-size: 0.85rem; }

.btn-success {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-success:active { transform: translateY(0); }

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

.btn-secondary {
    background: var(--glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    padding: 10px 20px;
    border-radius: var(--radius-md);
}

.btn-secondary:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

.btn-small { padding: 8px 16px; font-size: 0.82rem; }

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-register-toggle {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-register-toggle:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

.btn-copy-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-copy-small:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.btn-copy-small.copied {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

/* ===== Form Actions ===== */
    .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
    }

/* ===== Image Upload ===== */
.image-upload-container {
    display: flex;
        flex-direction: column;
    gap: 12px;
}

.uploaded-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.uploaded-image-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-light);
}

.uploaded-image-item img {
        width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
        align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.remove-image-btn:hover { background: var(--danger); transform: scale(1.1); }

.btn-upload-image {
        display: flex;
        flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.btn-upload-image:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.04);
    color: var(--text-primary);
}

.upload-icon { font-size: 1.5rem; }
.upload-text { font-size: 0.88rem; font-weight: 600; }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Cost Display ===== */
.cost-display-container {
    margin-top: 20px;
    margin-bottom: 8px;
}

.cost-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.cost-icon { font-size: 1.2rem; }
.cost-text { font-size: 0.88rem; color: var(--text-secondary); }

.cost-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-right: auto;
}

.cost-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== Duration Slider ===== */
.duration-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.duration-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.duration-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.duration-display {
    min-width: 70px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.9rem;
        text-align: center;
    }

/* ===== Video Model Tabs ===== */
.model-tabs-container {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    border-radius: var(--radius-lg);
    background: var(--glass);
    border: 1px solid var(--border);
}

.model-tab {
    flex: 1;
    display: flex;
    align-items: center;
        justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.model-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.tab-icon { font-size: 1.1rem; }

/* ===== Style Grid (Transform) ===== */
.style-group {
    margin-bottom: 20px;
}

.style-group-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.style-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.style-option {
    position: relative;
    cursor: pointer;
}

.style-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.style-label {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--glass);
    color: var(--text-secondary);
        font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.style-option input[type="radio"]:checked + .style-label {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--primary-light);
}

.style-option:hover .style-label {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

/* ===== Generated Results ===== */
.generated-image-container,
.generated-video-container {
    margin: 20px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: rgba(0,0,0,0.3);
}

.generated-image {
    width: 100%;
    height: auto;
    display: block;
}

.generated-video {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
}

.output-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.output-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.image-info { margin-top: 12px; }

.image-info p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.prompt-display-box {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.7;
    word-break: break-word;
}

.image-url-display {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 0.78rem;
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.spacer-sm { height: 12px; }

/* ===== Output Section (Prompt Enhancement) ===== */
.output-section {
    margin-top: 24px;
}

.prompt-language-section {
    margin-bottom: 20px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--glass);
    border: 1px solid var(--border);
}

.language-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.language-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.flag { font-size: 1.1rem; }

.generated-prompt {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    line-height: 1.8;
        font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.arabic-prompt {
    direction: rtl;
    text-align: right;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-body);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 30px;
    backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    height: 60px;
    width: auto;
    margin-bottom: 12px;
    filter: brightness(1.05);
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group .icon { font-size: 0.95rem; }

.form-group input {
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all var(--transition-normal);
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder { color: var(--text-muted); }

.login-error {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 0.85rem;
    margin-top: 12px;
}

.btn-forgot-password {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color var(--transition-normal);
    margin-top: 8px;
}

.btn-forgot-password:hover { color: var(--primary-light); }

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-back-login {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    margin-top: 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color var(--transition-normal);
}

.btn-back-login:hover { color: var(--primary-light); }

.login-support {
    text-align: center;
    margin-top: 24px;
}

.login-support p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
}

/* OTP Styles */
.otp-info {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    text-align: center;
    margin-bottom: 16px;
}

.otp-info-icon { font-size: 2rem; display: block; margin-bottom: 8px; }

.otp-info p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.otp-phone {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-light);
    direction: ltr;
}

.otp-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--success);
}

.timer-icon { font-size: 0.95rem; }

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.modal-close:hover { background: rgba(255, 255, 255, 0.25); }

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

/* Video Confirm Modal */
.video-confirm-modal-simple {
    max-width: 400px;
}

.confirm-summary { margin: 8px 0; }

.confirm-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.confirm-highlight {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.confirm-balance {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(7, 7, 15, 0.9);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== History Section ===== */
.history-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    margin-bottom: 20px;
}

.warning-icon { font-size: 1.3rem; flex-shrink: 0; padding-top: 2px; }

.warning-content { font-size: 0.85rem; color: var(--text-secondary); }
.warning-content strong { color: var(--warning); display: block; margin-bottom: 4px; }
.warning-content p { margin-bottom: 4px; }
.highlight-text { color: var(--warning); font-weight: 600; }

.history-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.history-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.history-filter-btn.active,
.history-filter-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--glass);
    transition: all var(--transition-normal);
}

.history-item:hover {
    border-color: var(--border-light);
    background: var(--glass-hover);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-item-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-type-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
        font-size: 0.75rem;
    font-weight: 600;
}

.history-type-badge.image { background: rgba(99, 102, 241, 0.1); color: var(--primary-light); }
.history-type-badge.video { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.history-type-badge.transform { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.history-model-name { font-size: 0.75rem; color: var(--text-muted); }
.history-item-date { font-size: 0.75rem; color: var(--text-muted); }

.history-item-body {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.history-item-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item-preview img,
.history-item-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-preview { font-size: 1.5rem; }

.history-item-details { flex: 1; min-width: 0; }

.history-prompt {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.history-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.history-setting-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--glass-hover);
    color: var(--text-muted);
}

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.history-credit-cost {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-light);
}

.history-item-actions {
    display: flex;
    gap: 6px;
}

.history-action-btn {
    padding: 5px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-action-btn:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.history-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.history-empty h4 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.history-empty p { font-size: 0.85rem; }

.history-actions {
    margin-top: 16px;
    text-align: center;
}

/* ===== Payment Modal Styles ===== */
.pricing-box {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 24px;
}

.pricing-box h3 { font-size: 1rem; margin-bottom: 8px; color: var(--text-primary); }

.pricing-rate {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.pricing-rate strong { color: var(--primary-light); }

.payment-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--glass);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.payment-method-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.payment-btn-logo { height: 36px; width: auto; object-fit: contain; }

.payment-btn-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.payment-method-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-details { margin-bottom: 8px; }

.payment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-icon-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px;
    transition: color var(--transition-fast);
}

.copy-icon-btn:hover { color: var(--primary-light); }
.copy-icon-btn.copied { color: var(--success); }

.qr-code-container {
    text-align: center;
    margin-top: 12px;
}

.qr-code {
    max-width: 200px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
}

.qr-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.receipt-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.receipt-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
}

.btn-upload-receipt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    background: var(--glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-upload-receipt:hover {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

.whatsapp-optin-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(37, 211, 102, 0.04);
    border: 1px solid rgba(37, 211, 102, 0.1);
    cursor: pointer;
}

.whatsapp-checkbox { display: none; }

.checkbox-custom {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all var(--transition-normal);
}

.whatsapp-checkbox:checked + .checkbox-custom {
    background: #25d366;
    border-color: #25d366;
}

.whatsapp-checkbox:checked + .checkbox-custom::after {
    content: '✓';
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.checkbox-text strong { display: block; font-size: 0.85rem; color: var(--text-primary); }
.checkbox-text small { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
}

.footer-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-compact a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-compact a:hover { color: var(--primary-light); }
.footer-sep { opacity: 0.3; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .topbar-user-info { display: none; }
    .topbar-balance-section { min-width: 130px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-right: 0;
    }

    .mobile-header {
    display: flex;
    }

    .topbar {
        display: none;
    }

    .main-content {
        padding: 20px 16px;
    }

    .choice-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .choice-card {
        padding: 20px 14px;
    }

    .choice-icon { font-size: 2rem; }
    .choice-card h4 { font-size: 0.9rem; }
    .choice-card p { font-size: 0.75rem; }

    .model-cards-grid {
        grid-template-columns: 1fr;
    }

    .model-tabs-container {
    flex-direction: column;
    }

    .card {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }

    .payment-methods-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .image-actions {
        flex-direction: column;
    }

    .image-actions .btn {
        width: 100%;
    }

    .topbar-left { display: none; }
}

@media (max-width: 480px) {
    .choice-grid {
        grid-template-columns: 1fr;
    }

    .radio-grid,
    .radio-grid-small {
        gap: 6px;
    }

    .radio-label {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .section-title { font-size: 1rem; }

    .btn-success { padding: 12px 24px; font-size: 0.9rem; }

    .payment-methods-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.4s ease;
}

/* ===== Utility ===== */
.btn-icon-mobile { display: none; }

/* Model section visibility */
.model-section { display: none; }
.model-section.active { display: block; }

/* Grok Mode Tabs */
.grok-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.grok-mode-tab,
.veo-mode-tab,
.kling-mode-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    text-align: center;
}

.grok-mode-tab i,
.veo-mode-tab i,
.kling-mode-tab i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.grok-mode-tab span,
.veo-mode-tab span,
.kling-mode-tab span {
    font-size: 0.85rem;
    font-weight: 600;
}

.grok-mode-tab small,
.veo-mode-tab small,
.kling-mode-tab small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.grok-mode-tab:hover,
.veo-mode-tab:hover,
.kling-mode-tab:hover {
    border-color: rgba(255,255,255,0.15);
    background: var(--glass-hover);
    color: var(--text-primary);
}

.grok-mode-tab.active,
.veo-mode-tab.active,
.kling-mode-tab.active {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.grok-mode-tab.active small,
.veo-mode-tab.active small,
.kling-mode-tab.active small {
    color: var(--primary-light);
    opacity: 0.7;
}

/* Quality Help Button & Popup */
.quality-help-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.quality-help-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--primary-light);
    transform: scale(1.1);
}

.quality-help-popup {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.quality-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.quality-help-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.quality-help-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Extend Video Card */
.extend-video-card {
    background: var(--glass);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    animation: fadeIn 0.3s ease;
}

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

.extend-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.extend-frame-preview {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extend-frame-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.extend-frame-preview .extracting-msg {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 16px;
}

.extend-upload-video-preview video {
    display: block;
}

.quality-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    line-height: 1.4;
}

.quality-comparison-table th {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    padding: 8px 10px;
    text-align: right;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quality-comparison-table th:first-child {
    border-radius: 0 8px 0 0;
}

.quality-comparison-table th:last-child {
    border-radius: 8px 0 0 0;
}

.quality-comparison-table td {
    padding: 7px 10px;
    text-align: right;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
}

.quality-comparison-table tr:last-child td {
    border-bottom: none;
}

.quality-comparison-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.quality-comparison-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.quality-comparison-table .highlight-good {
    color: #2ecc71;
    font-weight: 600;
}

@media (max-width: 480px) {
    .grok-mode-tabs { grid-template-columns: 1fr; }
}

/* Hide intro-card if somehow still present */
.intro-card { display: none; }

/* ===== Prompt Generator Styles ===== */
.pg-mode-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 20px; border-radius: 18px; width: 100%;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: var(--bg-card); cursor: pointer; font-family: inherit;
    transition: all 0.25s;
}
.pg-mode-card:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}
.pg-mode-icon {
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(99,102,241,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--primary-light); flex-shrink: 0;
}
.pg-credit-note {
    text-align: center; font-size: 13px; color: var(--text-secondary);
    background: var(--bg-card); border-radius: 12px;
    padding: 12px 18px; border: 1px solid rgba(255,255,255,0.06);
}
.pg-credit-note i { color: var(--warning); margin-left: 6px; }
.pg-back-btn {
    background: none; border: none; color: var(--primary-light);
    font-size: 13px; font-weight: 700; cursor: pointer;
    margin-bottom: 14px; padding: 0; font-family: inherit;
}
.pg-back-btn:hover { color: var(--primary); }
.pg-section-title {
    font-size: 22px; font-weight: 900; color: var(--primary-light);
    text-align: center; margin: 0 0 4px;
}
.pg-section-sub {
    color: var(--text-secondary); font-size: 14px;
    text-align: center; margin-bottom: 28px;
}
.pg-upload-zone {
    border: 2px dashed rgba(255,255,255,0.12); border-radius: 20px;
    padding: 48px 20px; text-align: center; cursor: pointer;
    background: rgba(255,255,255,0.02); transition: all 0.3s;
    margin-bottom: 28px;
}
.pg-upload-zone:hover, .pg-upload-zone.drag-over {
    border-color: var(--primary-light);
    background: rgba(99,102,241,0.06);
}
.pg-upload-zone-sm { padding: 28px 20px; margin-bottom: 20px; }
.pg-remove-btn {
    position: absolute; top: 10px; left: 10px;
    background: rgba(0,0,0,0.7); color: #fff;
    border: none; border-radius: 10px;
    padding: 6px 14px; font-size: 12px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    backdrop-filter: blur(8px);
}
.pg-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 32px 0 20px;
}
.pg-divider::before, .pg-divider::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,0.08);
}
.pg-divider span {
    font-size: 13px; font-weight: 800;
    color: var(--primary-light); white-space: nowrap;
}
.pg-field { margin-bottom: 22px; }
.pg-label {
    display: block; font-weight: 700; font-size: 14px;
    color: var(--text-primary); margin-bottom: 8px;
}
.pg-hint {
    font-size: 12px; color: var(--text-secondary);
    margin-bottom: 8px; line-height: 1.5;
}
.pg-input {
    width: 100%; padding: 12px 16px; border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: var(--bg-input); color: var(--text-primary);
    font-size: 14px; font-family: inherit; direction: rtl;
    outline: none; resize: vertical;
    transition: border 0.2s; box-sizing: border-box;
}
.pg-input:focus { border-color: var(--primary-light); }
textarea.pg-input { resize: vertical; }
input.pg-input { resize: none; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-chip {
    padding: 9px 18px; border-radius: 100px; font-size: 13px;
    font-weight: 500; cursor: pointer; font-family: inherit;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04); color: var(--text-secondary);
    transition: all 0.2s;
}
.pg-chip:hover { border-color: rgba(255,255,255,0.2); }
.pg-chip.active {
    border-color: var(--primary-light);
    background: rgba(99,102,241,0.15);
    color: var(--primary-light); font-weight: 700;
}
.pg-chips-wrap { flex-wrap: wrap; margin-bottom: 8px; }
.pg-output-chip {
    padding: 10px 18px; border-radius: 14px; font-size: 13px;
    font-weight: 700; cursor: pointer; font-family: inherit;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03); color: var(--text-secondary);
    transition: all 0.2s;
}
.pg-output-chip:hover { border-color: rgba(255,255,255,0.15); }
.pg-output-chip.active {
    border-color: var(--primary-light);
    background: rgba(99,102,241,0.12);
    color: var(--primary-light);
}
.pg-roles-list { display: flex; flex-direction: column; gap: 8px; }
.pg-role-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-radius: 14px; width: 100%;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    cursor: pointer; text-align: right; font-family: inherit;
    transition: all 0.2s;
}
.pg-role-card:hover { border-color: rgba(255,255,255,0.15); }
.pg-role-card.active {
    border-color: var(--primary-light);
    background: rgba(99,102,241,0.1);
}
.pg-role-check {
    width: 20px; height: 20px; border-radius: 6px; margin-top: 2px;
    flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; font-size: 11px;
    border: 2px solid rgba(255,255,255,0.15);
    background: transparent; color: transparent;
    transition: all 0.2s;
}
.pg-role-card.active .pg-role-check {
    border-color: var(--primary-light);
    background: var(--primary-light);
    color: #0D0F14;
}
.pg-role-name {
    font-weight: 700; font-size: 14px;
    color: var(--text-primary); margin-bottom: 3px;
}
.pg-role-card.active .pg-role-name { color: var(--primary-light); }
.pg-role-desc {
    font-size: 12px; color: var(--text-secondary); line-height: 1.5;
}
.pg-gold-btn {
    background: var(--gradient-primary);
    color: #fff; border: none; border-radius: 14px;
    padding: 15px 28px; font-size: 15px; font-weight: 800;
    cursor: pointer; font-family: inherit; width: 100%;
    transition: all 0.2s; margin-top: 8px;
}
.pg-gold-btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.pg-gold-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-gold-btn.copied { background: var(--gradient-success) !important; }
.pg-ghost-btn {
    background: var(--bg-card); border: 1.5px solid rgba(255,255,255,0.1);
    color: var(--text-secondary); border-radius: 12px;
    padding: 11px 18px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.pg-ghost-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.pg-spinner {
    width: 44px; height: 44px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: pg-spin 0.7s linear infinite;
}
@keyframes pg-spin { to { transform: rotate(360deg); } }
.pg-prompt-block {
    background: var(--bg-card);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 16px; margin-bottom: 16px;
    overflow: hidden;
}
.pg-prompt-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    background: rgba(99,102,241,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pg-prompt-lang {
    font-size: 14px; font-weight: 700;
    color: var(--primary-light);
}
.pg-prompt-lang i { margin-left: 6px; }
.pg-copy-btn {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-secondary); border-radius: 8px;
    padding: 6px 14px; font-size: 12px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.pg-copy-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.pg-copy-btn.copied {
    background: rgba(16,185,129,0.15) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
}
.pg-result-text {
    white-space: pre-wrap; word-break: break-word;
    margin: 0; padding: 18px;
    font-size: 14px; line-height: 1.9;
    color: var(--text-primary);
    font-family: inherit;
}
.pg-help-toggle {
    background: none; border: none; color: var(--primary-light);
    font-size: 16px; cursor: pointer; padding: 0 4px;
    opacity: 0.7; transition: opacity 0.2s;
}
.pg-help-toggle:hover { opacity: 1; }
.pg-help-box {
    background: var(--bg-card); border: 1px solid rgba(99,102,241,0.2);
    border-radius: 14px; padding: 16px 18px; margin-bottom: 20px;
}
.pg-help-item {
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.7; padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pg-help-item:last-child { border-bottom: none; }
.pg-help-item strong { color: var(--primary-light); }
@media (max-width: 480px) {
    .pg-mode-card { padding: 16px 14px; }
    .pg-mode-icon { width: 40px; height: 40px; font-size: 18px; }
}
