:root {
    /* Palette - Soft & Premium */
    --bg-page: #F9FAFB;
    --bg-surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #9CA3AF;

    --accent-primary: #4F46E5;
    /* Indigo 600 */
    --accent-hover: #4338CA;
    --accent-light: #EEF2FF;

    --border-light: #E5E7EB;
    --border-focus: #4F46E5;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.08);

    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-sans: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

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

.hidden {
    display: none !important;
}

/* Landing Page Wrapper */
.landing-page {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    padding-bottom: 6rem;
}

/* HERO */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    width: 100%;
}

.hero-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #111827 0%, #4B5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Hero Grid (Split View) */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

/* Hero Slider (Revised for Correct Reveal) */
.hero-demo-slider {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
    border: 4px solid white;
    cursor: ew-resize;
    user-select: none;
    background: #000;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Both layers absolute over each other */
.img-layer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.img-layer.after {
    width: 100%;
    z-index: 1;
}

/* Before layer width changes, but overflow hidden clips the content */
.img-layer.before {
    width: 50%;
    z-index: 2;
    overflow: hidden;
    border-right: 2px solid white;
}

/* CRITICAL: Images must be full width of CONTAINER, not layer. 
   We will ensure this via JS adjustment or CSS hacks.
   Using object-fit: cover on an image that is sized to the PARENT .slider-wrapper */
.img-layer img {
    position: absolute;
    /* Fix to top-left of wrapper context */
    top: 0;
    left: 0;
    height: 100%;
    object-fit: cover;
    /* Max-width none allows it to exceed the .before container */
    max-width: none !important;
    /* Width will be set by JS to match .hero-demo-slider width exactly. 
       Fallback: 600px (approx half container) */
    width: 100%;
}

/* Extra Damage Effect for Before Image */
#sliderBeforeLayer img {
    filter: grayscale(100%) contrast(0.8) sepia(0.6) blur(0.5px);
}

.demo-label {
    position: absolute;
    bottom: 1rem;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.img-layer.after .demo-label {
    right: 1rem;
}

/* Place before label relative to the layer view? No, keeps it visible. */
.demo-label.lbl-before {
    left: 1rem;
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    margin-left: -20px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.handle-line {
    position: absolute;
    height: 100%;
    width: 2px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.handle-circle {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--accent-primary);
    position: relative;
}

/* Upload Area (Right Side) */
.upload-area {
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-surface);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.icon-circle {
    width: 56px;
    height: 56px;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.upload-heading {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-light);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    pointer-events: none;
}

.upload-security {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid transparent;
}

/* Content Sections */
.content-section>h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.step-card {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    position: relative;
    transition: transform 0.2s;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* SEO */
.seo-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.seo-block h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.seo-block p {
    color: var(--text-secondary);
}

/* FAQ */
.accordion {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.accordion-body {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-secondary);
    display: none;
    line-height: 1.6;
}

.accordion-item.active .accordion-body {
    display: block;
}

.accordion-item.active .accordion-header svg {
    transform: rotate(180deg);
    transition: transform 0.2s;
}

/* WORKSPACE */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    height: calc(100vh - 120px);
    min-height: 600px;
}

/* Preview Area */
.preview-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-light);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
}

/* Discrete Apply Button */
.btn-xs-secondary {
    align-self: flex-end;
    background-color: #F3F4F6;
    /* Gray background (inactive) */
    border: none;
    color: #9CA3AF;
    /* Gray text (inactive) */
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    /* Thicker and not too wide */
    border-radius: 6px;
    cursor: not-allowed;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

/* Active State (Washed Violet) */
.btn-xs-secondary.active {
    background-color: #818CF8;
    /* Washed Indigo (Indigo 400) */
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-xs-secondary.active:hover {
    background-color: #6366F1;
    /* Slightly darker on hover */
    transform: translateY(-1px);
}

/* Premium Buttons for Header */
.btn-text {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.btn-text:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-text svg {
    width: 16px;
    height: 16px;
}

.badge {
    background: #DCFCE7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #BBF7D0;
    display: inline-flex;
    align-items: center;
}

.single-view {
    flex: 1;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.img-wrapper.main-img {
    width: 100%;
    height: 100%;
}

.img-wrapper.main-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Process Overlay */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(5px);
    border-radius: var(--radius-lg);
}

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

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

/* Controls Panel */
.controls-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.actions {
    flex-shrink: 0;
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
    z-index: 10;
}

/* Prompt UI Refinements */
.prompt-group {
    background: var(--bg-page);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.helper-text-sm {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    margin-top: -0.25rem;
}

.icon-sm {
    width: 14px;
    height: 14px;
    color: var(--accent-primary);
    margin-right: 4px;
}

.text-input.prompt-input {
    font-size: 0.85rem;
    padding: 0.5rem;
    min-height: 80px;
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

/* Control Group */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Switch Toggle */
.toggle-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.toggle-label {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.label-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.label-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-light);
    transition: .4s;
    border-radius: 34px;
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background-color: var(--accent-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Range Slider */
.slider[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-light);
    border-radius: 4px;
    outline: none;
}

.slider[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.slider[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Main Button */
.btn-primary {
    width: 100%;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.micro-copy {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-tertiary);
}

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

    .hero-demo-slider {
        height: 350px;
    }

    .upload-area {
        height: auto;
        padding: 3rem;
    }

    .editor-grid {
        height: auto;
        grid-template-columns: 1fr;
    }

    .controls-panel {
        height: auto;
        overflow: visible;
    }

    .scroll-content {
        overflow: visible;
    }
}
/* --- Pricing Page --- */
.pricing-hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.price-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.price-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.price-card.featured {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    transform: scale(1.02); /* Slight pop */
}

.price-card.featured:hover {
    transform: scale(1.02) translateY(-5px);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-features {
    list-style: none;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.price-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.price-features li svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.price-card .btn-primary {
    margin-top: auto;
}

.btn-outline {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

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

/* --- About Page --- */
.about-hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.about-content-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
}

.about-content-block.reverse {
    direction: rtl; /* Layout hack for visual reverse */
}

.about-content-block.reverse > * {
    direction: ltr; /* Reset text direction */
}

.about-text h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.about-img {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #e5e7eb;
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin: 4rem 0;
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
    .about-content-block { grid-template-columns: 1fr; gap: 2rem; direction: ltr !important; }
    .stats-grid { flex-direction: column; gap: 2rem; }
}
