/* ========== Symbol Editor - Full Screen Layout ========== */

.symbol-editor-fullscreen {
    position: fixed;
    inset: 0;
    background: var(--lb-bg-base, #0a0a0f);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.symbol-editor-root {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ========== Header Bar ========== */

.symbol-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 48px;
    background: var(--lb-bg-elevated, #12121a);
    border-bottom: 1px solid var(--lb-border-default, #2a2a3a);
    flex-shrink: 0;
}

.symbol-editor-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.symbol-editor-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lb-accent-primary, #d4af37);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.symbol-editor-logo:hover {
    color: #e8c547;
}

.symbol-editor-title {
    color: var(--lb-text-primary, #e8e8ed);
    font-size: 13px;
    font-weight: 500;
}

.symbol-editor-status {
    font-size: 11px;
    color: var(--lb-text-muted, #6b6b7b);
    padding: 4px 8px;
    background: var(--lb-bg-surface, #16161f);
    border-radius: 4px;
}

.symbol-editor-status.dirty {
    color: #f59e0b;
}

/* ========== Main Layout ========== */

.symbol-editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== Left Sidebar ========== */

.symbol-editor-sidebar-left {
    width: 220px;
    background: var(--lb-bg-elevated, #12121a);
    border-right: 1px solid var(--lb-border-default, #2a2a3a);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.symbol-editor-sidebar-left.collapsed {
    width: 0;
    border-right: none;
    overflow: hidden;
}

/* ========== Right Sidebar ========== */

.symbol-editor-sidebar-right {
    width: 200px;
    background: var(--lb-bg-elevated, #12121a);
    border-left: 1px solid var(--lb-border-default, #2a2a3a);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.symbol-editor-sidebar-right.collapsed {
    width: 0;
    border-left: none;
    overflow: hidden;
}

/* ========== Panel Sections ========== */

.symbol-editor-panel-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--lb-border-default, #2a2a3a);
}

.symbol-editor-panel-section:last-child {
    border-bottom: none;
    flex: 1;
}

.symbol-editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lb-text-muted, #6b6b7b);
    background: var(--lb-bg-surface, #16161f);
    cursor: pointer;
    user-select: none;
}

.symbol-editor-panel-header:hover {
    color: var(--lb-text-primary, #e8e8ed);
}

.symbol-editor-panel-content {
    padding: 10px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== Canvas Area ========== */

.symbol-editor-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--lb-bg-base, #0a0a0f);
    overflow: hidden;
}

/* ========== Toolbar ========== */

.symbol-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--lb-bg-elevated, #12121a);
    border-bottom: 1px solid var(--lb-border-default, #2a2a3a);
    flex-shrink: 0;
}

.symbol-editor-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: var(--lb-bg-surface, #16161f);
    border-radius: 6px;
}

.symbol-editor-toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--lb-border-default, #2a2a3a);
    margin: 0 8px;
}

.symbol-editor-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--lb-text-muted, #6b6b7b);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.symbol-editor-tool-btn:hover {
    background: var(--lb-bg-input, #1e1e2a);
    color: var(--lb-text-primary, #e8e8ed);
}

.symbol-editor-tool-btn.active {
    background: var(--lb-accent-primary, #d4af37);
    color: #000;
}

.symbol-editor-tool-btn svg {
    width: 16px;
    height: 16px;
}

/* ========== Stage (Canvas Container) ========== */

.symbol-editor-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    position: relative;
}

.symbol-editor-canvas-svg {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 8px;
    display: block;
    overflow: visible;
    background: var(--lb-bg-surface, #16161f);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ========== Canvas Elements ========== */

.symbol-editor-shape {
    cursor: pointer;
}

.symbol-editor-shape.selected {
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
}

.symbol-editor-handle {
    fill: var(--lb-accent-primary, #d4af37);
    stroke: #000;
    stroke-width: 2;
    cursor: pointer;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.symbol-editor-handle:hover {
    fill: #fff;
}

.symbol-editor-handle.segment-handle {
    fill: rgba(212, 175, 55, 0.4);
    stroke: #000;
    stroke-width: 1.5;
}

.symbol-editor-handle.segment-handle:hover {
    fill: var(--lb-accent-primary, #d4af37);
}

.symbol-editor-temp-handle {
    fill: #4ade80;
    stroke: #000;
    stroke-width: 2;
    cursor: pointer;
    filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.6));
}

/* ========== List Items ========== */

.symbol-editor-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.symbol-editor-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--lb-bg-input, #1e1e2a);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--lb-text-primary, #e8e8ed);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.symbol-editor-list-item:hover {
    background: var(--lb-bg-surface, #16161f);
    border-color: var(--lb-border-default, #2a2a3a);
}

.symbol-editor-list-item.selected {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--lb-accent-primary, #d4af37);
}

.symbol-editor-meta {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--lb-text-muted, #6b6b7b);
}

.symbol-editor-empty {
    font-size: 11px;
    color: var(--lb-text-muted, #6b6b7b);
    text-align: center;
    padding: 16px;
}

/* ========== Form Elements ========== */

.symbol-editor-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--lb-text-muted, #6b6b7b);
    margin-bottom: 4px;
}

.symbol-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.symbol-editor-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.symbol-editor-input-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.symbol-editor-input-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--lb-text-muted, #6b6b7b);
}

.symbol-editor-divider {
    height: 1px;
    background: var(--lb-border-default, #2a2a3a);
    margin: 8px 0;
}

.symbol-editor-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.symbol-editor-color {
    width: 100%;
    height: 28px;
    border-radius: 4px;
    border: 1px solid var(--lb-border-default, #2a2a3a);
    background: transparent;
    cursor: pointer;
}

.symbol-editor-textarea {
    min-height: 60px;
    resize: vertical;
    font-family: monospace;
    font-size: 11px;
}

.symbol-editor-panel-content .symbol-editor-textarea {
    min-height: 40px;
}

/* ========== Button Row ========== */

.symbol-editor-btn-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.symbol-editor-btn-row .lb-tool-btn {
    flex: 1;
    font-size: 10px;
    padding: 6px 8px;
    text-align: center;
}

/* ========== Preview Section ========== */

.symbol-editor-preview {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.symbol-editor-preview .symbol-editor-textarea {
    min-height: 50px;
}

.symbol-editor-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.symbol-editor-preview-token {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--lb-text-muted, #6b6b7b);
}

.symbol-editor-preview-token code {
    background: var(--lb-bg-input, #1e1e2a);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: var(--lb-text-primary, #e8e8ed);
}

.symbol-editor-preview-output {
    min-height: 40px;
    padding: 8px;
    background: var(--lb-bg-input, #1e1e2a);
    border: 1px solid var(--lb-border-default, #2a2a3a);
    border-radius: 4px;
    color: var(--lb-text-primary, #e8e8ed);
    font-size: 12px;
    line-height: 1.5;
}

/* ========== Inline Symbol Display ========== */

.symbol-inline {
    display: inline-flex;
    align-items: baseline;
}

.symbol-inline-svg {
    display: inline-block;
}

/* ========== Scrollbar Styling ========== */

.symbol-editor-panel-content::-webkit-scrollbar {
    width: 6px;
}

.symbol-editor-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.symbol-editor-panel-content::-webkit-scrollbar-thumb {
    background: var(--lb-border-default, #2a2a3a);
    border-radius: 3px;
}

.symbol-editor-panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--lb-text-muted, #6b6b7b);
}

/* ========== Toggle Controls ========== */

.symbol-editor-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--lb-text-muted, #6b6b7b);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.symbol-editor-toggle:hover {
    color: var(--lb-text-primary, #e8e8ed);
}

.symbol-editor-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border: 1px solid var(--lb-border-default, #2a2a3a);
    border-radius: 2px;
    background: var(--lb-bg-input, #1e1e2a);
    cursor: pointer;
    margin: 0;
    transition: all 0.15s ease;
}

.symbol-editor-toggle input[type="checkbox"]:checked {
    background: var(--lb-accent-primary, #d4af37);
    border-color: var(--lb-accent-primary, #d4af37);
}

.symbol-editor-toggle input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    width: 4px;
    height: 7px;
    border: solid #000;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    margin-left: 3px;
}

/* ========== Grid Select ========== */

.symbol-editor-grid-select {
    padding: 4px 8px;
    font-size: 10px;
    background: var(--lb-bg-input, #1e1e2a);
    border: 1px solid var(--lb-border-default, #2a2a3a);
    border-radius: 4px;
    color: var(--lb-text-primary, #e8e8ed);
    cursor: pointer;
}

.symbol-editor-grid-select:hover {
    border-color: var(--lb-text-muted, #6b6b7b);
}

/* ========== Input Styles ========== */

.symbol-editor-root .lb-tool-input {
    background: var(--lb-bg-input, #1e1e2a);
    border: 1px solid var(--lb-border-default, #2a2a3a);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--lb-text-primary, #e8e8ed);
    width: 100%;
    transition: border-color 0.15s ease;
}

.symbol-editor-root .lb-tool-input:focus {
    outline: none;
    border-color: var(--lb-accent-primary, #d4af37);
}

.symbol-editor-root .lb-tool-input::placeholder {
    color: var(--lb-text-muted, #6b6b7b);
}

.symbol-editor-root .lb-tool-select {
    background: var(--lb-bg-input, #1e1e2a);
    border: 1px solid var(--lb-border-default, #2a2a3a);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--lb-text-primary, #e8e8ed);
    width: 100%;
    cursor: pointer;
}

.symbol-editor-root .lb-tool-btn {
    background: var(--lb-bg-input, #1e1e2a);
    border: 1px solid var(--lb-border-default, #2a2a3a);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--lb-text-primary, #e8e8ed);
    cursor: pointer;
    transition: all 0.15s ease;
}

.symbol-editor-root .lb-tool-btn:hover {
    background: var(--lb-bg-surface, #16161f);
    border-color: var(--lb-text-muted, #6b6b7b);
}

.symbol-editor-root .lb-tool-btn.small {
    padding: 4px 8px;
    font-size: 10px;
}

.symbol-editor-root .lb-tool-btn.danger {
    color: #f87171;
}

.symbol-editor-root .lb-tool-btn.danger:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
}

/* ========== Inline Input for Renaming ========== */

.symbol-editor-inline-input {
    background: transparent;
    border: none;
    color: var(--lb-text-primary, #e8e8ed);
    font-size: 12px;
    padding: 0;
    margin: 0;
    width: 100%;
    outline: none;
}

.symbol-editor-inline-input:focus {
    background: var(--lb-bg-input, #1e1e2a);
    border-radius: 2px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.symbol-editor-list-item:has(.symbol-editor-inline-input) {
    padding: 6px 10px;
}

/* ========== Responsive ========== */

@media (max-width: 1000px) {
    .symbol-editor-sidebar-left {
        width: 180px;
    }

    .symbol-editor-sidebar-right {
        width: 180px;
    }
}

@media (max-width: 800px) {
    .symbol-editor-sidebar-left,
    .symbol-editor-sidebar-right {
        position: absolute;
        top: 48px;
        bottom: 0;
        z-index: 100;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .symbol-editor-sidebar-left {
        left: 0;
        width: 220px;
    }

    .symbol-editor-sidebar-right {
        right: 0;
        width: 200px;
    }
}
