/* Base styles */
:root {
    --sidebar-width: 256px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#mainContent {
    flex: 1;
    min-height: 0;
    display: flex;
}

/* Work area layout */
#workArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#expressionPane {
    height: 300px;
    flex-shrink: 0;
}

#bottomArea {
    flex: 1;
    min-height: 0;
    display: flex;
}

#contextPane {
    width: 50%;
    flex-shrink: 0;
}

#resultsPane {
    flex: 1;
    min-width: 0;
}

/* Split pane styles */
.pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    flex-shrink: 0;
}

.editor-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
}

.editor-wrapper > div {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Vertical resizer */
#verticalResizer {
    width: 6px;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
}

#verticalResizer:hover {
    background-color: #f97316 !important;
}

#verticalResizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: rgba(100, 100, 100, 0.5);
    border-radius: 2px;
}

/* Horizontal resizer */
#horizontalResizer {
    height: 6px;
    cursor: row-resize;
    flex-shrink: 0;
    position: relative;
}

#horizontalResizer:hover {
    background-color: #f97316 !important;
}

#horizontalResizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 2px;
    background: rgba(100, 100, 100, 0.5);
    border-radius: 2px;
}

#resultContainer {
    flex: 1;
    overflow-y: auto;
}

/* JSON syntax highlighting */
#resultValue {
    white-space: pre-wrap;
    word-break: break-word;
}

.json-key {
    color: #0451a5;
    font-weight: 500;
}

.json-string {
    color: #a31515;
}

.json-number {
    color: #098658;
}

.json-boolean {
    color: #0000ff;
    font-weight: 600;
}

.json-null {
    color: #0000ff;
    font-weight: 600;
}

.dark .json-key {
    color: #9cdcfe;
}

.dark .json-string {
    color: #ce9178;
}

.dark .json-number {
    color: #b5cea8;
}

.dark .json-boolean {
    color: #569cd6;
}

.dark .json-null {
    color: #569cd6;
}

/* Light theme token colors */
.tok-number { color: #098658 !important; }
.tok-string { color: #a31515 !important; }
.tok-keyword { color: #af00db !important; }
.tok-operator { color: #383a42 !important; }
.tok-function { color: #795e26 !important; }
.tok-punctuation { color: #383a42 !important; }
.tok-name { color: #001080 !important; }
.tok-constant { color: #0070c1 !important; }
.tok-comment { color: #008000 !important; font-style: italic; }

/* Dark theme token colors */
.dark .tok-number { color: #b5cea8 !important; }
.dark .tok-string { color: #ce9178 !important; }
.dark .tok-keyword { color: #c586c0 !important; }
.dark .tok-operator { color: #d4d4d4 !important; }
.dark .tok-function { color: #dcdcaa !important; }
.dark .tok-punctuation { color: #d4d4d4 !important; }
.dark .tok-name { color: #9cdcfe !important; }
.dark .tok-constant { color: #4fc1ff !important; }
.dark .tok-comment { color: #6a9955 !important; font-style: italic; }

/* Error styling animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.error-shake {
    animation: shake 0.3s ease-in-out;
}

/* Examples sidebar styles */
#examplesSidebar {
    min-width: 200px;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
}

.dark #examplesSidebar {
    background-color: #111827;
    border-right-color: #374151;
}

#examplesSidebar > div:first-child {
    height: 40px;
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 16px;
    flex-shrink: 0;
}

.dark #examplesSidebar > div:first-child {
    background-color: #1f2937;
    border-bottom-color: #374151;
}

#examplesList {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.example-item {
    width: 100%;
    text-align: left;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.example-item:hover {
    background-color: #ffffff;
    border-color: #fed7aa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark .example-item:hover {
    background-color: #1f2937;
    border-color: #374151;
}

.example-item:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
}

.example-item:active {
    transform: scale(0.98);
}

.example-item p:first-child {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin: 0;
}

.dark .example-item p:first-child {
    color: #e5e7eb;
}

.example-item:hover p:first-child {
    color: #f97316;
}

.dark .example-item:hover p:first-child {
    color: #f97316;
}

.example-item p:last-child {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.dark .example-item p:last-child {
    color: #9ca3af;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
