/* =========================================
   CSS VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* UI Design Palette */
    --primary: #6bf27d;
    --primary-rgb: 107, 242, 125;
    --primary-dark: #4CAF50;
    --secondary: #3cf35e;
    --secondary-rgb: 60, 243, 94;
    --accent: #5d4c4d;
    --accent-rgb: 93, 76, 77;
    
    /* Backgrounds */
    --background: #FFFFFF;
    --background-alt: #F5F5F5;
    --surface: #F5F5F5;
    
    /* Text */
    --text: #000000;
    --text-secondary: #555555;
    --text-muted: #888888;
    
    /* Borders & Spacing */
    --border: #E0E0E0;
    --radius: 12px;
    --radius-sm: 8px;
    
    /* Fonts */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 1rem;
    word-break: break-word;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   SECTION STYLING - MANDATORY
   ========================================= */
section, .section, #playground, #how-to-use, #gallery, #testimonials, #faqs {
    padding: 5rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Alternating Backgrounds */
section:nth-child(odd) { background-color: var(--background); }
section:nth-child(even) { background-color: var(--background-alt); }

.section-featured {
    background: linear-gradient(135deg, var(--surface), var(--background));
    border-top: 1px solid var(--border);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

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

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

header nav a:not(.btn-header) {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
}

header nav a:not(.btn-header):hover {
    color: var(--primary);
}

.btn-header {
    background: var(--text);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 6rem; /* Header offset */
}

.hero-bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-bg-animation {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.95));
}

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

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #000000;
    box-shadow: 0 4px 15px rgba(107, 242, 125, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 242, 125, 0.5);
    background-color: #5ce66d;
}

.btn-secondary {
    background-color: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--surface);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text);
}

/* =========================================
   PLAYGROUND
   ========================================= */
#playground {
    background: var(--background);
}

.playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.playground-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.input-group label i {
    margin-right: 0.5rem;
    color: var(--primary);
}

textarea#video-prompt {
    width: 100%;
    height: 120px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

textarea#video-prompt:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.optional-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

/* Upload Zone */
.upload-zone {
    height: 178px; /* Smaller than full height since prompt is primary */
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.upload-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.upload-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

#preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    background: white;
}

#remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
}

/* Result Display */
.result-display {
    height: 350px;
    background: #000;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.result-placeholder {
    text-align: center;
    color: rgba(255,255,255,0.5);
}

.result-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#result-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.playground-actions {
    display: flex;
    gap: 1rem;
}

.playground-actions .btn {
    flex: 1;
}
.upload-section {
    margin-bottom: 15px;
}
/* =========================================
   CARDS & GRIDS
   ========================================= */
/* Grids */
.features-grid, .grid-4, .steps-grid, .gallery-grid, .testimonials-grid {
    display: grid;
    gap: 2rem;
}

/* Features */
.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-color: var(--primary);
}

.icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(107, 242, 125, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.glass-card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
}

/* Use Cases */
.card {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.mb-3 { margin-bottom: 1rem; }

/* Steps */
.step-card {
    background: var(--surface);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
}

.step-icon {
    width: 48px;
    height: 48px;
    background: var(--text);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    margin: 0 auto 1.5rem;
}

/* Gallery - Masonry-ish */
.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay p {
    color: white;
    font-weight: 600;
    margin: 0;
}

/* Testimonials */
.testimonials-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    position: relative;
}

.testimonial-quote {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-name {
    font-weight: 700;
    font-size: 0.95rem;
}

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

/* FAQ */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.faq-question {
    width: 100%;
    padding: 1.5rem 0;
    text-align: left;
    background: none;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

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

.faq-answer p {
    padding-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--surface);
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    color: var(--text);
}

.footer-column a {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

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

.footer-bottom {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* =========================================
   ANIMATIONS & UTILS
   ========================================= */
.hidden { display: none !important; }

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* Blob Animation for Hero */
.blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blobFloat 10s infinite alternate;
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -30px) scale(1.1); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (min-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .hero h1 { font-size: 3.5rem; }
    .footer-content { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    
    .hero { padding-top: 5rem; }
    .hero h1 { font-size: 2.5rem; }
    
    .playground-grid { grid-template-columns: 1fr; }
    .features-grid, .steps-grid, .gallery-grid, .testimonials-grid { grid-template-columns: 2fr; }
    
    .menu-toggle { display: block; }
    header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        align-items: flex-start;
    }
    
    header nav.active { display: flex; }
    header nav a { display: block; padding: 0.5rem 0; width: 100%; }
    .btn-header { width: 100%; text-align: center; margin-top: 1rem; }
}

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