/* ============================================================
   TSConfig Wizard — Styles
   Theme: Dark mode with Emerald Green palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
    --primary: #00B894;
    --primary-rgb: 0, 184, 148;
    --secondary: #55EFC4;
    --secondary-rgb: 85, 239, 196;
    --accent: #FDCB6E;
    --accent-rgb: 253, 203, 110;
    --bg: #0A1A14;
    --bg-card: rgba(10, 30, 22, 0.7);
    --bg-surface: rgba(0, 184, 148, 0.06);
    --bg-hover: rgba(0, 184, 148, 0.1);
    --bg-active: rgba(0, 184, 148, 0.15);
    --border: rgba(0, 184, 148, 0.15);
    --border-hover: rgba(0, 184, 148, 0.3);
    --text: #E8F5E9;
    --text-secondary: #81C784;
    --text-muted: rgba(232, 245, 233, 0.5);
    --danger: #FF6B6B;
    --warning: #FDCB6E;
    --info: #74B9FF;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 250ms ease;
    --glass-bg: rgba(10, 30, 22, 0.6);
    --glass-border: rgba(0, 184, 148, 0.12);
    --glass-blur: blur(20px);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(var(--primary-rgb), 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(var(--secondary-rgb), 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(var(--accent-rgb), 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.header h1 .icon {
    -webkit-text-fill-color: initial;
    margin-right: 0.3rem;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* ── Preset Bar ─────────────────────────────────────────────── */
.presets-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.preset-btn:hover,
.preset-btn:focus-visible {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.15);
}

.preset-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.preset-btn.active {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Main Grid ──────────────────────────────────────────────── */
.main-grid {
    display: grid;
    grid-template-columns: 240px 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}

/* ── Sidebar (Category Nav) ─────────────────────────────────── */
.sidebar {
    position: sticky;
    top: 1rem;
}

.category-nav {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.category-nav h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.category-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.category-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.category-btn.active {
    background: var(--bg-active);
    color: var(--primary);
    font-weight: 500;
}

.category-btn .count {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-surface);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.category-btn.active .count {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
}

/* ── Options Panel ──────────────────────────────────────────── */
.options-panel {
    min-height: 400px;
}

.options-panel h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.options-panel .category-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* ── Option Cards ───────────────────────────────────────────── */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: all var(--transition);
    cursor: pointer;
}

.option-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.option-card.enabled {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.option-card.has-warning {
    border-color: var(--warning);
}

.option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.option-name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary);
}

.option-card.enabled .option-name {
    color: var(--primary);
}

.option-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    border: none;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.option-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition);
}

.option-toggle.on {
    background: var(--primary);
}

.option-toggle.on::after {
    transform: translateX(18px);
    background: #fff;
}

.option-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.option-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.option-value label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.option-value select,
.option-value input[type="text"] {
    flex: 1;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all var(--transition);
}

.option-value select:focus,
.option-value input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.option-value select option {
    background: var(--bg);
}

/* Tags */
.option-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.tag.deprecated {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.tag.recommended {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

.tag.new {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

/* Warning */
.option-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    background: rgba(253, 203, 110, 0.08);
    border: 1px solid rgba(253, 203, 110, 0.2);
    font-size: 0.75rem;
    color: var(--warning);
    line-height: 1.4;
}

.option-warning .warn-icon {
    flex-shrink: 0;
}

/* ── Path Alias Builder ─────────────────────────────────────── */
.path-alias-section {
    margin-top: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.path-alias-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.alias-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.alias-row input {
    flex: 1;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all var(--transition);
}

.alias-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.alias-row .arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.alias-remove-btn {
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--danger);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.alias-remove-btn:hover {
    background: rgba(255, 107, 107, 0.1);
}

.alias-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 0.5rem;
}

.alias-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Output Panel ───────────────────────────────────────────── */
.output-panel {
    position: sticky;
    top: 1rem;
}

.output-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.output-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.output-tab {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.output-tab:hover {
    color: var(--text-secondary);
}

.output-tab.active {
    color: var(--primary);
}

.output-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.output-code-wrap {
    position: relative;
    max-height: 500px;
    overflow-y: auto;
}

.output-code-wrap::-webkit-scrollbar {
    width: 6px;
}

.output-code-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.output-code-wrap::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 3px;
}

.output-code {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    white-space: pre;
    color: var(--text-secondary);
    tab-size: 2;
}

/* Diff view */
.diff-line {
    display: block;
}

.diff-line.added {
    background: rgba(0, 184, 148, 0.1);
    color: var(--secondary);
}

.diff-line.removed {
    background: rgba(255, 107, 107, 0.1);
    color: var(--danger);
    text-decoration: line-through;
    opacity: 0.7;
}

.diff-line.unchanged {
    opacity: 0.4;
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.action-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.action-btn.primary-btn {
    background: linear-gradient(135deg, var(--primary), #00a884);
    border-color: var(--primary);
    color: #fff;
}

.action-btn.primary-btn:hover {
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
    transform: translateY(-1px);
}

/* ── Compatibility Matrix ───────────────────────────────────── */
.compat-section {
    margin-top: 1.5rem;
}

.compat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.compat-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.compat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.compat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.75rem;
    transition: all var(--transition);
}

.compat-item .compat-icon {
    font-size: 1rem;
}

.compat-item .compat-label {
    color: var(--text-muted);
    text-align: center;
}

.compat-item.supported {
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.compat-item.partial {
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.compat-item.unsupported {
    border: 1px solid rgba(255, 107, 107, 0.2);
    opacity: 0.6;
}

/* ── Toast Notification ─────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 300ms ease;
    z-index: 1000;
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .main-grid {
        grid-template-columns: 200px 1fr;
    }

    .output-panel {
        grid-column: 1 / -1;
        position: static;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .main-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar {
        position: static;
    }

    .category-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .category-nav h3 {
        width: 100%;
    }

    .category-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    .category-btn .count {
        display: none;
    }

    .output-panel {
        position: static;
    }

    .presets-bar {
        gap: 0.5rem;
    }

    .preset-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }

    .alias-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.4rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .output-actions {
        flex-direction: column;
    }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-card {
    animation: fadeIn 200ms ease forwards;
}

.options-list .option-card:nth-child(2) {
    animation-delay: 40ms;
}

.options-list .option-card:nth-child(3) {
    animation-delay: 80ms;
}

.options-list .option-card:nth-child(4) {
    animation-delay: 120ms;
}

.options-list .option-card:nth-child(5) {
    animation-delay: 160ms;
}

.options-list .option-card:nth-child(6) {
    animation-delay: 200ms;
}

.options-list .option-card:nth-child(7) {
    animation-delay: 240ms;
}

.options-list .option-card:nth-child(8) {
    animation-delay: 280ms;
}