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

:root {
    --panel-height: 500px;
    --footer-height: 56px;
    --section-header-height: 36px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: white;
    min-height: 100vh;
    padding: 0;
    padding-bottom: var(--footer-height);
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

header {
    background: #333;
    color: white;
    padding: 40px 30px;
    text-align: center;
    border-bottom: none;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 32px;
    padding: 40px;
}

@media (max-width: 1200px) {
    .content {
        grid-template-columns: 1fr;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    margin-bottom: 15px;
}

.section-header h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

.secondary-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

#json-input {
    width: 100%;
    height: var(--panel-height);
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

#json-input:focus {
    outline: none;
    border-color: #c8c8c8;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

#json-input::selection {
    background: #555;
    color: white;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Toggle Switch Styles */
.path-options {
    display: flex;
    gap: 14px;
    padding: 0 15px 10px 15px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e1e4e8;
    justify-content: flex-start;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    background-color: #d1d5da;
    border-radius: 18px;
    transition: background-color 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-switch:hover .toggle-slider {
    background-color: #b1b5ba;
}

/* Pipe form toggle - Purple */
.toggle-pipe input[type="checkbox"]:checked + .toggle-slider {
    background-color: #8957e5;
}

.toggle-pipe input[type="checkbox"]:checked:hover + .toggle-slider {
    background-color: #7645d9;
}

/* Query template toggle - Orange */
.toggle-query input[type="checkbox"]:checked + .toggle-slider {
    background-color: #d18616;
}

.toggle-query input[type="checkbox"]:checked:hover + .toggle-slider {
    background-color: #b87213;
}

.toggle-label {
    font-size: 12px;
    color: #586069;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.path-results {
    height: var(--panel-height);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
}

.path-items-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0 15px 0 15px;
}

.placeholder {
    text-align: center;
    color: #999;
    font-size: 1.1em;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.path-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e1e4e8;
    padding: 16px 0;
    margin-bottom: 0;
    border-radius: 0;
    transition: none;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.path-item:last-child {
    border-bottom: none;
}

.path-item:hover {
    background: transparent;
}

.path-item.primary {
    border-bottom-color: #e1e4e8;
}

.label {
    display: inline-block;
    font-size: 11px;
    color: #6a737d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.path-item.primary .label {
    color: #28a745;
}

.path-item.pipe-form .label {
    color: #8957e5;
}

.path-item.query-template .label {
    color: #d18616;
}

code {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    word-break: break-all;
    margin-bottom: 12px;
    color: #24292f;
    line-height: 1.6;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.action-group {
    display: flex;
    gap: 8px;
}

button.copy-btn,
button.test-btn,
button.playground-btn {
    background: transparent;
    color: #586069;
    border: 1px solid #d1d5da;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.1s ease;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

button.copy-btn:hover,
button.test-btn:hover,
button.playground-btn:hover {
    background: #f6f8fa;
    border-color: #959da5;
}

button.copy-btn:active,
button.test-btn:active,
button.playground-btn:active {
    background: #edeff2;
    border-color: #959da5;
}

button.copy-btn.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.error {
    background: transparent;
    border: 1px solid #d73a49;
    border-left: 3px solid #d73a49;
    color: #d73a49;
    padding: 12px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.test-result {
    margin-top: 12px;
    padding: 10px 12px;
    background: transparent;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    border: 1px solid #0366d6;
    color: #0366d6;
    line-height: 1.5;
}

.test-result.error {
    background: transparent;
    border-color: #d73a49;
    color: #d73a49;
}

footer {
    background: #f8f9fa;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--footer-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: none;
    border-top: 1px solid #e0e0e0;
}

footer a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* GJSON Playground Styles */
.playground-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.playground-hint {
    font-size: 0.85em;
    color: #777;
    font-weight: normal;
    font-style: italic;
    margin-left: auto;
}

.playground-input-group {
    display: flex;
    gap: 10px;
}

.playground-body {
    height: var(--panel-height);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#manual-path-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    transition: all 0.2s;
}

#manual-path-input:focus {
    outline: none;
    border-color: #c8c8c8;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

#manual-path-input:focus-visible {
    outline: none;
}

.execute-btn {
    background: #555;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.execute-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.execute-btn:active {
    transform: translateY(0);
}

.playground-result {
    flex: 1;
    min-height: 0;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    overflow-y: auto;
}

.playground-result:empty::before {
    content: 'Result will appear here...';
    color: #999;
    font-style: italic;
}

.playground-result.has-result {
    background: white;
    border-color: #e0e0e0;
}

.playground-result.has-error {
    background: #fff3f3;
    border-color: #ff6b6b;
    color: #c92a2a;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.result-type {
    font-size: 0.85em;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-exists {
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.result-exists.true {
    background: #d4edd6;
    color: #2d6a2e;
}

.result-exists.false {
    background: #ffe0e0;
    color: #c92a2a;
}

.result-value {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 6px;
    word-break: break-all;
    white-space: pre-wrap;
    color: #333;
    line-height: 1.6;
}

.result-raw {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.result-raw-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}
