/* ============================================================
   Quale Evolution Explorer - Landing Page Styles
   Dark theme matching the inspector view (explorer.css)
   ============================================================ */

:root {
    --bg-deep: #080810;
    --bg-panel: #0c0c16;
    --bg-surface: #10101c;
    --bg-elevated: #161625;
    --border: #1a1a2e;
    --border-active: #2a2a4a;
    --text-primary: #d0d0e0;
    --text-secondary: #707090;
    --text-dim: #404060;
    --accent: #4ecdc4;
    --accent-dim: rgba(78, 205, 196, 0.15);
    --accent-muted: rgba(78, 205, 196, 0.08);
    --font-mono: 'IBM Plex Mono', monospace;
    --font-sans: 'DM Sans', sans-serif;
}

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

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */

.header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 48px;
    flex-shrink: 0;
}

.header__logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
    white-space: nowrap;
}

.header__logo-sep {
    color: var(--border-active);
    margin: 0 2px;
}

.header__spacer { flex: 1; }

/* ---- Mode Tabs (segmented control) ---- */

.mode-tabs {
    display: flex;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.mode-tab {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.mode-tab:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--border);
}

.mode-tab:hover {
    color: var(--text-primary);
}

.mode-tab--active {
    background: var(--accent-dim);
    color: var(--accent);
}

.mode-tab--active::after {
    display: none;
}

/* ---- Main content ---- */

.main {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ---- Wizard Block (Create New Experiment) ---- */

.wizard-block {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px 28px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.wizard-block::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-muted) 0%, transparent 60%);
    pointer-events: none;
}

.wizard-block__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

.wizard-block__title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.wizard-block__desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 480px;
}

.wizard-block__action {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ---- Badges ---- */

.badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
}

.badge--soon {
    background: rgba(243, 156, 18, 0.12);
    color: #c8a44e;
    border: 1px solid rgba(243, 156, 18, 0.2);
}

/* ---- Buttons ---- */

.btn {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn--wizard {
    background: var(--bg-elevated);
}

/* ---- Toolbar (filters + status) ---- */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.exp-status {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* ---- Domain Filter Tabs ---- */

.domain-filters {
    display: flex;
    gap: 4px;
}

.filter-tab {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-tab:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.filter-tab--active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ---- Experiment Card Grid ---- */

.exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.exp-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.exp-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.exp-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.exp-card__title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exp-card__badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.exp-card__desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exp-card__stats {
    display: flex;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
}

.exp-card__fitness {
    margin-left: auto;
    color: var(--accent);
}

/* ---- Mode instructions (Local / Sandbox placeholder) ---- */

.mode-instructions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.mode-instructions code {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 8px 16px;
    margin: 12px 0;
    color: var(--accent);
}

.mode-instructions p {
    margin-bottom: 4px;
}

/* ---- Hamburger button (hidden on desktop) ---- */

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    margin: 3px 0;
    border-radius: 1px;
    transition: all 0.2s;
}

.hamburger:hover span {
    background: var(--text-primary);
}

/* ---- Mobile nav drawer ---- */

.nav-drawer {
    display: none !important;
}

.hamburger {
    display: none !important;
}

/* ---- Mobile Responsive ---- */

@media (max-width: 640px) {
    /* Header: just logo + hamburger */
    .header {
        padding: 0 12px;
        height: 44px;
        gap: 8px;
    }

    .header__logo {
        font-size: 10px;
    }

    /* Hide inline mode tabs, show hamburger */
    .mode-tabs {
        display: none;
    }

    .hamburger {
        display: block !important;
    }

    /* Nav drawer slides down from header */
    .nav-drawer {
        display: none !important;
        background: var(--bg-panel);
        border-bottom: 1px solid var(--border);
        padding: 8px 12px 12px;
        flex-direction: column;
        gap: 4px;
    }

    .nav-drawer.open {
        display: flex !important;
    }

    .nav-drawer .mode-tab {
        display: block;
        width: 100%;
        text-align: left;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 4px;
        font-family: var(--font-mono);
        font-size: 11px;
        font-weight: 500;
        background: transparent;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.15s;
    }

    .nav-drawer .mode-tab:hover {
        border-color: var(--border-active);
        color: var(--text-primary);
    }

    .nav-drawer .mode-tab--active {
        background: var(--accent-dim);
        color: var(--accent);
        border-color: var(--accent);
    }

    /* Hide wizard block on mobile */
    .wizard-block {
        display: none;
    }

    .main {
        padding: 16px 12px;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .domain-filters {
        flex-wrap: wrap;
    }

    .exp-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .exp-card__stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mode-instructions {
        padding: 32px 12px;
    }
}

/* ---- Scrollbar ---- */

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 2px; }
