/* ═══════════════════════════════════════════════
   BrandMaker Pro — Design System
   Apple HIG Dark + Material You Dark inspired
   ═══════════════════════════════════════════════ */

:root {
    /* Surface hierarchy (Apple dark layered approach) */
    --bg-primary: #0d0d0d;
    --bg-elevated: #161616;
    --bg-card: #1c1c1e;
    --bg-card-hover: #232326;
    --bg-input: #2c2c2e;

    /* Text hierarchy */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;

    /* Accent — Apple blue */
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-subtle: rgba(10, 132, 255, 0.12);
    --accent-glow: rgba(10, 132, 255, 0.25);

    /* Borders & separators */
    --separator: rgba(255, 255, 255, 0.06);
    --separator-opaque: #2c2c2e;
    --border-focus: rgba(255, 255, 255, 0.15);

    /* Layout */
    --sidebar-width: 420px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ─── Reset ─── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-elevated);
    border-right: 1px solid var(--separator);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    z-index: 100;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--separator-opaque); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ─── Header ─── */
header { margin-bottom: 24px; position: relative; }
header h1 {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04rem;
    text-transform: uppercase;
    color: var(--text-primary);
}
header h1 span { font-weight: 300; color: var(--text-secondary); }
header p {
    color: var(--text-tertiary);
    font-size: 0.65rem;
    margin-top: 5px;
    letter-spacing: 0.02rem;
    font-weight: 500;
}

/* ─── Language Switch ─── */
.lang-switch { display: flex; gap: 6px; margin-top: 10px; }
.lang-btn {
    background: var(--bg-input);
    border: 1px solid transparent;
    color: var(--text-tertiary);
    font-size: 0.55rem;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}
.lang-btn:hover { color: var(--text-secondary); background: var(--bg-card-hover); }
.lang-btn.active { background: var(--accent); color: #fff; }

/* ─── Section Titles ─── */
.section-title {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 22px 0 10px 0;
    letter-spacing: 0.08rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--separator); }

/* ─── Controls Layout ─── */
.controls { display: flex; flex-direction: column; gap: 14px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.dual-control { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ─── Labels ─── */
label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.03rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ─── Value Badges ─── */
.val-badge { display: flex; align-items: center; gap: 2px; }
.val-num {
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 700;
    background: var(--accent-subtle);
    border: 1px solid transparent;
    padding: 2px 7px;
    border-radius: 5px;
    cursor: text;
    outline: none;
    min-width: 30px;
    text-align: center;
    transition: all 0.15s ease;
    font-family: 'SF Mono', 'Menlo', 'Roboto Mono', monospace;
}
.val-num:hover { border-color: var(--accent); }
.val-num:focus { background: rgba(10, 132, 255, 0.2); border-color: var(--accent); color: #fff; }
.val-unit { color: var(--text-tertiary); font-size: 0.5rem; font-weight: 600; }

/* ─── Text Inputs & Select ─── */
input[type="text"], select {
    background: var(--bg-input);
    border: 1px solid var(--separator);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}
input[type="text"]:focus, select:focus {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.06);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
select option { background: var(--bg-card); color: var(--text-primary); }

/* ─── Range Sliders ─── */
input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    background: var(--separator-opaque);
    height: 3px;
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-webkit-slider-thumb:active { transform: scale(0.95); }

/* ─── Color Inputs ─── */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: var(--separator-opaque);
    cursor: pointer;
    overflow: hidden;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }

/* ─── Ratio Buttons ─── */
.ratio-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.ratio-btn {
    background: var(--bg-input);
    border: 1px solid var(--separator);
    color: var(--text-secondary);
    padding: 9px;
    border-radius: var(--radius-sm);
    font-size: 0.58rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    font-family: inherit;
}
.ratio-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-focus); }
.ratio-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Upload Box ─── */
.upload-box {
    border: 1.5px dashed rgba(255,255,255,0.12);
    padding: 20px;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--bg-card);
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}
.upload-box:hover {
    border-color: var(--accent);
    border-style: solid;
    color: var(--text-primary);
    background: var(--accent-subtle);
}

/* ─── Primary Button (Export) ─── */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06rem;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 20px;
    font-family: inherit;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* ─── Tab Bar ─── */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    background: var(--bg-card);
    padding: 3px;
    border-radius: 10px;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 9px;
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.03rem;
    font-family: inherit;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { background: var(--accent); color: #fff; }

.tab-content { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Main Content (Canvas Area) ─── */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    background: var(--bg-primary);
}

#export-zone {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.checkerboard {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.025;
    background-image:
        linear-gradient(45deg, #fff 25%, transparent 25%),
        linear-gradient(-45deg, #fff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #fff 75%),
        linear-gradient(-45deg, transparent 75%, #fff 75%);
    background-size: 40px 40px;
}

.logo-container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.brand-text-row { display: flex; align-items: center; justify-content: center; white-space: nowrap; transition: none; }

/* ─── Zoom Info ─── */
.zoom-info {
    position: absolute;
    bottom: 24px;
    right: 32px;
    font-size: 0.55rem;
    color: var(--text-tertiary);
    letter-spacing: 0.08rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 6px;
}

/* ─── Navigator Panel ─── */
.navigator-panel {
    position: absolute;
    top: 24px;
    right: 32px;
    background: rgba(22, 22, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    cursor: default;
}
.nav-title {
    font-size: 0.48rem;
    color: var(--text-tertiary);
    letter-spacing: 0.12rem;
    margin-bottom: 8px;
    font-weight: 700;
}
.nav-wrap {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    border: 1px solid var(--separator);
}
#nav-symbol {
    background: var(--accent);
    outline: 1px solid rgba(10, 132, 255, 0.6);
    box-shadow: 0 0 8px rgba(10, 132, 255, 0.3);
    transition: all 0.3s ease;
}

/* ─── Guide Trigger Button ─── */
.help-trigger {
    background: var(--bg-input);
    border: 1px solid var(--separator);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.03rem;
}
.help-trigger:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-focus); }

/* ═══════════════════════════════════════════════
   Guide Overlay — Full Redesign (Dark)
   ═══════════════════════════════════════════════ */

#help-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
    z-index: 200;
    display: none;
    flex-direction: column;
}

.help-scroll {
    overflow-y: auto;
    padding: 0 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    -webkit-overflow-scrolling: touch;
}
.help-scroll::-webkit-scrollbar { width: 0; }

/* Hero */
.help-hero {
    text-align: center;
    padding: 40px 0 24px;
    position: relative;
}
.help-close {
    position: absolute;
    top: 12px;
    right: 0;
    font-size: 1rem;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-input);
    transition: all 0.15s ease;
    line-height: 1;
}
.help-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.help-hero-icon {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.04rem;
    margin-bottom: 12px;
}
.help-hero-icon span { font-weight: 300; color: var(--text-tertiary); }

.help-hero h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-transform: none;
}
.help-hero-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-weight: 400;
    max-width: 300px;
    margin: 0 auto;
}

/* Step Cards */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.help-card {
    background: var(--bg-card);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.15s ease;
}
.help-card:hover { background: var(--bg-card-hover); border-color: var(--border-focus); }
.help-card-icon {
    width: 26px;
    height: 26px;
    background: var(--accent);
    color: #fff;
    border-radius: 7px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.help-card h3 {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.01em;
    margin-top: 2px;
}
.help-card p {
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 400;
}

/* Feature Section */
.help-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 16px 14px;
}
.help-section h3 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}
.help-feature-list { display: flex; flex-direction: column; gap: 9px; }
.help-feature-item { display: flex; align-items: flex-start; gap: 10px; }
.help-feat-dot {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.help-feature-item p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.45;
    font-weight: 400;
}

/* Tip Box */
.help-tip-box {
    background: var(--accent-subtle);
    border: 1px solid rgba(10, 132, 255, 0.15);
    border-left: 3px solid var(--accent);
}
.help-tip-box h3 {
    color: var(--accent);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06rem;
}
.help-tip-box p { color: var(--text-secondary); }

/* Dismiss Button */
.help-dismiss {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.78rem;
    letter-spacing: 0;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 4px;
    font-family: inherit;
}
.help-dismiss:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}
