/* Tailwind → CSS Playground — style.css */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    --bg: #0E1016;
    --panel: #161820;
    --surface: #1E2032;
    --surface2: #252840;
    --border: #2C3050;
    --primary: #06B6D4;
    /* Tailwind teal-500 */
    --accent: #8B5CF6;
    --warn: #F59E0B;
    --success: #10B981;
    --text: #E2E8F0;
    --muted: #64748B;
    --code-kw: #06B6D4;
    --code-prop: #A78BFA;
    --code-val: #34D399;
    --code-at: #F472B6;
    --code-grp: #FBBF24;
    --radius: 8px;
    --header-h: 52px;
}

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

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ── App Shell ───────────────────────────────────────────── */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ── Header ──────────────────────────────────────────────── */
.app-header {
    height: var(--header-h);
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
}

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

.logo-mark {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--muted);
}

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

.version-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

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

/* ── Split Pane ──────────────────────────────────────────── */
.split-pane {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 0;
    gap: 0;
}

/* ── Pane ────────────────────────────────────────────────── */
.pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.pane:last-child {
    border-right: none;
}

.pane-header {
    height: 36px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}

.pane-title {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text);
}

.pane-hint {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.66rem;
    margin-left: 6px;
}

.pane-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover {
    color: var(--text);
    border-color: var(--primary);
}

.action-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    outline: none;
}

/* ── Code Input ──────────────────────────────────────────── */
.code-input {
    flex: 1;
    width: 100%;
    resize: none;
    background: var(--bg);
    color: var(--text);
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    padding: 14px;
    min-height: 180px;
    tab-size: 2;
}

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

.pane-input {
    overflow-y: auto;
}

/* Batch section */
.batch-section {
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.batch-header {
    height: 30px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.batch-input {
    max-height: 110px;
}

/* ── Warnings ────────────────────────────────────────────── */
.warnings-area {
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.06);
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 0.72rem;
    color: var(--warn);
    font-family: 'JetBrains Mono', monospace;
}

.warnings-area.hidden {
    display: none;
}

.warn-item::before {
    content: '⚠ ';
}

/* ── CSS Output ──────────────────────────────────────────── */
.css-output {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    white-space: pre;
    background: var(--bg);
}

.css-empty {
    color: var(--muted);
    font-size: 0.75rem;
    margin: 40px auto;
    text-align: center;
}

/* Syntax highlight tokens */
.tok-selector {
    color: var(--code-grp);
}

.tok-at {
    color: var(--code-at);
}

.tok-prop {
    color: var(--code-prop);
}

.tok-val {
    color: var(--code-val);
}

.tok-punc {
    color: var(--muted);
}

.tok-comment {
    color: #445;
    font-style: italic;
}

.tok-group {
    color: var(--code-kw);
    font-weight: 600;
}

/* ── Preview Pane ────────────────────────────────────────── */
.preview-area {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    position: relative;
}

.preview-area.dark-bg {
    background: #111;
}

.preview-hint {
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
}

#preview-elem {
    max-width: 100%;
    word-break: break-word;
    font-family: 'Inter', sans-serif;
}

/* ── Batch Output ────────────────────────────────────────── */
.batch-output {
    border-top: 1px solid var(--border);
    overflow-y: auto;
    max-height: 200px;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    background: var(--bg);
    white-space: pre;
}

.batch-output.hidden {
    display: none;
}

.batch-elem-header {
    color: var(--code-kw);
    font-weight: 600;
}

/* ── Toast ───────────────────────────────────────────────── */
#toast-wrap {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.78rem;
    color: var(--text);
    max-width: 240px;
    animation: fade-up 0.2s ease;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--success);
}

.toast.error {
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--warn);
}

@keyframes fade-up {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .split-pane {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pane {
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .code-input {
        min-height: 120px;
    }
}