/* =====================================================
   YAML ⇄ JSON Converter — style.css
   Minimalist dark/light, neutral grays + teal accent
   ===================================================== */

:root {
    --accent: #14B8A6;
    --accent-yaml: #8B5CF6;
    --accent-json: #F59E0B;
    --bg: #111827;
    --surface: #1F2937;
    --surface2: #283345;
    --border: rgba(255, 255, 255, 0.07);
    --text: #F9FAFB;
    --text-muted: #6B7280;
    --radius: 10px;
    --tr: 0.18s ease;
    --header-h: 50px;
    --footer-h: 36px;
}

[data-theme="light"] {
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --surface2: #F9FAFB;
    --border: rgba(0, 0, 0, 0.09);
    --text: #111827;
    --text-muted: #6B7280;
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    transition: background var(--tr);
}

::-webkit-scrollbar {
    width: 4px;
}

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

.hidden {
    display: none !important;
}

/* Header */
.header {
    height: var(--header-h);
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-pill {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.logo-pill.yaml {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-yaml);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.logo-pill.json {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-json);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.logo-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.logo svg {
    color: var(--text-muted);
}

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

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 5px 11px;
    cursor: pointer;
    transition: all var(--tr);
}

.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Global error */
.global-error {
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 6px 20px;
}

/* Panels */
.panels {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    overflow: hidden;
    min-height: 0;
}

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

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

.panel-lang {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.panel-lang.yaml {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-yaml);
}

.panel-lang.json {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-json);
}

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

.status-indicator {
    font-size: 0.68rem;
    min-width: 55px;
    text-align: right;
}

.status-ok {
    color: #10B981;
}

.status-error {
    color: #EF4444;
}

.btn-sm {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 3px 8px;
    cursor: pointer;
    transition: all var(--tr);
}

.btn-sm:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.indent-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.indent-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.indent-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 2px 6px;
    outline: none;
    cursor: pointer;
}

/* Editor */
.editor-wrap {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.line-ruler {
    background: var(--surface2);
    border-right: 1px solid var(--border);
    padding: 12px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: right;
    min-width: 40px;
    user-select: none;
    overflow: hidden;
}

.editor {
    flex: 1;
    background: var(--surface);
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    padding: 12px;
    resize: none;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    tab-size: 2;
}

.editor.error-highlight {
    border-left: 3px solid #EF4444;
}

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

.editor:focus {
    outline: none;
}

/* Divider */
.divider {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.swap-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.25);
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr);
}

.swap-btn:hover {
    background: rgba(20, 184, 166, 0.22);
    transform: scale(1.1);
}

/* Stats footer */
.stats-footer {
    height: var(--footer-h);
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 16px;
    overflow: hidden;
}

.stat-item {
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 0 14px;
    border-right: 1px solid var(--border);
}

.stat-item:last-child {
    border-right: none;
}

.stat-item span {
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 720px) {
    .panels {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 1fr;
    }

    .divider {
        width: auto;
        height: 36px;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        flex-direction: row;
    }

    .swap-btn {
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(90deg) scale(1.1);
    }
}