/* Headshot Pro — Premium Dark Theme */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 28, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #e8e8ed;
    --text-secondary: #8b8b9e;
    --text-muted: #55556a;
    --accent-cyan: #00d4ff;
    --accent-purple: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #00d4ff, #8b5cf6);
    --accent-gradient-hover: linear-gradient(135deg, #00e5ff, #9b6ffc);
    --danger: #ff4757;
    --success: #00d68f;
    --warning: #ffaa00;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.08);
    --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background gradient mesh */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: #33ddff; }

/* ---- Typography ---- */
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
section { padding: 80px 0; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px;
    border: none; border-radius: var(--radius-md);
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}
.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}
.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-lg { padding: 18px 42px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- Glass Card ---- */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ---- Navigation ---- */
.nav {
    position: fixed; top: 0; left: 0; right: 0;
    padding: 16px 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition);
}
.nav .container {
    display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
    font-size: 1.3rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); }

/* ---- Hero ---- */
.hero {
    padding: 160px 0 100px;
    text-align: center;
}
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- Steps ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step-card {
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
}
.step-card:hover { transform: translateY(-4px); border-color: rgba(0, 212, 255, 0.15); }
.step-number {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}
.step-card h3 { margin-bottom: 10px; }
.step-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* ---- Pricing ---- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; max-width: 800px; margin: 0 auto; }
.pricing-card { padding: 40px; position: relative; transition: var(--transition); }
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.featured {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-glow);
}
.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    padding: 4px 16px;
    background: var(--accent-gradient);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}
.pricing-tier { font-size: 0.9rem; color: var(--accent-cyan); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.pricing-price { font-size: 3rem; font-weight: 800; margin-bottom: 4px; }
.pricing-price .period { font-size: 1rem; font-weight: 400; color: var(--text-secondary); }
.pricing-desc { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 24px; }
.pricing-features { list-style: none; margin-bottom: 32px; }
.pricing-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex; align-items: center; gap: 10px;
}
.pricing-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* ---- Footer ---- */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-glass);
}

/* ================================================================ */
/* APP PAGE STYLES                                                  */
/* ================================================================ */

.app-page { padding-top: 80px; min-height: 100vh; }

/* Upload Zone */
.upload-section { max-width: 700px; margin: 40px auto; }
.upload-zone {
    padding: 60px 40px;
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-xl);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.03);
}
.upload-zone.dragover { transform: scale(1.01); }
.upload-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.6; }
.upload-zone h3 { margin-bottom: 8px; }
.upload-zone p { color: var(--text-secondary); font-size: 0.9rem; }
.upload-input { display: none; }

/* Thumbnails */
.upload-thumbnails {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-top: 20px; justify-content: center;
}
.thumb {
    width: 80px; height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border-glass);
}
.thumb-remove {
    position: absolute; top: -6px; right: -6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
}
.thumb-wrap { position: relative; display: inline-block; }

/* Style Selection */
.style-section { max-width: 700px; margin: 40px auto; }
.style-section h3 { margin-bottom: 20px; text-align: center; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.style-option {
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.style-option:hover { border-color: rgba(0, 212, 255, 0.2); }
.style-option.selected {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.05);
}
.style-option input { display: none; }
.style-option .style-icon { font-size: 1.8rem; margin-bottom: 8px; }
.style-option .style-name { font-weight: 600; margin-bottom: 4px; }
.style-option .style-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* Generate Button */
.generate-section { text-align: center; margin: 40px 0; }

/* Progress */
.progress-section {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
    display: none;
}
.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-glass);
    border-radius: 100px;
    overflow: hidden;
    margin: 16px 0;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 100px;
    transition: width 0.5s ease;
    width: 0%;
}
.progress-text { color: var(--text-secondary); font-size: 0.9rem; }
.progress-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Gallery */
.gallery-section { margin: 40px 0; }
.gallery-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.gallery-style-group { margin-bottom: 40px; }
.gallery-style-title {
    font-size: 1.2rem; font-weight: 600; margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
}
.gallery-style-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass);
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-glass);
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.gallery-item.locked img { filter: blur(8px); }
.gallery-item .lock-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(10, 10, 15, 0.6);
    opacity: 0; transition: var(--transition);
}
.gallery-item.locked .lock-overlay { opacity: 1; }
.lock-icon { font-size: 1.5rem; margin-bottom: 8px; }
.lock-text { font-size: 0.8rem; color: var(--text-secondary); }
.gallery-item .download-btn {
    position: absolute; bottom: 8px; right: 8px;
    width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    opacity: 0; transition: var(--transition);
}
.gallery-item:hover .download-btn { opacity: 1; }
.gallery-item.locked:hover .download-btn { opacity: 0; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    align-items: center; justify-content: center;
    padding: 40px;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 90vw; max-height: 85vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}
.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: #fff; font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Unlock CTA */
.unlock-cta {
    text-align: center;
    padding: 40px;
    margin: 40px auto;
    max-width: 600px;
}
.unlock-cta h3 { margin-bottom: 8px; }
.unlock-cta p { color: var(--text-secondary); margin-bottom: 24px; }

/* Section title */
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { margin-bottom: 12px; }
.section-title p { color: var(--text-secondary); }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}
.toast.error { border-color: rgba(255, 71, 87, 0.3); }
.toast.success { border-color: rgba(0, 214, 143, 0.3); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .nav-links { gap: 16px; }
    .nav-links a:not(.btn) { display: none; }
    .steps { grid-template-columns: 1fr; gap: 20px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .hero { padding: 120px 0 60px; }
    section { padding: 50px 0; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .upload-zone { padding: 40px 20px; }
    .style-grid { grid-template-columns: repeat(2, 1fr); }
}
