/* ========================================
   VidPrompt — Design System & Styles
   ======================================== */

:root {
    /* Colors */
    --bg-primary: #06060b;
    --bg-secondary: #0c0c14;
    --bg-card: rgba(14, 14, 24, 0.7);
    --bg-card-hover: rgba(20, 20, 36, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --green: #00d2a0;
    --green-glow: rgba(0, 210, 160, 0.2);
    --red: #ff6b6b;

    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'Space Grotesk', monospace;

    /* Spacing */
    --section-pad: clamp(80px, 12vh, 160px);
    --container-max: 1100px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

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

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

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

a { color: inherit; text-decoration: none; }

/* ========================================
   Preloader
   ======================================== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

#preloader-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.preloader-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.preloader-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ========================================
   Custom Cursor
   ======================================== */
#cursor-dot, #cursor-ring {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    #cursor-dot, #cursor-ring {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 9999;
        border-radius: 50%;
        mix-blend-mode: difference;
    }

    #cursor-dot {
        width: 6px;
        height: 6px;
        background: white;
        transform: translate(-50%, -50%);
        transition: width 0.2s, height 0.2s;
    }

    #cursor-ring {
        width: 36px;
        height: 36px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s, border-color 0.3s;
    }

    body:has(a:hover, button:hover, input:hover, textarea:hover) #cursor-ring {
        width: 50px;
        height: 50px;
        border-color: var(--accent-light);
    }
}

/* ========================================
   Navbar
   ======================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#navbar.scrolled {
    padding: 12px 0;
    background: rgba(6, 6, 11, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 18px;
}

.logo-icon {
    color: var(--accent-light);
    font-size: 22px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-light);
    transition: width 0.3s;
}

.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }

.nav-cta {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 100px;
    background: var(--accent);
    color: white;
    transition: all 0.3s;
}

.nav-cta:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(6, 6, 11, 0.95);
    backdrop-filter: blur(30px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--text-primary);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mobile-link:hover { opacity: 1; }

.mobile-cta {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 100px;
    background: var(--accent);
    color: white;
    margin-top: 16px;
}

/* ========================================
   Hero
   ======================================== */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 32px;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--green);
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid rgba(0, 210, 160, 0.2);
    background: rgba(0, 210, 160, 0.05);
    margin-bottom: 32px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-dot 1.2s ease-in-out infinite;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 7vw, 80px);
    line-height: 1.05;
    margin-bottom: 24px;
    font-weight: 400;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-light), var(--green), var(--accent-light));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 100px;
    background: var(--accent);
    color: white;
    transition: all 0.3s;
}

.hero-cta:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent-light), transparent);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ========================================
   Sections Common
   ======================================== */
.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 32px;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-light);
    display: block;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 400;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ========================================
   Upload Section
   ======================================== */
#upload {
    padding: var(--section-pad) 0;
    position: relative;
}

.upload-zone {
    max-width: 640px;
    margin: 0 auto 32px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 64px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-glass);
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
    transform: translateY(-2px);
}

.upload-zone.dragover {
    border-color: var(--green);
    background: rgba(0, 210, 160, 0.05);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.upload-label {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-or {
    font-size: 13px;
    color: var(--text-muted);
    margin: 12px 0;
}

.upload-btn {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 100px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.upload-formats {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Video Preview */
.upload-preview {
    text-align: left;
}

.upload-preview video {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    background: black;
}

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

.file-name {
    font-weight: 500;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.file-size {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

/* Prompt Section */
.prompt-section {
    max-width: 640px;
    margin: 0 auto;
}

.prompt-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 12px;
}

.prompt-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
    outline: none;
}

.prompt-input:focus {
    border-color: var(--accent);
}

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

.analyze-btn {
    width: 100%;
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.analyze-btn:hover:not(:disabled) {
    background: var(--accent-light);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ========================================
   Results Section
   ======================================== */
#results {
    padding: 0 0 var(--section-pad);
}

.result-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 14, 24, 0.5);
}

.result-model {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-light);
}

.result-status {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(0, 210, 160, 0.1);
    color: var(--green);
}

.result-status.processing {
    background: rgba(108, 92, 231, 0.1);
    color: var(--accent-light);
}

.result-status.error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--red);
}

.result-content {
    padding: 32px 24px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.result-loader {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.pulse-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    margin: 0 auto 20px;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 1; }
}

.result-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(14, 14, 24, 0.5);
}

.action-btn {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* ========================================
   How It Works
   ======================================== */
#how {
    padding: var(--section-pad) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

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

@media (max-width: 900px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    transition: all 0.3s;
}

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

.step-num {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 16px;
}

.step-title {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 12px;
}

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

/* ========================================
   Features
   ======================================== */
#features {
    padding: var(--section-pad) 0;
}

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

@media (max-width: 900px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.feature-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    transition: all 0.3s;
}

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

.feature-icon {
    font-size: 28px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

/* ========================================
   Footer
   ======================================== */
#footer {
    padding: 48px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

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

.footer-text a {
    color: var(--accent-light);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.footer-text a:hover {
    border-color: var(--accent-light);
}

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

/* ========================================
   Reveal Animation Base
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    :root {
        --section-pad: 60px;
    }

    .hero-cta {
        font-size: 13px;
        padding: 14px 24px;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .result-content {
        padding: 24px 16px;
        font-size: 14px;
    }
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9999;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 12px 24px;
    border-radius: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}
