/* Web Components Playground — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #0e0e18;
    --bg2: #13131f;
    --bg3: #191926;
    --bg4: #20203a;
    --border: #22223a;
    --border2: rgba(255, 255, 255, 0.05);
    --text: #d4d4ff;
    --text2: #5a5a90;
    --text3: #30306a;
    --primary: #7c6af7;
    --primary2: #a89bfe;
    --primary3: #5a4cc8;
    --accent: #f97316;
    --green: #34d399;
    --pink: #f472b6;
    --radius: 12px;
    --t: all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 55% 40% at 8% 4%, rgba(124, 106, 247, 0.1), transparent), radial-gradient(ellipse 40% 25% at 92% 88%, rgba(249, 115, 22, 0.05), transparent);
    z-index: 0;
}

/* Header */
header {
    background: rgba(14, 14, 24, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hdr {
    max-width: 100%;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c6af7, #5a4cc8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 0 16px rgba(124, 106, 247, 0.3);
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
}

h1.brand-title {
    display: inline;
}

.brand-sub {
    font-size: 10px;
    color: var(--text3);
}

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

kbd {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 3px;
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
}

/* Layout */
.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: relative;
    z-index: 1;
    min-height: 0;
    overflow: hidden;
}

.left-col,
.right-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-col {
    border-right: 1px solid var(--border);
}

/* Templates strip */
.templates-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border2);
    overflow-x: auto;
    flex-shrink: 0;
}

.tpl-label {
    font-size: 10px;
    color: var(--text3);
    white-space: nowrap;
}

.tpl-btns {
    display: flex;
    gap: 4px;
}

.tpl-btn {
    padding: 3px 9px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--bg3);
    font-size: 10px;
    cursor: pointer;
    transition: var(--t);
    color: var(--text2);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.tpl-btn:hover {
    border-color: var(--primary);
    color: var(--primary2);
}

/* Editor tabs */
.editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    flex-shrink: 0;
}

.etab {
    padding: 7px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text2);
    font-family: 'Inter', sans-serif;
    transition: var(--t);
}

.etab.active {
    border-bottom-color: var(--primary);
    color: var(--primary2);
}

.etab:hover {
    color: var(--primary2);
}

/* Editors */
.editor-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.editor {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.65;
    padding: 14px;
    outline: none;
    resize: none;
    tab-size: 2;
}

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

/* Editor footer */
.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--bg2);
    border-top: 1px solid var(--border2);
    flex-shrink: 0;
}

.ed-hint {
    font-size: 10px;
    color: var(--text3);
}

/* Panels */
.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border2);
    flex-shrink: 0;
    background: var(--bg2);
}

.panel-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text3);
}

/* Preview */
.preview-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border-bottom: 1px solid var(--border);
}

.preview-frame {
    flex: 1;
    background: #fff;
    border: none;
    min-height: 0;
}

/* Status */
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.status-dot.error {
    background: var(--pink);
}

.status-txt {
    font-size: 10px;
    color: var(--text2);
}

/* Event log */
.log-panel {
    display: flex;
    flex-direction: column;
    height: 160px;
    border-bottom: 1px solid var(--border);
}

.event-log {
    flex: 1;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-empty {
    color: var(--text3);
}

.log-entry {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.log-time {
    color: var(--text3);
    flex-shrink: 0;
}

.log-evt {
    color: var(--primary2);
}

.log-detail {
    color: var(--text2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Inspector */
.inspector-panel {
    display: flex;
    flex-direction: column;
    height: 180px;
}

.inspector-output {
    flex: 1;
    overflow: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text2);
    padding: 10px 12px;
    white-space: pre;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
}

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

.btn-sm {
    padding: 3px 9px;
    font-size: 10px;
    border-radius: 6px;
}

/* Toast */
.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid rgba(124, 106, 247, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
}

.toast.show {
    transform: none;
    opacity: 1;
}

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

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

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

@media(max-width:900px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh 1fr;
    }

    .left-col {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}