/* ============================================
   ThumbGen - AI Thumbnail Generator
   Dark gradient theme inspired by ThumbLab
   ============================================ */

/* === CSS RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #0a0a1a;
    color: #e2e8f0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === CSS VARIABLES === */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2e;
    --bg-card: rgba(26, 26, 62, 0.6);
    --bg-card-hover: rgba(26, 26, 62, 0.85);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
    --border-color: rgba(139, 92, 246, 0.2);
    --border-glow: rgba(139, 92, 246, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

/* === BACKGROUND GRADIENTS === */
body::before {
    content: '';
    position: fixed;
    top: -40%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.12) 0%, rgba(236, 72, 153, 0.06) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-pink);
}

p {
    line-height: 1.7;
}

/* === GRADIENT TEXT === */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === NAVBAR === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 26, 0.8);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 72px;
}

.navbar-logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

.navbar-logo .gradient-text {
    font-family: var(--font-heading);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition);
    border-radius: 1px;
}

.navbar-links a:hover {
    color: var(--text-primary);
}

.navbar-links a:hover::after {
    width: 100%;
}

.navbar-cta {
    padding: 10px 24px !important;
    background: var(--accent-gradient) !important;
    color: #fff !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
}

.navbar-cta::after {
    display: none !important;
}

.navbar-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Hamburger Button */
.navbar-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 1100;
}

.navbar-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.navbar-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.navbar-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.navbar-mobile {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 100px 32px 32px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.navbar-mobile.open {
    right: 0;
}

.navbar-mobile a {
    display: block;
    color: var(--text-secondary);
    font-size: 17px;
    font-weight: 500;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-mobile a:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.navbar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.navbar-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
    background: var(--bg-card-hover);
}

/* === BUTTONS === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.3);
    color: #fff;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--text-primary);
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--border-glow);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.btn-icon:hover {
    border-color: var(--border-glow);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

/* === SECTIONS === */
.section {
    padding: 100px 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 18px;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* === HERO === */
.hero {
    padding-top: 160px;
    padding-bottom: 100px;
    text-align: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 24px;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 20px;
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 20px;
}

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

.form-input,
.form-select,
.form-textarea,
textarea.form-textarea,
input.form-input {
    width: 100%;
    padding: 14px 18px;
    background: #0d0d2b !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color-scheme: dark;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-purple);
    background: #10103a !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 0 20px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

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

/* === GRID === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

/* === BADGE === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 100px;
    color: var(--accent-purple);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* === DIVIDER === */
.divider {
    width: 100%;
    height: 1px;
    background: var(--border-color);
    margin: 40px 0;
}

/* === FOOTER === */
.site-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(10, 10, 26, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px 48px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
}

.footer-brand .footer-logo {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    display: inline-block;
    text-decoration: none;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    max-width: 320px;
}

.footer-column h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul a {
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

.footer-column ul a:hover {
    color: var(--text-primary);
}

.footer-powered {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 16px;
}

.footer-powered svg {
    width: 18px;
    height: 18px;
    fill: var(--accent-cyan);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
}

.footer-bottom-links a {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-bottom-links a:hover {
    color: var(--text-primary);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
    }
}

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

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(139, 92, 246, 0.08) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-glow);
}

/* === SELECTION === */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
}

/* === UTILITY === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-full { width: 100%; }

/* === LOADING SPINNER === */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

/* === NAVBAR SCROLLED === */
.navbar.scrolled {
    background: rgba(10, 10, 26, 0.95);
    border-bottom-color: var(--border-glow);
}

/* === PROMPT PICKER === */
.prompt-picker {
    width: 100%;
    margin-bottom: 32px;
}

.prompt-picker-label {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: block;
}

.prompt-picker-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.prompt-picker-scroll::-webkit-scrollbar {
    height: 6px;
}

.prompt-picker-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.prompt-picker-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.prompt-card {
    flex: 0 0 auto;
    width: 160px;
    padding: 18px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    scroll-snap-align: start;
    text-align: center;
    user-select: none;
}

.prompt-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.prompt-card.active {
    border-color: var(--card-accent, var(--accent-purple));
    box-shadow: 0 0 20px color-mix(in srgb, var(--card-accent, var(--accent-purple)) 30%, transparent),
                inset 0 0 20px color-mix(in srgb, var(--card-accent, var(--accent-purple)) 8%, transparent);
    background: var(--bg-card-hover);
}

.prompt-card-icon {
    font-size: 28px;
    margin-bottom: 10px;
    line-height: 1;
}

.prompt-card-name {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.prompt-card-ratio {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.12);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-purple);
}

/* === ASPECT RATIO SELECTOR === */
.ratio-selector-wrap {
    margin-bottom: 24px;
}

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

#ratio-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ratio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-family: var(--font-body);
}

.ratio-btn:hover {
    border-color: var(--border-glow);
    color: var(--text-secondary);
}

.ratio-btn.active {
    border-color: var(--accent-purple);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.ratio-preview {
    display: block;
    border: 2px solid currentColor;
    border-radius: 3px;
    transition: var(--transition);
}

.ratio-btn.active .ratio-preview {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.15);
}

.ratio-label {
    font-size: 12px;
    font-weight: 600;
}

/* === GENERATOR AREA === */
.generator-section {
    max-width: 900px;
    margin: 0 auto;
}

.generator-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.prompt-area {
    position: relative;
    margin-bottom: 8px;
}

.prompt-area textarea {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    padding-bottom: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.prompt-area textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.prompt-area textarea::placeholder {
    color: var(--text-muted);
}

.prompt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.char-counter {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.char-counter.over-limit {
    color: #ef4444;
    font-weight: 600;
}

.current-platform {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.generate-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.generate-actions .btn-primary {
    flex: 1;
    min-width: 200px;
}

/* === RECENT PROMPTS === */
.recent-prompts {
    margin-top: 16px;
    position: relative;
}

.recent-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.recent-toggle:hover {
    color: var(--text-secondary);
}

.recent-toggle svg {
    transition: var(--transition);
}

.recent-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-radius: var(--radius-sm);
}

.recent-list.open {
    max-height: 500px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

.recent-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-primary);
}

.recent-text {
    line-height: 1.4;
}

.recent-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* === PROMPT TABS === */
.prompt-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(15, 15, 46, 0.5);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-color);
}

.prompt-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.prompt-tab:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.prompt-tab.active {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
}

.prompt-tab svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.prompt-tab.active svg {
    opacity: 1;
}

/* === SMART PROMPT BUILDER === */
.prompt-builder {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prompt-builder.hidden {
    display: none;
}

.builder-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.builder-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.builder-label svg {
    color: var(--accent-purple);
    flex-shrink: 0;
}

.builder-input,
input.builder-input,
textarea.builder-input {
    width: 100%;
    padding: 14px 18px;
    background: #0d0d2b !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color-scheme: dark;
}

.builder-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

.builder-input:focus {
    border-color: var(--accent-purple);
    background: #10103a !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 0 20px rgba(139, 92, 246, 0.1);
}

.builder-textarea {
    resize: vertical;
    min-height: 64px;
    max-height: 160px;
    line-height: 1.6;
    line-height: 1.5;
}

/* Style Chips */
.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.style-chip {
    padding: 8px 16px;
    background: rgba(15, 15, 46, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.style-chip:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.style-chip.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

/* === RESULT AREA === */
#result-area {
    margin-top: 32px;
}

#result-area.hidden {
    display: none;
}

.result-container {
    text-align: center;
}

.result-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

.result-image {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
}

.result-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    min-width: auto;
    padding: 12px 24px;
    font-size: 14px;
}

.result-actions svg {
    flex-shrink: 0;
}

/* === RESULT SKELETON (Loading) === */
.result-skeleton {
    text-align: center;
    padding: 40px 0;
}

.skeleton-image {
    width: 100%;
    max-width: 640px;
    height: 360px;
    margin: 0 auto 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.loading-message {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    animation: fadeInUp 0.4s ease-out;
}

/* === TOAST NOTIFICATIONS === */
.toast {
    position: fixed;
    top: 90px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
    opacity: 0;
}

.toast.toast-enter {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-exit {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.4);
}

.toast-success .toast-icon svg {
    stroke: #22c55e;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
}

.toast-error .toast-icon svg {
    stroke: #ef4444;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.4);
}

.toast-info .toast-icon svg {
    stroke: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
}

.toast-message {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* === FAQ ACCORDION === */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--border-glow);
}

.faq-item.open {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    gap: 16px;
}

.faq-question:hover {
    color: var(--accent-purple);
}

.faq-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-answer-inner {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

/* === HERO SECTION (extended) === */
.hero-container {
    max-width: 1280px;
    margin: 0 auto;
}

.hero-content {
    text-align: center;
    margin-bottom: 48px;
}

.hero-badge {
    margin-bottom: 24px;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

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

/* Generator Panel */
.generator-panel {
    max-width: 900px;
    margin: 0 auto;
}

.generate-hint {
    font-size: 13px;
    color: var(--text-muted);
    align-self: center;
}

/* === STEPS (How It Works) === */
.steps-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
}

.step-card {
    flex: 1;
    text-align: center;
    padding: 40px 28px;
    position: relative;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: 50%;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.step-icon {
    margin-bottom: 16px;
}

.step-card h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.step-connector {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    color: var(--accent-purple);
    opacity: 0.5;
}

/* === FEATURES === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    padding: 36px 28px;
    text-align: left;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* === GALLERY === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.gallery-item.gallery-tall {
    grid-row: span 2;
}

.gallery-item.gallery-square {
    grid-row: span 1;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        hsl(var(--item-hue, 270) 60% 12%) 0%,
        hsl(var(--item-hue, 270) 70% 20%) 50%,
        hsl(var(--item-hue, 270) 50% 10%) 100%
    );
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: hsl(var(--item-hue, 270) 60% 70%);
    letter-spacing: 0.02em;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-tag {
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.gallery-real-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === RESULT IMAGE — ratio-aware sizing === */
.result-image-wrap[data-ratio="16:9"] .result-image { aspect-ratio: 16/9; }
.result-image-wrap[data-ratio="1:1"]  .result-image { aspect-ratio: 1/1; }
.result-image-wrap[data-ratio="9:16"] .result-image { aspect-ratio: 9/16; max-height: 560px; }
.result-image-wrap[data-ratio="4:5"]  .result-image { aspect-ratio: 4/5; max-height: 560px; }
.result-image-wrap[data-ratio="4:3"]  .result-image { aspect-ratio: 4/3; }

/* === CTA SECTION === */
.cta-section {
    padding: 100px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139,92,246,0.08) 0%, rgba(236,72,153,0.06) 50%, rgba(6,182,212,0.04) 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.cta-container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.cta-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 36px;
    line-height: 1.6;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 18px;
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 160px;
    }

    .steps-grid {
        gap: 0;
    }

    .step-card {
        padding: 32px 16px;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }

    .hero {
        padding-top: 120px;
        padding-bottom: 60px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-description {
        font-size: 17px;
    }

    .navbar-links {
        display: none;
    }

    .navbar-menu-btn {
        display: flex;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .generator-card {
        padding: 24px;
    }

    .prompt-card {
        width: 140px;
        padding: 14px 10px;
    }

    .prompt-card-icon {
        font-size: 24px;
    }

    .prompt-tabs {
        gap: 2px;
    }

    .prompt-tab {
        font-size: 13px;
        padding: 10px 12px;
    }

    .style-chips {
        gap: 6px;
    }

    .style-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .builder-input {
        padding: 10px 14px;
        font-size: 13px;
    }

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

    .result-actions .btn-primary,
    .result-actions .btn-secondary {
        width: 100%;
    }

    .toast {
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .faq-question {
        padding: 16px 18px;
        font-size: 15px;
    }

    .faq-answer-inner {
        padding: 0 18px 16px;
        font-size: 14px;
    }

    .steps-grid {
        flex-direction: column;
        gap: 0;
    }

    .step-connector {
        transform: rotate(90deg);
        padding: 8px 0;
    }

    .step-card {
        padding: 28px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
    }

    .gallery-item.gallery-tall {
        grid-row: span 1;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 24px;
    }

    .cta-title {
        font-size: 28px;
    }

    .cta-subtitle {
        font-size: 16px;
    }

    .cta-section {
        padding: 60px 20px;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 20px 32px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-description {
        font-size: 15px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-subtitle {
        font-size: 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
    }

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

    .card {
        padding: 24px;
    }

    .navbar-container {
        padding: 0 16px;
    }

    .generator-card {
        padding: 16px;
    }

    .prompt-card {
        width: 130px;
        padding: 12px 8px;
    }

    .prompt-card-name {
        font-size: 12px;
    }

    .prompt-card-desc {
        display: none;
    }

    #ratio-selector {
        gap: 6px;
    }

    .ratio-btn {
        padding: 8px 10px;
    }

    .skeleton-image {
        height: 220px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 130px;
    }

    .cta-title {
        font-size: 24px;
    }

    .btn-lg {
        padding: 14px 28px;
        font-size: 16px;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }

    .feature-card {
        padding: 24px 20px;
    }
}

/* Ultra Small — 320px */
@media (max-width: 360px) {
    .hero-title {
        font-size: 24px;
    }

    .hero-description {
        font-size: 14px;
    }

    .section-title {
        font-size: 22px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    .generator-card {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .prompt-picker-label {
        font-size: 15px;
    }

    .prompt-card {
        width: 115px;
        padding: 10px 6px;
    }

    .prompt-card-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .prompt-card-name {
        font-size: 11px;
    }

    .form-textarea {
        font-size: 14px;
        min-height: 100px;
    }

    .hero-stats {
        gap: 12px;
    }

    .stat-number {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .cta-title {
        font-size: 22px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 110px;
        gap: 10px;
    }

    .faq-question {
        padding: 14px 12px;
        font-size: 14px;
    }

    .faq-answer-inner {
        padding: 0 12px 14px;
        font-size: 13px;
    }

    .step-card h3 {
        font-size: 17px;
    }

    .step-card p {
        font-size: 13px;
    }

    .navbar-container {
        padding: 0 12px;
        height: 60px;
    }

    .navbar-logo {
        font-size: 20px;
    }
}
