/**
 * Tymoshenko — Widget Builder page styles (v1.6.353)
 * Used by: page-widget-builder.php
 */

body.page-template-page-widget-builder,
body.page-template-page-widget-builder-php,
body.page-widget-builder {
    background: #0B0E11;
    color: #EAECEF;
}

.wb-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.wb-page-hd {
    padding: 48px 0 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 32px;
}
.wb-page-hd h1 {
    margin: 0 0 8px;
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--t1);
}
.wb-page-hd p {
    margin: 0;
    color: var(--t2);
}

.wb-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    margin-bottom: 64px;
    align-items: start;
}

/* Controls panel */
.wb-controls {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 80px;
}
.wb-grp { margin-bottom: 20px; }
.wb-grp:last-of-type { margin-bottom: 24px; }

.wb-lbl {
    display: block;
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--t3);
    margin-bottom: 8px;
    font-weight: 700;
}

.wb-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    color: var(--t1);
    font-family: 'Onest', system-ui, sans-serif;
    font-size: 13px;
    cursor: pointer;
}
.wb-select:focus {
    outline: none;
    border-color: var(--amber);
}

.wb-seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.wb-seg-2 { grid-template-columns: repeat(2, 1fr); }
.wb-seg-3 { grid-template-columns: repeat(3, 1fr); }

.wb-seg-btn {
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--t3);
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}
.wb-seg-btn:hover {
    background: var(--bg-3);
    color: var(--t1);
}
.wb-seg-btn.is-active {
    background: rgba(240, 185, 11, .1);
    color: var(--amber);
}
.wb-flag {
    font-family: 'Onest', system-ui, sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -.02em;
    line-height: 1;
}
.wb-flag-name {
    font-size: 9px;
    color: var(--t4);
    font-weight: 600;
    letter-spacing: .04em;
}
.wb-seg-btn.is-active .wb-flag-name {
    color: var(--amber);
}

/* v1.6.357: custom width input */
.wb-width-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.wb-width-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    color: var(--t1);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    -moz-appearance: textfield;
}
.wb-width-input:focus {
    outline: none;
    border-color: var(--amber);
}
.wb-width-input::-webkit-outer-spin-button,
.wb-width-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.wb-width-clear {
    padding: 0 12px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    color: var(--t3);
    font-family: 'Onest', system-ui, sans-serif;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.wb-width-clear:hover {
    background: var(--bg-3);
    color: var(--t1);
}
.wb-width-hint {
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--t3);
    line-height: 1.4;
}
.wb-width-hint.is-set {
    color: var(--amber);
}

/* Snippet output */
.wb-snippet {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    position: relative;
}
.wb-snippet pre {
    margin: 0;
    padding: 14px;
    background: var(--bg-0);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--t2);
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
}
.wb-copy-btn {
    margin-top: 10px;
    padding: 10px 16px;
    background: var(--amber);
    color: var(--bg-0);
    border: none;
    border-radius: 8px;
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    width: 100%;
}
.wb-copy-btn:hover {
    background: var(--yellow);
}

/* Preview */
.wb-preview {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}
.wb-preview-stage {
    flex: 1;
    /* v1.6.354 — neutral grey instead of pure-white-ish: makes light-theme widgets visible
       (light theme uses --bg-1: #FAFAFA which would blend into #f4f6f8). */
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 8px, transparent 8px 16px),
        #6c7a85;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    min-height: 480px;
    position: relative;
}
/* Preview hint — small label so it's clear this is the rendered output area. */
.wb-preview-stage::before {
    content: 'PREVIEW';
    position: absolute;
    top: 12px;
    left: 16px;
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .35);
}

/* Responsive */
@media (max-width: 900px) {
    .wb-grid { grid-template-columns: 1fr; }
    .wb-controls { position: relative; top: 0; }
    .wb-page-hd h1 { font-size: 22px; }
    .wb-preview-stage { min-height: 320px; padding: 24px 16px; }
}
