/* ============================================================
   sidebar.css — Sidebar layout + Onboarding overlay
   Apple HIG-inspired, clean black-and-white defaults
   ============================================================ */

/* ── Theme definitions ─────────────────────────────────────── */

/* Light (default) — pure B&W, accent = black */
:root,
[data-theme="light"] {
    --app-bg:            #F5F5F7;
    --surface-primary:   #FFFFFF;
    --surface-secondary: #F5F5F7;
    --surface-tertiary:  #E8E8ED;
    --text-primary:      #1D1D1F;
    --text-secondary:    #6E6E73;
    --text-tertiary:     #AEAEB2;
    --accent-color:      #111111;
    --accent-secondary:  #3A3A3C;
    --border-color:      #D2D2D7;
    --hover-bg:          #EBEBF0;
    --card-bg:           #FFFFFF;
    --card-image-bg:     #F5F5F7;
    --nav-bg:            rgba(255,255,255,0.88);
    --shadow-color:      rgba(0,0,0,0.08);
    --sidebar-bg:        #FFFFFF;
    --sidebar-border:    #E5E5EA;
    --sidebar-active-bg: #F0F0F5;
}

[data-theme="rose"] {
    --app-bg:            #FFF5F5;
    --surface-primary:   #FFFFFF;
    --surface-secondary: #FFF0F0;
    --surface-tertiary:  #FFE4E4;
    --text-primary:      #2D1515;
    --text-secondary:    #8B5E5E;
    --text-tertiary:     #C4A0A0;
    --accent-color:      #E84393;
    --accent-secondary:  #FF8FAB;
    --border-color:      #FACCCC;
    --hover-bg:          #FDEAEA;
    --card-bg:           #FFFFFF;
    --card-image-bg:     #FFF0F0;
    --nav-bg:            rgba(255,255,255,0.88);
    --shadow-color:      rgba(232,67,147,0.12);
    --sidebar-bg:        #FFFFFF;
    --sidebar-border:    #FACCCC;
    --sidebar-active-bg: #FFF0F0;
}

[data-theme="dracula"] {
    --app-bg:            #282a36;
    --surface-primary:   #21222c;
    --surface-secondary: #343746;
    --surface-tertiary:  #44475a;
    --text-primary:      #f8f8f2;
    --text-secondary:    #8b8fa8;
    --text-tertiary:     #6272a4;
    --accent-color:      #bd93f9;
    --accent-secondary:  #50fa7b;
    --border-color:      #44475a;
    --hover-bg:          #343746;
    --card-bg:           rgba(33,34,44,0.9);
    --card-image-bg:     #343746;
    --nav-bg:            rgba(40,42,54,0.88);
    --shadow-color:      rgba(0,0,0,0.5);
    --sidebar-bg:        #21222c;
    --sidebar-border:    #44475a;
    --sidebar-active-bg: #343746;
}

[data-theme="dark"] {
    --app-bg:            #000000;
    --surface-primary:   #1C1C1E;
    --surface-secondary: #2C2C2E;
    --surface-tertiary:  #3A3A3C;
    --text-primary:      #FFFFFF;
    --text-secondary:    rgba(235,235,245,0.6);
    --text-tertiary:     rgba(235,235,245,0.3);
    --accent-color:      #0A84FF;
    --accent-secondary:  #30D158;
    --border-color:      #38383A;
    --hover-bg:          #2C2C2E;
    --card-bg:           rgba(28,28,30,0.8);
    --card-image-bg:     #2C2C2E;
    --nav-bg:            rgba(0,0,0,0.7);
    --shadow-color:      rgba(0,0,0,0.6);
    --sidebar-bg:        #1C1C1E;
    --sidebar-border:    #38383A;
    --sidebar-active-bg: #2C2C2E;
}

[data-theme="midnight"] {
    --app-bg:            #0D1117;
    --surface-primary:   #161B22;
    --surface-secondary: #21262D;
    --surface-tertiary:  #30363D;
    --text-primary:      #E6EDF3;
    --text-secondary:    #7D8590;
    --text-tertiary:     #484F58;
    --accent-color:      #58A6FF;
    --accent-secondary:  #3FB950;
    --border-color:      #30363D;
    --hover-bg:          #21262D;
    --card-bg:           rgba(22,27,34,0.85);
    --card-image-bg:     #21262D;
    --nav-bg:            rgba(13,17,23,0.88);
    --shadow-color:      rgba(0,0,0,0.6);
    --sidebar-bg:        #161B22;
    --sidebar-border:    #30363D;
    --sidebar-active-bg: #21262D;
}

/* ── App Shell Layout ──────────────────────────────────────── */

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--app-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────────────── */

.sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    padding: 20px 12px;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 20px;
    cursor: pointer;
    user-select: none;
}

.sidebar-logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
    letter-spacing: -0.01em;
    min-height: 36px;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--sidebar-active-bg);
}

.sidebar-link.active {
    color: var(--accent-color);
    background: var(--sidebar-active-bg);
    font-weight: 600;
}

.sidebar-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
    opacity: 1;
}

.sidebar-link--muted {
    font-size: 12px;
    color: var(--text-tertiary);
}

.sidebar-link--muted:hover {
    color: var(--text-secondary);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    padding-top: 12px;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 0;
}

/* ── Customize Panel in Sidebar ────────────────────────────── */

.sidebar-settings-wrap {
    position: relative;
}

.sidebar-customize-panel {
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-panel-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-panel-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
}

.sidebar-theme-row,
.sidebar-accent-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sidebar-theme-btn {
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--surface-tertiary);
    border: 1.5px solid transparent;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-theme-btn:hover { transform: scale(1.1); }
.sidebar-theme-btn.active { border-color: var(--accent-color); }

.sidebar-accent-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    padding: 0;
}

.sidebar-accent-dot:hover { transform: scale(1.15); }
.sidebar-accent-dot.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* ── Main Content ──────────────────────────────────────────── */

.main-content {
    margin-left: 200px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* Override existing nav styles — sidebar replaces it */
#nav { display: none !important; }

/* Adjust hero padding (no top nav) */
#hero {
    padding-top: 0 !important;
    min-height: 100vh;
}

.hero-inner {
    padding-top: 60px !important;
}

/* Section padding override for sidebar layout */
.section-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Hero headline — no gradient on accent, solid color only ── */
.hero-headline-accent {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: var(--accent-color) !important;
    background-clip: unset !important;
    color: var(--accent-color) !important;
}

/* Remove gradient-based badge secondary color */
.badge-sub {
    color: var(--accent-color) !important;
}

/* Product badge — single color */
.product-badge {
    background: var(--accent-color) !important;
}

/* CTA wrap — no gradient stripe */
.cta-wrap {
    background: var(--surface-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Eyebrow dots and badges */
.hero-eyebrow,
.section-eyebrow {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--accent-color) !important;
}

/* Button shadows — use accent with low opacity */
.btn-primary:hover {
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-color) 25%, transparent) !important;
}

/* ── Onboarding Overlay ─────────────────────────────────────── */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--app-bg, #F5F5F7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.onboarding-card {
    background: var(--surface-primary, #fff);
    border: 1px solid var(--border-color, #D2D2D7);
    border-radius: 20px;
    padding: 40px 40px 36px;
    max-width: 560px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}

.onboarding-logo {
    margin-bottom: 20px;
}

.onboarding-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary, #1D1D1F);
    margin: 0 0 8px;
}

.onboarding-sub {
    font-size: 14px;
    color: var(--text-secondary, #6E6E73);
    margin: 0 0 28px;
    line-height: 1.5;
}

.onboarding-section {
    width: 100%;
    margin-bottom: 24px;
    text-align: left;
}

.onboarding-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6E6E73);
    margin-bottom: 10px;
}

.onboarding-themes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color, #D2D2D7);
    background: var(--surface-primary, #fff);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6E6E73);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}

.theme-option:hover {
    color: var(--text-primary, #1D1D1F);
    border-color: var(--text-secondary, #6E6E73);
}

.theme-option.active {
    border-color: var(--accent-color, #111);
    color: var(--accent-color, #111);
    background: color-mix(in srgb, var(--accent-color, #111) 6%, transparent);
}

.theme-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.onboarding-accents {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.accent-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accent-option:hover { transform: scale(1.1); }

.accent-option.active {
    border-color: var(--text-primary, #1D1D1F);
    box-shadow: 0 0 0 2px var(--app-bg, #F5F5F7);
    transform: scale(1.05);
}

/* Checkmark inside active accent */
.accent-option.active::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Black accent gets dark checkmark */
.accent-option[data-accent="#111111"].active::after {
    color: #fff;
}

.onboarding-enter {
    width: 100%;
    padding: 15px 24px;
    border-radius: 12px;
    background: var(--accent-color, #111);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: opacity 0.15s, transform 0.12s;
    margin-top: 4px;
}

.onboarding-enter:hover {
    opacity: 0.88;
    transform: scale(1.01);
}

.onboarding-enter:active {
    transform: scale(0.98);
}

/* ── Light theme button text fix ───────────────────────────── */
[data-theme="light"] .onboarding-enter,
[data-theme="rose"] .onboarding-enter {
    color: #ffffff;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar {
        width: 56px;
        min-width: 56px;
        padding: 16px 8px;
    }

    .sidebar-logo-text,
    .sidebar-link span,
    .sidebar-link--muted span,
    .sidebar-customize-panel {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding: 8px 0 20px;
    }

    .sidebar-link {
        justify-content: center;
        padding: 10px;
    }

    .main-content {
        margin-left: 56px;
    }

    .onboarding-card {
        padding: 28px 20px 24px;
    }

    .onboarding-themes {
        flex-direction: column;
    }
}

