/* LORA AI Mini App - Neon Cyber Studio Theme */

:root {
    /* Core palette */
    --bg-deep: #05050a;
    --bg-base: #0a0a12;
    --bg-elevated: #12121f;
    --bg-card: rgba(18, 18, 31, 0.7);

    /* Neon accents */
    --neon-cyan: #00f5ff;
    --neon-magenta: #ff00ff;
    --neon-purple: #8b5cf6;
    --neon-blue: #3b82f6;
    --neon-green: #00ff88;
    --neon-orange: #ff6b35;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
    --gradient-card: linear-gradient(145deg, rgba(139, 92, 246, 0.15) 0%, rgba(0, 245, 255, 0.08) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Effects */
    --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.5);
    --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5);
    --glow-purple: 0 0 30px rgba(139, 92, 246, 0.4);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Animated Background */
.bg-mesh {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 245, 255, 0.1), transparent),
        var(--bg-deep);
    z-index: -3;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
}

.bg-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: floatGlow 8s ease-in-out infinite;
}

.bg-glow-1 {
    background: var(--neon-purple);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.bg-glow-2 {
    background: var(--neon-cyan);
    bottom: 20%;
    left: -100px;
    animation-delay: -4s;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.1); }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px;
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-family: 'Exo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-ai {
    font-weight: 800;
}

.balance-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}

.balance-chip-glow {
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.balance-chip:hover .balance-chip-glow {
    opacity: 0.1;
}

.balance-chip-icon {
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding: 16px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Staggered entrance animation */
.main-content > section {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--delay) * 0.1s);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Card */
.hero-card {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 24px;
    overflow: hidden;
}

.hero-card-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0.9;
}

.hero-card-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0,0,0,0.3) 0%, transparent 50%);
}

.hero-card-content {
    position: relative;
    z-index: 1;
}

.hero-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.avatar-ring {
    padding: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
}

.avatar {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.avatar-emoji {
    font-size: 28px;
}

.hero-info {
    flex: 1;
}

.hero-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
}

.balance-showcase {
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.balance-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.balance-number {
    font-family: 'Exo 2', sans-serif;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 40px rgba(255,255,255,0.3);
}

.balance-unit {
    font-size: 16px;
    opacity: 0.8;
}

.balance-held {
    margin-top: 12px;
    font-size: 13px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cta-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    backdrop-filter: blur(10px);
}

.cta-button:active {
    transform: scale(0.97);
    background: rgba(255,255,255,0.25);
}

.cta-arrow {
    transition: transform 0.3s;
}

.cta-button:hover .cta-arrow {
    transform: translateX(4px);
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    padding: 20px;
}

/* Section Label */
.section-label {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

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

.section-header .section-label {
    margin-bottom: 0;
}

.see-all-btn {
    background: none;
    border: none;
    color: var(--neon-cyan);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.3s;
}

.see-all-btn:hover {
    gap: 8px;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
}

.action-card:active {
    transform: scale(0.95);
}

.action-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
}

.action-icon-wrap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-card);
    border-radius: var(--radius-md);
}

.action-icon {
    font-size: 22px;
}

.action-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.action-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: -4px;
}

/* Stats */
.stats-row {
    display: flex;
    align-items: center;
}

.stat-block {
    flex: 1;
    text-align: center;
    padding: 8px;
}

.stat-number {
    display: block;
    font-family: 'Exo 2', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-name {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.1);
}

/* History Gallery */
.history-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.history-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gradient-card);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring);
}

.history-thumb:active {
    transform: scale(0.95);
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(0, 245, 255, 0.2));
}

.history-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.loader {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Models Scroll */
.models-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.models-scroll::-webkit-scrollbar {
    display: none;
}

.model-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
}

.model-chip:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.4);
}

.model-icon {
    font-size: 16px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.nav-bg {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.nav-btn {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-btn:active {
    transform: scale(0.9);
}

.nav-icon-wrap {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    transition: all 0.3s;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

.nav-btn.active .nav-icon {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px var(--neon-cyan));
}

.nav-btn.active .nav-label {
    color: var(--neon-cyan);
}

/* Pages */
.page {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg-deep);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out-expo);
}

.page:not(.hidden) {
    transform: translateX(0);
}

.page.hidden {
    pointer-events: none;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:active {
    background: rgba(255,255,255,0.1);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.page-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.page-content {
    padding: 16px;
    padding-bottom: 100px;
}

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

.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gradient-card);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring);
}

.gallery-item:active {
    transform: scale(0.97);
}

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

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.gallery-item-type {
    font-size: 12px;
    font-weight: 500;
    color: var(--neon-cyan);
}

.gallery-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Models List */
.models-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
}

.model-card:active {
    transform: scale(0.98);
}

.model-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.model-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    font-size: 24px;
}

.model-card-info {
    flex: 1;
}

.model-card-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.model-card-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.model-card-price {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-cyan);
}

/* Packages Grid */
.packages-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.package-card {
    padding: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s;
}

.package-card:active {
    transform: scale(0.98);
}

.package-card.featured {
    background: var(--gradient-primary);
    border: none;
}

.package-card.featured .package-label {
    background: rgba(255,255,255,0.2);
}

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

.package-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.package-label {
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.package-tokens {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.package-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.package-price {
    font-family: 'Exo 2', sans-serif;
    font-size: 24px;
    font-weight: 800;
}

.package-btn {
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* Safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* History Items (for recent history) */
.history-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gradient-card);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring);
}

.history-item:active {
    transform: scale(0.95);
}

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

.history-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.history-item-type {
    font-size: 14px;
}

.history-item-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(0, 245, 255, 0.1));
}

.history-item-icon {
    font-size: 24px;
}

.history-item-model {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 0 4px;
}

/* Empty States */
.history-empty,
.gallery-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

.gallery-empty p {
    font-size: 14px;
    margin-bottom: 16px;
}

.gallery-empty.error {
    color: var(--neon-orange);
}

/* Gallery Item Extended */
.gallery-item.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(0, 245, 255, 0.1));
}

.gallery-icon {
    font-size: 32px;
}

.gallery-type {
    font-size: 12px;
    font-weight: 500;
    color: var(--neon-cyan);
    display: block;
    margin-bottom: 2px;
}

.gallery-date {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.gallery-tokens {
    font-size: 10px;
    color: var(--neon-magenta);
    display: block;
    margin-top: 2px;
}

/* Model Card Price Extended */
.model-card-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.model-card-price .price-value {
    font-family: 'Exo 2', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--neon-cyan);
}

.model-card-price .price-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
}

/* Package Card Extended */
.package-card {
    position: relative;
    overflow: visible;
}

.package-card.popular {
    border-color: var(--neon-purple);
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), var(--bg-card));
}

.package-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    padding: 4px 12px;
    background: var(--gradient-primary);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.package-discount {
    position: absolute;
    top: -10px;
    left: 16px;
    padding: 4px 10px;
    background: var(--neon-green);
    color: var(--bg-deep);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.package-tokens {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.package-amount {
    font-family: 'Exo 2', sans-serif;
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.package-tokens .package-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.package-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.package-price .price-currency {
    font-size: 18px;
    color: var(--text-secondary);
}

.package-price .price-value {
    font-family: 'Exo 2', sans-serif;
    font-size: 28px;
    font-weight: 800;
}

.package-bonus {
    text-align: center;
    font-size: 12px;
    color: var(--neon-green);
    font-weight: 600;
}

.package-name {
    text-align: center;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.package-desc {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Avatar Image */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Premium Badge */
.hero-badge.premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.hero-badge.premium .badge-dot {
    background: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.filter-btn:not(.active):hover {
    border-color: var(--neon-purple);
    color: var(--text-primary);
}

/* Load More Button */
.load-more-btn {
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-content {
    max-width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-info {
    margin-top: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.lightbox-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.lightbox-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.lightbox-btn:hover {
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
}

/* Models Page Header */
.models-header {
    padding: 0 16px 16px;
}

.models-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.models-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* Enhanced Model Card */
.model-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.model-card:hover::before {
    opacity: 1;
}

.model-card:active {
    transform: scale(0.98);
}

.model-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
}

.model-card-use {
    padding: 8px 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.model-card-use:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-cyan);
}

/* Packages Page */
.packages-header {
    padding: 0 16px 16px;
}

.current-balance-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    background: var(--gradient-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
}

.balance-label-sm {
    font-size: 13px;
    color: var(--text-muted);
}

.balance-value-lg {
    font-family: 'Exo 2', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.balance-unit-sm {
    font-size: 13px;
    color: var(--text-muted);
}

.packages-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 20px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-lg);
}

/* Enhanced Package Card */
.package-card {
    padding: 24px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
}

.package-card:hover {
    border-color: var(--neon-cyan);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 245, 255, 0.1);
}

.package-card:active {
    transform: translateY(-2px);
}

.package-buy-btn {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.package-buy-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--glow-cyan);
}

/* === REFERRAL PAGE === */

.referral-hero {
    text-align: center;
    padding: 32px 20px;
    margin-bottom: 16px;
}

.referral-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.referral-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.referral-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

.referral-stat-card {
    text-align: center;
    padding: 20px 16px;
}

.referral-stat-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.referral-stat-number {
    font-family: 'Exo 2', sans-serif;
    font-size: 32px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.referral-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.referral-link-section {
    margin-bottom: 16px;
}

.referral-link-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.referral-link-box {
    display: flex;
    gap: 8px;
}

.referral-link-input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: monospace;
    outline: none;
    cursor: pointer;
}

.referral-link-input:focus {
    border-color: var(--neon-cyan);
}

.referral-copy-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s;
}

.referral-copy-btn:active {
    transform: scale(0.95);
}

.referral-copy-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.referral-link-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

.referral-share-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.share-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #00a0e9 100%);
    color: white;
}

.share-telegram:hover {
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
}

.share-copy {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.share-copy:hover {
    border-color: var(--neon-cyan);
}

.share-icon {
    font-size: 18px;
}

.referral-how {
    margin-top: 20px;
}

.referral-how-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.referral-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.referral-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Clickable stat block */
.stat-clickable {
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    border-radius: var(--radius-md);
    margin: -8px;
    padding: 16px 8px;
}

.stat-clickable:hover {
    background: rgba(255,255,255,0.05);
}

.stat-clickable:active {
    background: rgba(255,255,255,0.08);
}

.stat-arrow {
    font-size: 12px;
    color: var(--neon-cyan);
    margin-top: 4px;
    display: block;
    transition: transform 0.2s;
}

.stat-clickable:hover .stat-arrow {
    transform: translateX(4px);
}

/* === AI MODELS === */

/* Featured Action Card */
.action-card-featured {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.25), rgba(0, 245, 255, 0.15));
    border-color: rgba(139, 92, 246, 0.4);
}

.action-icon-glow {
    background: var(--gradient-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* AI Search */
.ai-search-section {
    padding: 0 16px 12px;
}

.ai-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}

.ai-search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ai-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.ai-search-input::placeholder {
    color: var(--text-muted);
}

.ai-search-clear {
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-search-clear svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.ai-search-clear.hidden {
    display: none;
}

/* AI Categories */
.ai-category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ai-category-scroll::-webkit-scrollbar {
    display: none;
}

.ai-category-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-category-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.ai-category-btn:not(.active):hover {
    border-color: var(--neon-purple);
}

/* AI Models Grid */
.ai-models-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ai-model-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-model-card:active {
    transform: scale(0.97);
}

.ai-model-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.ai-card-thumb {
    aspect-ratio: 1;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-card-icon {
    font-size: 40px;
    opacity: 0.5;
}

.ai-card-content {
    padding: 12px;
}

.ai-card-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-card-category {
    font-size: 11px;
    color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* AI Generate Page */
.ai-model-info {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.ai-model-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background: var(--gradient-card);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-model-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-thumb-icon {
    font-size: 32px;
    opacity: 0.5;
}

.ai-model-details {
    flex: 1;
    min-width: 0;
}

.ai-model-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-model-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-model-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    color: var(--neon-cyan);
}

.price-icon {
    font-size: 14px;
}

/* AI Form */
.ai-form-section {
    margin-bottom: 100px;
}

.ai-form-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

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

.ai-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.ai-required {
    color: var(--neon-magenta);
    margin-left: 2px;
}

.ai-form-input,
.ai-form-textarea,
.ai-form-select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-form-input:focus,
.ai-form-textarea:focus,
.ai-form-select:focus {
    border-color: var(--neon-cyan);
}

.ai-form-input::placeholder,
.ai-form-textarea::placeholder {
    color: var(--text-muted);
}

.ai-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.ai-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

/* Toggle Switch */
.ai-form-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.ai-form-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ai-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 28px;
    transition: 0.3s;
}

.ai-toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.ai-form-toggle input:checked + .ai-toggle-slider {
    background: var(--gradient-primary);
}

.ai-form-toggle input:checked + .ai-toggle-slider::before {
    transform: translateX(24px);
}

/* Advanced Parameters */
.ai-form-advanced {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ai-form-advanced summary {
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-form-advanced summary::-webkit-details-marker {
    display: none;
}

.ai-form-advanced summary::before {
    content: '▸';
    transition: transform 0.2s;
}

.ai-form-advanced[open] summary::before {
    transform: rotate(90deg);
}

.ai-form-advanced-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Generate Button */
.ai-generate-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    padding-bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    transition: opacity 0.2s;
}

.ai-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-generate-icon {
    font-size: 18px;
}

.ai-generate-cost {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    background: rgba(0,0,0,0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
}

/* AI Status Page */
.ai-status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.ai-status-card {
    text-align: center;
    padding: 40px 20px;
}

.ai-status-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

.ai-pulse-ring.delay-1 {
    animation-delay: 0.6s;
}

.ai-pulse-ring.delay-2 {
    animation-delay: 1.2s;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ai-status-animation.error .ai-pulse-ring {
    border-color: var(--neon-orange);
}

.ai-status-icon {
    font-size: 48px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ai-status-animation.error .ai-status-icon {
    animation: none;
}

.ai-status-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-status-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.ai-progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

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

/* AI Result */
.ai-result {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.ai-result img {
    width: 100%;
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.ai-result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-result-actions .lightbox-btn {
    width: 100%;
    justify-content: center;
}

.ai-result-actions .cta-button {
    background: var(--gradient-primary);
    border: none;
}

/* === TRENDING PHOTOS === */

.trending-section {
    margin-top: 8px;
}

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

.trending-section .section-label {
    margin-bottom: 0;
}

.section-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Trends Type Toggle (Фото/Видео) */
.trends-type-toggle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    background: linear-gradient(145deg, rgba(0, 245, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(0, 245, 255, 0.3);
}

.trends-type-btn {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.trends-type-btn.active {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-purple) 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.trends-type-btn:not(.active):hover {
    background: rgba(0, 245, 255, 0.1);
    color: var(--text-primary);
}

.gender-toggle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.15) 0%, rgba(0, 245, 255, 0.08) 100%);
    padding: 8px;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.gender-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@media (max-width: 400px) {
    .gender-toggle {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }
}

.gender-toggle-btn {
    padding: 12px 6px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: rgba(20, 20, 35, 0.6);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

@media (max-width: 400px) {
    .gender-toggle-btn {
        padding: 16px 12px;
        font-size: 15px;
        min-height: 52px;
    }
}

.gender-toggle-btn:active {
    transform: scale(0.96);
}

.gender-toggle-btn.active {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-purple) 50%, var(--neon-magenta) 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: #fff;
    border-color: rgba(0, 245, 255, 0.5);
    box-shadow:
        0 0 30px rgba(0, 245, 255, 0.4),
        0 0 60px rgba(139, 92, 246, 0.3),
        0 4px 20px rgba(255, 0, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    font-weight: 800;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.gender-toggle-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -100% -100%; }
    100% { background-position: 100% 100%; }
}

.gender-toggle-btn:not(.active):hover {
    background: rgba(139, 92, 246, 0.25);
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
}

/* Tags Scroll */
.tags-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 16px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tags-scroll::-webkit-scrollbar {
    display: none;
}

.tag-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    background: rgba(20, 20, 35, 0.8);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.tag-chip:active {
    transform: scale(0.95);
}

.tag-chip.active {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-purple) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 245, 255, 0.3);
}

.tag-chip:not(.active):hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: var(--text-primary);
}

/* Tag Select Dropdown */
.tag-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    background: rgba(20, 20, 35, 0.9);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%238b5cf6" d="M1.41 0L6 4.59L10.59 0L12 1.41l-6 6l-6-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.tag-select:hover {
    background-color: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
}

.tag-select:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.tag-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px;
}

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

.trending-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring);
}

.trending-card:active {
    transform: scale(0.97);
}

.trending-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trending-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.trending-model {
    font-size: 10px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.trending-price {
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.trending-loading,
.trending-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    text-align: center;
}

/* === SELFIE MODAL === */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

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

.modal-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-right: 40px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Trending Preview in Modal */
.trending-preview {
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.trending-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.trending-preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Selfie Upload Area */
.selfie-upload-area {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255,255,255,0.02);
}

.selfie-upload-area:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.05);
}

.selfie-upload-area.dragover {
    border-color: var(--neon-magenta);
    background: rgba(255, 0, 255, 0.1);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Selfie Preview */
.selfie-preview {
    margin-top: 20px;
    text-align: center;
}

.selfie-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 3px solid var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.selfie-preview-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Generate Button in Modal */
.modal-generate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    margin-top: 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-generate-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
}

.generate-cost {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    background: rgba(0,0,0,0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
}

/* Modal Status */
.modal-status {
    text-align: center;
    padding: 40px 20px;
}

.modal-status .loader {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.modal-status-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Modal Result */
.modal-result {
    text-align: center;
}

.modal-result img {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.result-close-btn {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Upload Placeholder */
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Change Selfie Button */
.change-selfie-btn {
    margin-top: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

/* Generate Button */
.generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Spinner */
.status-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.status-text {
    display: block;
    text-align: center;
    color: var(--text-secondary);
}

/* Result Actions */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 10;
    margin-top: 16px;
}

.result-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.result-btn:first-child {
    background: var(--gradient-primary);
    border: none;
}

/* === Aspect Ratio Selector === */
.aspect-ratio-section {
    margin: 16px 0;
}

.aspect-ratio-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.aspect-ratio-grid {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.aspect-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 56px;
}

.aspect-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.aspect-btn.active {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2);
}

.aspect-btn span {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.aspect-btn.active span {
    color: var(--neon-cyan);
}

/* Aspect ratio shapes */
.aspect-shape {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.aspect-btn.active .aspect-shape {
    background: var(--gradient-primary);
}

.aspect-9-16 {
    width: 18px;
    height: 32px;
}

.aspect-3-4 {
    width: 21px;
    height: 28px;
}

.aspect-1-1 {
    width: 26px;
    height: 26px;
}

.aspect-4-3 {
    width: 28px;
    height: 21px;
}

.aspect-16-9 {
    width: 32px;
    height: 18px;
}

/* === User Input Fields === */
.user-inputs-section {
    margin: 16px 0;
}

.user-input-item {
    margin-bottom: 12px;
}

.user-input-label {
    display: block;
    font-size: 13px;
    color: var(--neon-cyan);
    margin-bottom: 6px;
    font-weight: 500;
}

.user-input-field {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.user-input-field::placeholder {
    color: var(--text-muted);
}

.user-input-field:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.15);
}
