/* SQL Formatter — style.css — Custom supplement to Tailwind */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Options bar ─────────────────────────────────── */
.opt-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: #6B7280;
    white-space: nowrap;
}

.opt-sel {
    background: #111827;
    border: 1px solid #374151;
    color: #E5E7EB;
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 0.72rem;
    font-family: 'Inter', system-ui;
    outline: none;
    cursor: pointer;
}

.opt-sel:focus {
    border-color: #6C5CE7;
}

/* Toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.toggle-wrap input[type=checkbox] {
    display: none;
}

.toggle {
    width: 30px;
    height: 15px;
    background: #374151;
    border-radius: 8px;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #9CA3AF;
    transition: all 0.15s;
}

.toggle-wrap input:checked+.toggle {
    background: #6C5CE7;
}

.toggle-wrap input:checked+.toggle::after {
    left: 17px;
    background: white;
}

/* ── Buttons ──────────────────────────────────────── */
.btn-accent {
    background: #6C5CE7;
    color: white;
    border-radius: 7px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.13s;
    font-family: 'Inter', system-ui;
}

.btn-accent:hover {
    background: #7D6FED;
}

.btn-accent:active {
    transform: scale(0.97);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #9CA3AF;
    border: 1px solid #374151;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.13s;
    font-family: 'Inter', system-ui;
    font-weight: 500;
}

.btn-ghost:hover {
    color: #E5E7EB;
    border-color: #6C5CE7;
}

/* ── Main split layout ────────────────────────────── */
.main-split {
    display: grid;
    grid-template-columns: 1fr 4px 1fr;
    height: calc(100vh - 94px);
}

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

.panel-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #1F2937;
    background: rgba(17, 24, 39, 0.8);
    flex-shrink: 0;
}

.panel-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #9CA3AF;
}

.panel-footer {
    padding: 4px 12px;
    font-size: 0.6rem;
    color: #4B5563;
    border-top: 1px solid #1F2937;
    background: rgba(17, 24, 39, 0.5);
    flex-shrink: 0;
}

/* Splitter */
.splitter {
    background: #1F2937;
    cursor: col-resize;
}

.splitter:hover {
    background: #6C5CE7;
}

/* ── SQL inputs ────────────────────────────────────── */
.sql-ta {
    flex: 1;
    background: #090D14;
    color: #C9D1D9;
    border: none;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.sql-ta::placeholder {
    color: #374151;
}

/* ── Output ────────────────────────────────────────── */
.out-wrap {
    flex: 1;
    display: flex;
    overflow: auto;
    background: #090D14;
}

.line-nums {
    padding: 12px 8px 12px 12px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #374151;
    user-select: none;
    flex-shrink: 0;
    border-right: 1px solid #1F2937;
    min-width: 38px;
}

.sql-pre {
    flex: 1;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    white-space: pre;
    overflow: visible;
    color: #C9D1D9;
    margin: 0;
}

/* ── SQL Syntax Highlighting ─────────────────────── */
.kw {
    color: #A29BFE;
    font-weight: 700;
}

/* Keywords      */
.fn {
    color: #FD79A8;
}

/* Functions     */
.str {
    color: #55EFC4;
}

/* Strings       */
.num {
    color: #FDCB6E;
}

/* Numbers       */
.cmt {
    color: #4A5568;
    font-style: italic;
}

/* Comments      */
.op {
    color: #74B9FF;
}

/* Operators     */
.id {
    color: #DFE6E9;
}

/* Identifiers   */
.punc {
    color: #6B7280;
}

/* Punctuation   */

/* ── Toast ─────────────────────────────────────────── */
.toast {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 0.78rem;
    font-family: 'Inter', system-ui;
    animation: slide-up .2s ease;
}

.toast.ok {
    border-color: rgba(108, 92, 231, .35);
    color: #A29BFE;
}

.toast.err {
    border-color: rgba(248, 113, 113, .35);
    color: #F87171;
}

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

@media (max-width: 700px) {
    .main-split {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 4px 1fr;
        height: auto;
    }

    .splitter {
        cursor: row-resize;
    }
}