/* =========================================
   1. GLOBAL VARIABLES & THEME
   ========================================= */
:root {
    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Playfair Display', serif;

    /* Light Mode (Default) */
    --bg-main: #f8f9fa;
    --bg-panel: #ffffff;
    --bg-panel-rgb: 255, 255, 255; /* For backdrop filters */
    --bg-canvas: #e9ecef;
    
    --primary: #2563eb;       /* Blue */
    --primary-hover: #1d4ed8;
    --accent: #7c3aed;        /* Violet */
    
    --text: #1f2937;
    --text-muted: #6b7280;
    
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --bg-main: #111827;
    --bg-panel: #1f2937;
    --bg-panel-rgb: 31, 41, 55;
    --bg-canvas: #0f1218;
    
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --accent: #8b5cf6;
    
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    
    --border: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    height: 100vh; /* Fixed height for Editor */
}

body.landing-page {
    height: auto; /* Scrollable for Landing Page */
    overflow-y: auto;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

/* =========================================
   3. BUTTONS & INPUTS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

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

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover:not(:disabled) { filter: brightness(1.1); }
.btn-accent:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover { background: var(--bg-main); color: var(--primary); }

.full-width { width: 100%; }

/* Form Elements */
input[type="text"], select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text);
    margin-bottom: 10px;
    font-size: 0.9rem;
}
input[type="text"]:focus, select:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    appearance: none;
    margin-bottom: 15px;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    margin-bottom: 10px;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   4. LAYOUT (EDITOR)
   ========================================= */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 20;
    transition: transform 0.3s;
}

.brand {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--text);
    font-size: 1.1rem;
}
.brand i { color: var(--primary); margin-right: 10px; font-size: 1.2rem; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: none;
}
.tab-content.active { display: block; }

.control-group { margin-bottom: 25px; }
.control-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}
.control-group.disabled { opacity: 0.5; pointer-events: none; }

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

.preset-controls { display: flex; gap: 10px; align-items: center; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.toolbar {
    height: 60px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
}

.tool-group { display: flex; gap: 5px; }
.tool-divider { width: 1px; height: 24px; background: var(--border); }
.tool-spacer { flex: 1; }

.canvas-container {
    flex: 1;
    background: var(--bg-canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Drop Zone */
.drop-zone {
    position: absolute;
    text-align: center;
    pointer-events: none;
    z-index: 10;
    color: var(--text-muted);
}
.drop-zone i { font-size: 4rem; margin-bottom: 15px; opacity: 0.5; }
.has-image .drop-zone { display: none; }

/* Batch List */
.batch-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.batch-list li {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}
.batch-list li:last-child { border-bottom: none; }
.batch-list .empty { padding: 20px; text-align: center; color: var(--text-muted); font-style: italic; }

/* =========================================
   5. LANDING PAGE STYLES
   ========================================= */

/* Navbar Specifics for Landing */
.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(var(--bg-panel-rgb), 0.95);
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-links { display: flex; gap: 20px; }
.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
    font-size: 0.95rem;
}
.nav-links a.active, .nav-links a:hover { color: var(--primary); }

.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Hero Section */
.hero-section {
    padding: 130px 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text);
}

.text-gradient {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-cta { display: flex; gap: 15px; margin-bottom: 30px; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

.trust-badges {
    display: flex; gap: 20px; font-size: 0.9rem; color: var(--text-muted);
}
.trust-badges i { color: #2ecc71; margin-right: 5px; }

/* Mockup Animation */
.mockup-window {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 350px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mockup-header {
    padding: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 6px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }

.mockup-body {
    flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
    background: var(--bg-main);
}
.big-icon { font-size: 5rem; color: var(--border); }

.floating-badge {
    position: absolute;
    background: var(--bg-panel);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    animation: float 6s ease-in-out infinite;
}
.badge-1 { top: 20%; right: 15%; color: var(--primary); }
.badge-2 { bottom: 25%; left: 15%; color: var(--accent); animation-delay: 2s; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.fade-in-up { animation: fadeInUp 0.8s forwards; opacity: 0; }
.delay-200 { animation-delay: 0.2s; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Features */
.features-section { padding: 80px 20px; background: var(--bg-main); }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 10px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.feature-card {
    background: var(--bg-panel);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.3s;
    opacity: 0; transform: translateY(20px);
}
.feature-card.visible { opacity: 1; transform: translateY(0); }
.feature-card:hover { transform: translateY(-5px); }

.icon-box {
    width: 50px; height: 50px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 20px;
}

/* Footer */
.main-footer {
    background: var(--bg-panel);
    padding: 60px 20px 20px;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto 40px;
}
.footer-brand h3 { color: var(--primary); margin-bottom: 10px; }
.footer-links h4, .footer-social h4 { font-size: 0.9rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 15px; }
.footer-links a { display: block; margin-bottom: 8px; color: var(--text); }
.footer-links a:hover { color: var(--primary); }

.social-icons { display: flex; gap: 10px; }
.social-icons a {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
    transition: all 0.2s;
}
.social-icons a:hover { background: var(--primary); border-color: var(--primary); color: white; }
.footer-bottom { text-align: center; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 20px; }

/* =========================================
   6. RESPONSIVE / MOBILE STYLES
   ========================================= */
@media (max-width: 768px) {
    /* Editor Mobile */
    .app-layout { flex-direction: column-reverse; height: 100vh; }
    .sidebar { width: 100%; height: 40%; border-right: none; border-top: 1px solid var(--border); }
    .workspace { height: 60%; }
    .canvas-container { padding: 10px; }
    
    /* Landing Mobile */
    .landing-nav { padding: 0 15px; }
    .nav-links.mobile-hidden { display: none; }
    
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 100px; /* Space for navbar */
        padding-bottom: 40px;
        gap: 30px;
    }
    
    .hero-content h1 { font-size: 2.2rem; }
    .hero-cta { flex-direction: column; width: 100%; }
    .btn-lg { width: 100%; justify-content: center; }
    .trust-badges { justify-content: center; flex-wrap: wrap; }
    
    .mockup-window { height: 250px; }
    
    .features-section { padding: 40px 20px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .social-icons { justify-content: center; }
}

/* =========================================
   7. UTILITIES
   ========================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.badge {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-block;
}
