/* ═══════════════════════════════════════════════════════════════
   EcomOps — Shared Design System
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap');

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

:root {
    --bg: #000000;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-2: rgba(255, 255, 255, 0.05);
    --surface-3: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 255, 255, 0.15);
    --text: #ffffff;
    --text-dim: #9ca3af;
    --text-muted: #6b7280;
    --accent: #7c5cfc;
    --accent-glow: #9b7dff;
    --green: #4ade80;
    --green-dim: rgba(74, 222, 128, 0.1);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.1);
    --yellow: #fbbf24;
    --yellow-dim: rgba(251, 191, 36, 0.1);
    --blue: #60a5fa;
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Subtle vignette glow from GSC */
.bg-vignette {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 255, 255, 0.03), transparent);
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

/* ─── Header ─── */
.header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}
.header-brand .logo {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #000;
}
.header-brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-family: 'Playfair Display', serif;
}
.header-brand .badge {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--surface-3);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.header-nav a {
    font-size: 0.82rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 40px;
    transition: all 0.15s;
    font-weight: 500;
}
.header-nav a:hover { color: var(--text); background: var(--surface-3); }
.header-nav a.active { color: #000; background: #fff; }

/* ─── Summary Bar ─── */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: transparent;
    border-bottom: 1px solid var(--border);
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(124, 92, 252, 0.15);
}
.stat-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}
.stat-icon.cost { background: rgba(251, 191, 36, 0.1); }
.stat-icon.calls { background: rgba(96, 165, 250, 0.1); }
.stat-icon.images { background: rgba(167, 139, 250, 0.1); }
.stat-icon.active { background: rgba(52, 211, 153, 0.1); }
.stat-value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* ─── Shared Components ─── */
.field {
    margin-bottom: 0.75rem;
}
.field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
    outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.field input::placeholder { color: var(--text-muted); }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.form-section {
    margin-bottom: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.form-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}
.toggle-field label { margin-bottom: 0; }
.toggle {
    position: relative;
    width: 42px;
    height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
    position: absolute;
    inset: 0;
    background: var(--surface-3);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(18px); background: #fff; }

.btn-launch {
    width: 100%;
    padding: 0.9rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 40px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}
.btn-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}
.btn-launch:active { transform: translateY(0); }
.btn-launch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 40px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-sm:hover {
    border-color: var(--text-dim);
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.btn-icon:hover { border-color: var(--text-dim); color: var(--text); background: rgba(255, 255, 255, 0.1); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); }

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.9rem; }

/* ─── Drop Zone ─── */
.drop-zone {
    border: 1px dashed var(--text-muted);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}
.drop-zone.uploaded {
    border-color: var(--green);
    border-style: solid;
    background: rgba(52, 211, 153, 0.05);
}
.drop-zone .dz-icon { font-size: 1.8rem; margin-bottom: 0.5rem; opacity: 0.7; }
.drop-zone .dz-text { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }
.drop-zone .dz-text strong { color: var(--accent); }
.drop-zone input[type=file] { display: none; }

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Collapsible ─── */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.collapsible-header .chevron {
    transition: transform 0.2s;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.collapsible-header.open .chevron { transform: rotate(180deg); }
.collapsible-body { display: none; padding-top: 0.5rem; }
.collapsible-body.open { display: block; }

/* ─── Hamburger Menu ─── */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .hamburger { display: block; position: relative; z-index: 10000; }
    .header { padding: 1rem 1.25rem; backdrop-filter: none; background: rgba(0, 0, 0, 0.95); z-index: 9999; }
    .header-brand .badge { display: none; }
    .header-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 260px;
        height: 100vh;
        background: rgba(10, 10, 12, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 1.5rem 2rem;
        gap: 0.25rem;
        border-left: 1px solid var(--border);
        z-index: 9999;
    }
    .header-nav.open {
        display: flex;
    }
    .header-nav a {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: 10px;
        color: #fff;
        display: block;
        -webkit-tap-highlight-color: rgba(124, 92, 252, 0.3);
    }
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
    }
    .mobile-overlay.open { display: block; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
