* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --app-bg: #0f172a;
    --app-surface: rgba(30, 41, 59, 0.4);
    --app-border: rgba(148, 163, 184, 0.1);
    --app-text: #f8fafc;
    --app-text-muted: #94a3b8;
    --app-primary: #46a8d0;
    --header-bg: rgba(15, 23, 42, 0.8);
    --input-bg: rgba(15, 23, 42, 0.8);
    --icon-opt-bg: rgba(15, 23, 42, 0.5);
    --btn-secondary-hover: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-border: #e2e8f0;
    --app-text: #0f172a;
    --app-text-muted: #64748b;
    --header-bg: rgba(248, 250, 252, 0.8);
    --input-bg: #ffffff;
    --icon-opt-bg: #f1f5f9;
    --btn-secondary-hover: rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--app-bg);
    color: var(--app-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--app-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-toggle {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.theme-toggle:hover {
    border-color: var(--app-primary);
    transform: scale(1.1);
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.logo span {
    color: var(--app-primary);
}

/* Top Menu */
.top-menu {
    display: flex;
    gap: 2rem;
}
.top-menu a {
    text-decoration: none;
    color: var(--app-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.top-menu a:hover { color: var(--app-primary); }
.top-menu a.active { color: var(--app-text); position: relative; }
.top-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -1.7rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--app-primary);
    border-radius: 2px;
}

/* Wizard Layout */
.wizard-container {
    max-width: 1200px;
    margin: 2rem auto 8rem auto; /* Extra bottom margin for sticky nav */
    padding: 0 2rem;
    flex: 1;
    width: 100%;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}
.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-header {
    text-align: center;
    margin-bottom: 3rem;
}
.step-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}
.step-header p {
    color: var(--app-text-muted);
    font-size: 1.1rem;
}

/* Base Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}
.btn-primary {
    background: var(--app-primary);
    color: white;
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--app-border);
    color: var(--app-text);
}
.btn-secondary:hover {
    background: var(--btn-secondary-hover);
}

/* Step 1: Theme Select */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}
.theme-card {
    background: var(--app-surface);
    border: 2px solid var(--app-border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s;
}
.theme-card:hover {
    border-color: var(--app-primary);
    transform: translateY(-5px);
}
.theme-card i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}
.theme-card.light i { color: #facc15; }
.theme-card.dark i { color: #818cf8; }

/* Step 2: Palette Grid */
.mode-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.segments {
    display: flex;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    padding: 0.25rem;
    border-radius: 0.75rem;
}
.segment {
    background: transparent;
    border: none;
    color: var(--app-text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.segment.active {
    background: var(--app-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(70, 168, 208, 0.3);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}
.palette-card {
    background: var(--app-surface);
    border: 2px solid var(--app-border);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.palette-card:hover {
    border-color: var(--app-primary);
    transform: translateY(-3px);
}
.palette-card.selected {
    border-color: var(--app-primary);
    background: rgba(70, 168, 208, 0.1);
}
.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}
.palette-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    background: var(--app-primary);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.swatch-row {
    display: flex;
    gap: 0.5rem;
    height: 40px;
    border-radius: 0.5rem;
    overflow: hidden;
}
.swatch {
    flex: 1;
    cursor: copy;
    transition: transform 0.2s, filter 0.2s;
}
.swatch:hover {
    transform: scaleY(1.1);
    filter: brightness(1.2);
    z-index: 1;
}

/* Step 3: Brand Form */
.brand-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--app-surface);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--app-border);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--app-text-muted);
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
}
.form-control:focus {
    border-color: var(--app-primary);
}
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.icon-opt {
    background: var(--icon-opt-bg);
    border: 2px solid var(--app-border);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
    color: var(--app-text);
}
.icon-opt:hover { border-color: var(--app-primary); }
.icon-opt.selected { border-color: var(--app-primary); background: rgba(70, 168, 208, 0.2); }

.preview-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-bottom: 2rem;
}
.preview-column.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.advanced-tool-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    padding: 1.5rem;
}
.advanced-tool-card h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-text);
}

/* Gradients & Buttons Grids */
.grad-grid, .btn-gen-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.grad-item {
    height: 60px;
    border-radius: 0.5rem;
    cursor: copy;
    transition: transform 0.2s;
}
.grad-item:hover { transform: scale(1.05); }

.btn-sample {
    padding: 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    cursor: copy;
    border: none;
}

/* Documentation Styles */
.docs-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    padding: 3rem;
}
.docs-section {
    margin-bottom: 3rem;
}
.docs-section h3 {
    margin-bottom: 1rem;
}
.code-block {
    background: #000;
    color: #10b981;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Dropdown */
.export-dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--app-surface);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 0.5rem;
    border: 1px solid var(--app-border);
    margin-top: 0.5rem;
    overflow: hidden;
}
.dropdown-content a {
    color: var(--app-text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.dropdown-content a:hover {background-color: var(--app-primary); color: white;}
.show {display:block;}

.preview-wrapper {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #000;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 auto;
}
.preview-wrapper.mobile {
    width: 375px;
}

/* Tuner Grid */
.tuner-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tuner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--app-text-muted);
}
.tuner-row input[type="color"] {
    border: none;
    width: 30px;
    height: 30px;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
}
.tuner-row input::-webkit-color-swatch {
    border-radius: 50%;
    border: 1px solid var(--app-border);
}
.preview-browser-header {
    background: rgba(15, 23, 42, 1);
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.browser-dot.r { background: #ef4444; }
.browser-dot.y { background: #facc15; }
.browser-dot.g { background: #22c55e; }

/* Global Nav Footer inside Wizard */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--app-border);
}
