/* ==========================================================================
   VECTORIFY - PREMIUM DARK THEME UI
   A modern, professional vectorization tool interface
   ========================================================================== */

/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */
:root {
    /* Core Colors */
    --bg-color: #0a0b0d;
    --surface-color: #12141a;
    --surface-light: #1e2028;
    --surface-lighter: #282a36;

    /* Accent Gradient */
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #a855f7;
    --primary-color: #6366f1;
    --primary-hover-color: #5254cc;
    --primary-glow: rgba(99, 102, 241, 0.35);

    /* Text */
    --text-color: #f4f4f5;
    --text-muted: #9ca3af;
    --text-subtle: #6b7280;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    /* Glassmorphism */
    --glass-bg: rgba(18, 20, 26, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Spacing & Sizing */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 40px var(--primary-glow);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-2);
}

/* ==========================================================================
   FOCUS STATES
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.toggle-switch input:focus-visible+.toggle-slider,
details summary:focus-visible,
input[type="range"]:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-normal);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-2);
}

.site-header nav {
    display: flex;
    gap: 2rem;
}

.site-header nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.site-header nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
    transition: width var(--transition-normal);
    border-radius: 1px;
}

.site-header nav a:hover {
    color: var(--text-color);
    text-decoration: none;
}

.site-header nav a:hover::after {
    width: 100%;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(300px, 85vw);
    height: 100vh;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    z-index: 151;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.mobile-nav-close:hover {
    color: var(--text-color);
}

.mobile-nav-close svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex-grow: 1;
}

.mobile-nav-links a {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.mobile-nav-links a:hover {
    background: var(--surface-light);
    color: var(--text-color);
    border-left-color: var(--accent-2);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
section {
    padding: 6rem 0;
    position: relative;
}

section h2 {
    font-size: 2.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 4rem;
    text-align: center;
    line-height: 1.7;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    text-align: center;
    padding: 10rem 0 8rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse 60% 40% at 20% 10%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
        var(--bg-color);
}

/* Animated grain overlay for premium feel */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

.hero-section h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    max-width: 900px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--text-color) 0%, #d4d4d8 50%, var(--text-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero-section .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 3rem;
    line-height: 1.7;
}

/* Upload Area */
.upload-area {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 3.5rem 2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.08) 0%,
            rgba(139, 92, 246, 0.04) 50%,
            rgba(168, 85, 247, 0.08) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.upload-area:hover::before,
.upload-area.dragover::before {
    opacity: 1;
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 56px;
    height: 56px;
    color: var(--accent-2);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.upload-area p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.upload-area small {
    color: var(--text-subtle);
    display: block;
    font-size: 0.9rem;
}

.browse-link {
    background: none;
    border: none;
    color: var(--accent-2);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    transition: color var(--transition-fast);
}

.browse-link:hover {
    color: var(--accent-3);
}

/* ==========================================================================
   HOW IT WORKS SECTION
   ========================================================================== */
.how-it-works-section {
    background: var(--bg-color);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 2.5rem 2rem 2rem;
    border-radius: var(--border-radius-lg);
    position: relative;
    text-align: center;
    transition: all var(--transition-normal);
}

.step-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.step-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
    color: var(--text-color);
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   COMPARISON SECTION (WHY CHOOSE US)
   ========================================================================== */
.comparison-section {
    background:
        radial-gradient(ellipse 50% 50% at 0% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        var(--bg-color);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.comparison-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.comparison-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.comparison-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comparison-card-icon {
    width: 24px;
    height: 24px;
    color: #34d399;
    flex-shrink: 0;
}

.comparison-card h4 {
    font-size: 1.05rem;
    color: var(--text-color);
    font-weight: 600;
}

.comparison-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */
.features-section {
    background:
        radial-gradient(ellipse 50% 50% at 100% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        var(--surface-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--surface-light);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feature-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-2);
    flex-shrink: 0;
}

.feature-card h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   USE CASES SECTION
   ========================================================================== */
.use-cases-section {
    background: var(--bg-color);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.use-case-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.use-case-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.use-case-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
}

.use-case-card:hover .use-case-icon-wrapper {
    transform: scale(1.1);
}

.use-case-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-2);
}

.use-case-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.use-case-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   EDUCATIONAL SECTION
   ========================================================================== */
.educational-section {
    background: var(--surface-color);
}

.educational-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.educational-card {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-normal);
}

.educational-card:hover {
    border-color: var(--border-hover);
}

.educational-card h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.educational-card p {
    color: var(--text-muted);
    line-height: 1.7;
    text-align: center;
}

.conclusion-text {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ==========================================================================
   FAQ SECTION
   ========================================================================== */
.faq-section {
    background: var(--bg-color);
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-accordion details {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.faq-accordion details:hover {
    border-color: var(--border-hover);
}

.faq-accordion details[open] {
    border-color: rgba(99, 102, 241, 0.3);
}

.faq-accordion summary {
    padding: 1.25rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    position: relative;
    transition: background-color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.faq-accordion summary::-webkit-details-marker {
    display: none;
}

.faq-accordion summary:hover {
    background: var(--surface-light);
}

.faq-accordion summary::before {
    content: '';
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform var(--transition-normal);
}

.faq-accordion details[open] summary::before {
    transform: rotate(180deg);
}

.faq-accordion details p {
    padding: 0 1.5rem 1.5rem 4rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    background: var(--surface-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-color);
}

.site-footer p {
    font-size: 0.9rem;
    color: var(--text-subtle);
}

/* ==========================================================================
   EDITOR MODAL
   ========================================================================== */
.editor-modal-container {
    position: fixed;
    inset: 0;
    background-color: var(--bg-color);
    z-index: 1000;
    overflow: hidden;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1rem;
    padding: 1rem;
}

.controls-sidebar {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--surface-light);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.sidebar-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--surface-light);
}

/* Preview Area */
.preview-area {
    grid-column: 2 / 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: 100%;
}

.image-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.pane-header {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--surface-light);
    flex-shrink: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-content {
    flex-grow: 1;
    padding: 0.5rem;
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(45deg, #1a1c24 25%, transparent 25%),
        linear-gradient(-45deg, #1a1c24 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1c24 75%),
        linear-gradient(-45deg, transparent 75%, #1a1c24 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#original-image,
#vector-output {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: 0 0;
    cursor: grab;
}

#original-image:active,
#vector-output:active {
    cursor: grabbing;
}

.preview-area.view-original {
    grid-template-columns: 1fr;
}

.preview-area.view-original #vector-output-wrapper {
    display: none;
}

.preview-area.view-original #original-image-wrapper {
    display: flex;
}

.preview-area.view-vector {
    grid-template-columns: 1fr;
}

.preview-area.view-vector #original-image-wrapper {
    display: none;
}

.preview-area.view-vector #vector-output-wrapper {
    display: flex;
}

.preview-area.view-side-by-side {
    grid-template-columns: 1fr 1fr;
}

.preview-area.view-side-by-side #original-image-wrapper,
.preview-area.view-side-by-side #vector-output-wrapper {
    display: flex;
}

/* Control Groups */
.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    display: block;
    font-weight: 500;
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#customization-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sliders-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--surface-light);
    color: var(--text-color);
    user-select: none;
}

.btn:hover {
    background: var(--surface-lighter);
    border-color: var(--border-hover);
}

.btn:active {
    transform: scale(0.98);
}

.btn.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn.btn-primary:active {
    transform: scale(0.98);
}

.btn:disabled {
    background: var(--surface-color);
    color: var(--text-subtle);
    cursor: not-allowed;
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
    opacity: 0.6;
}

.close-btn {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Preset Button Group */
.preset-btn-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
}

.preset-btn {
    flex-grow: 1;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    font-weight: 500;
}

.preset-btn:hover {
    background: var(--surface-light);
    color: var(--text-color);
}

.preset-btn:last-child {
    border-right: none;
}

.preset-btn.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
}

.preset-btn[data-preset="custom"].active {
    background: var(--surface-light);
    color: var(--text-color);
}

/* ==========================================================================
   SLIDERS
   ========================================================================== */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slider-value {
    font-size: 0.8rem;
    background: var(--bg-color);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-width: 44px;
    text-align: center;
    font-weight: 500;
    color: var(--text-color);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-color);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-radius: 50%;
    border: none;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* ==========================================================================
   TOGGLE SWITCH
   ========================================================================== */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface-lighter);
    transition: var(--transition-fast);
    border-radius: 26px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition-fast);
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* ==========================================================================
   IMAGE INFO AREA
   ========================================================================== */
.image-info-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: var(--border-radius);
}

#image-thumbnail {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-text {
    flex-grow: 1;
    overflow: hidden;
}

#image-filename {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

#image-dimensions {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   PROCESSING LOG
   ========================================================================== */
#processing-log {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'SF Mono', 'Courier New', Courier, monospace;
}

.main-actions {
    display: flex;
    gap: 0.75rem;
}

/* ==========================================================================
   LOADER
   ========================================================================== */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 11, 13, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    gap: 1rem;
    color: var(--text-color);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.loader-overlay.visible {
    display: flex;
    opacity: 1;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-color);
    border-bottom-color: var(--accent-2);
    border-radius: 50%;
    animation: rotation 0.9s linear infinite;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   RESPONSIVE - LARGE TABLETS
   ========================================================================== */
@media (max-width: 1200px) {
    .editor-modal-container {
        grid-template-columns: 340px 1fr;
    }

    .steps-grid {
        gap: 1.5rem;
    }
}

/* ==========================================================================
   RESPONSIVE - TABLETS
   ========================================================================== */
@media (max-width: 900px) {
    .editor-modal-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        gap: 0;
    }

    .controls-sidebar {
        grid-row: 2;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        max-height: none;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .preview-area {
        grid-column: 1;
        grid-row: 1;
        border-radius: 0;
    }

    .image-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

/* ==========================================================================
   RESPONSIVE - SMALL TABLETS / LARGE PHONES
   ========================================================================== */
@media (max-width: 768px) {

    /* Header */
    .site-header nav {
        display: none;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .mobile-nav-overlay,
    .mobile-nav {
        display: block;
    }

    /* Hero */
    .hero-section {
        padding: 8rem 0 5rem;
    }

    .hero-section .subtitle {
        font-size: 1.1rem;
    }

    .upload-area {
        padding: 2.5rem 1.5rem;
    }

    /* Sections */
    section {
        padding: 4rem 0;
    }

    section h2 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .section-subtitle {
        margin-bottom: 3rem;
        font-size: 1rem;
    }

    /* ==========================================================================
       EDITOR MODAL - MOBILE BOTTOM SHEET
       ========================================================================== */
    .editor-modal-container {
        display: flex;
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    /* Preview takes priority - full screen minus sidebar */
    .preview-area {
        flex: 1;
        min-height: 0;
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr !important;
        order: 1;
    }

    /* Only show vector output on mobile for simplicity */
    .preview-area #original-image-wrapper {
        display: none !important;
    }

    .preview-area #vector-output-wrapper {
        display: flex !important;
    }

    .preview-area.view-original #original-image-wrapper {
        display: flex !important;
    }

    .preview-area.view-original #vector-output-wrapper {
        display: none !important;
    }

    .image-wrapper {
        border: none;
        border-radius: 0;
    }

    .pane-header {
        display: none;
    }

    .image-content {
        padding: 0.25rem;
    }

    /* Sidebar becomes a collapsible bottom sheet */
    .controls-sidebar {
        order: 2;
        flex-shrink: 0;
        border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
        border: none;
        border-top: 1px solid var(--border-color);
        max-height: 55vh;
        min-height: auto;
        transition: max-height var(--transition-normal);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    }

    .controls-sidebar.collapsed {
        max-height: 120px;
    }

    .controls-sidebar.collapsed .sidebar-content {
        display: none;
    }

    /* Bottom sheet drag handle indicator */
    .sidebar-header {
        position: relative;
        padding: 1rem;
        cursor: pointer;
    }

    .sidebar-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--surface-lighter);
        border-radius: 2px;
    }

    .sidebar-header h3 {
        font-size: 0.9rem;
    }

    .sidebar-content {
        padding: 0.75rem 1rem 1rem;
        gap: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(55vh - 120px);
    }

    /* Compact image info area */
    .image-info-area {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    #image-thumbnail {
        width: 44px;
        height: 44px;
    }

    #image-filename {
        font-size: 0.85rem;
    }

    #change-image-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* View mode buttons - more compact */
    .control-group label {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }

    .preset-btn-group {
        border-radius: 6px;
    }

    .preset-btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Sliders grid - two columns on mobile */
    .sliders-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-top: 0.25rem;
    }

    .sliders-grid .control-group {
        padding: 0.5rem;
        background: var(--surface-light);
        border-radius: var(--border-radius);
    }

    /* Larger touch targets for sliders */
    input[type="range"] {
        height: 8px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .slider-wrapper {
        gap: 0.5rem;
    }

    .slider-value {
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
        min-width: 38px;
    }

    /* Toggle switch */
    .toggle-switch {
        width: 44px;
        height: 24px;
    }

    .toggle-slider::before {
        height: 18px;
        width: 18px;
    }

    input:checked+.toggle-slider::before {
        transform: translateX(20px);
    }

    #render-quality-value {
        font-size: 0.8rem;
    }

    /* Fixed footer with action buttons */
    .sidebar-footer {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        background: var(--surface-color);
        border-top: 1px solid var(--border-color);
    }

    .main-actions {
        flex-direction: row;
        gap: 0.5rem;
    }

    .main-actions .btn {
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        justify-content: center;
    }

    #processing-log {
        font-size: 0.7rem;
        text-align: center;
    }

    /* Educational */
    .educational-content {
        grid-template-columns: 1fr;
    }

    .educational-card {
        padding: 2rem;
    }

    /* FAQ - add top padding to answer to separate from hover state */
    .faq-accordion details p {
        padding-top: 0.75rem;
    }

    /* Footer */
    .footer-links {
        gap: 1.5rem;
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE (PHONES)
   ========================================================================== */
@media (max-width: 600px) {
    .container {
        padding: 0 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section .subtitle {
        font-size: 1rem;
    }

    .upload-area {
        padding: 2rem 1.25rem;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    /* Editor modal - more compact on smaller phones */
    .controls-sidebar {
        max-height: 50vh;
    }

    .sidebar-content {
        max-height: calc(50vh - 110px);
        padding: 0.5rem 0.75rem 0.75rem;
    }

    .sidebar-header {
        padding: 0.75rem;
    }

    .sidebar-header h3 {
        font-size: 0.85rem;
    }

    .close-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    /* Single column sliders on very narrow screens */
    .sliders-grid {
        grid-template-columns: 1fr;
    }

    /* Cards */
    .feature-card,
    .comparison-card,
    .use-case-card,
    .step-card {
        padding: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ==========================================================================
   RESPONSIVE - SMALL PHONES
   ========================================================================== */
@media (max-width: 380px) {
    .hero-section {
        padding: 7rem 0 4rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .upload-area p {
        font-size: 1rem;
    }

    section h2 {
        font-size: 1.75rem;
    }

    /* Even more compact editor */
    .controls-sidebar {
        max-height: 45vh;
    }

    .sidebar-content {
        max-height: calc(45vh - 100px);
    }

    .image-info-area {
        flex-wrap: wrap;
    }

    .info-text {
        flex: 1 1 60%;
    }

    #change-image-btn {
        flex: 1 1 100%;
        margin-top: 0.5rem;
    }

    .preset-btn {
        padding: 0.4rem 0.25rem;
        font-size: 0.75rem;
    }

    .main-actions .btn {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }
}