/* ─── Design Tokens — Indigo Fusion ─────────────────────────────── */
:root {
    --primary: #667EEA;
    --primary-dim: rgba(102, 126, 234, 0.15);
    --secondary: #764BA2;
    --accent: #F093FB;
    --accent-dim: rgba(240, 147, 251, 0.15);
    --success: #48BB78;
    --danger: #FC8181;

    --bg: #0F0E17;
    --bg-elevated: #1A1830;
    --bg-card: rgba(26, 24, 48, 0.7);
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(102, 126, 234, 0.15);
    --border-strong: rgba(102, 126, 234, 0.3);

    --text: #FFFFFE;
    --text-dim: rgba(255, 255, 254, 0.6);
    --text-muted: rgba(255, 255, 254, 0.35);

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --transition: 200ms ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 48px;
}

/* ─── Header ────────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-brand h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.toggle-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-btn.active {
    background: var(--primary-dim);
    color: var(--primary);
}

.toggle-btn:hover:not(.active) {
    background: var(--surface);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-dim);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--primary);
}

/* ─── Editor Section ────────────────────────────────────────────── */
.editor-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 500px;
}

.panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 0.9rem;
    font-weight: 600;
}

.panel-actions {
    display: flex;
    gap: 6px;
}

.code-editor {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.code-editor::placeholder {
    color: var(--text-muted);
}

.code-output {
    color: var(--accent);
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.kbd-hint {
    font-family: var(--font-mono);
}

/* ─── Info Bar ──────────────────────────────────────────────────── */
.info-bar {
    margin-top: 16px;
    animation: fadeIn 300ms ease;
}

.info-card {
    padding: 12px 20px;
}

.info-items {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.info-item {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.info-item strong {
    color: var(--primary);
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

@media (max-width: 768px) {
    .editor-section {
        grid-template-columns: 1fr;
        min-height: 300px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }
}