/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* App container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Three-panel layout */
.three-panel-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 700px;
    height: calc(100vh - 280px);
}

/* Panel styles */
.panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.45);
}

.panel.error {
    border-color: rgba(245, 101, 101, 0.5);
    box-shadow: 0 8px 32px rgba(245, 101, 101, 0.2);
}

.panel.valid {
    border-color: rgba(72, 187, 120, 0.5);
    box-shadow: 0 8px 32px rgba(72, 187, 120, 0.2);
}

.panel.warning {
    border-color: rgba(237, 137, 54, 0.5);
    box-shadow: 0 8px 32px rgba(237, 137, 54, 0.2);
}

.panel-footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.transform-controls-main {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transform-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.examples-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px;
    background: rgba(245, 245, 245, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.example-label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin: 0;
}

.example-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #2d3748;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.example-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.transform-controls-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.panel-header {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* CodeMirror editor styles */
.CodeMirror {
    height: 100% !important;
    min-height: 600px !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    border: none;
    border-radius: 0;
    padding: 1.5rem;
    line-height: 1.8;
}

.CodeMirror:focus-within {
    min-height: 650px !important;
    max-height: 1000px !important;
}

.CodeMirror-scroll {
    min-height: 100%;
    padding: 10px;
}

/* Status indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background: #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.status-indicator.valid {
    background: #48bb78;
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.5);
}

.status-indicator.invalid {
    background: #f56565;
    box-shadow: 0 0 8px rgba(245, 101, 101, 0.5);
    animation: pulse 2s infinite;
}

.status-indicator.warning {
    background: #ed8936;
    box-shadow: 0 0 8px rgba(237, 137, 54, 0.5);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error display */
.error-display {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    font-size: 12px;
    color: #c53030;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.2);
}

.panel.error .error-display {
    display: block;
}

.error-display .error-message {
    font-weight: 600;
    margin-bottom: 5px;
}

.error-display .error-details {
    font-size: 11px;
    opacity: 0.8;
}

.validation-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4a5568;
}

.validation-indicator.valid {
    color: #48bb78;
}

.validation-indicator.invalid {
    color: #f56565;
}

.validation-indicator.warning {
    color: #ed8936;
}

/* JSON Tree View */
.json-tree-view {
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow: auto;
    height: 100%;
}

.json-key {
    color: #667eea;
    font-weight: 600;
}

.json-string {
    color: #48bb78;
}

.json-number {
    color: #ed8936;
}

.json-boolean {
    color: #9f7aea;
}

.json-null {
    color: #a0aec0;
    font-style: italic;
}

.json-array,
.json-object {
    margin-left: 20px;
}

/* Performance Diagnostics */
.diagnostics-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 20px;
}

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

.diagnostics-header h4 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.diagnostics-content {
    transition: all 0.3s ease;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metric {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.metric-label {
    color: #4a5568;
    font-weight: 500;
}

.metric-value {
    color: #2d3748;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.transformation-flow {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.flow-steps {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.flow-step {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.flow-step.active {
    background: #48bb78;
    transform: scale(1.05);
}

.flow-step.error {
    background: #f56565;
}

/* Transform controls */
.transform-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

.btn-warning {
    background: #fed7d7;
    color: #c53030;
}

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

/* Select dropdown */
.operation-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #2d3748;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.operation-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Auto-transform toggle */
.auto-transform {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-size: 14px;
}

.auto-transform input[type="checkbox"] {
    accent-color: #667eea;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-top: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Tool Modal Styles */
.tool-modal {
    align-items: flex-start;
    padding: 20px;
}

.tool-modal-content {
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    height: 85vh;
}

.tool-modal-body {
    padding: 0;
    height: calc(100% - 70px);
    overflow: hidden;
}

.tool-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 12px 12px;
}

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

/* Help Modal Styles */
.help-content {
    font-size: 14px;
    line-height: 1.6;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h4 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

.help-section ul {
    list-style: none;
    padding: 0;
}

.help-section li {
    padding: 6px 0;
    border-bottom: 1px solid #f7fafc;
}

.help-section li:last-child {
    border-bottom: none;
}

.shortcuts-grid {
    display: grid;
    gap: 12px;
}

.shortcut {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

kbd {
    background: #2d3748;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    font-weight: 600;
}

.external-tools {
    display: grid;
    gap: 15px;
}

.tool-info {
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tool-info h5 {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-info p {
    color: #4a5568;
    margin-bottom: 12px;
    font-size: 13px;
}

/* Quick Start Guide */
.quick-start {
    display: grid;
    gap: 15px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.step-number {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: #2d3748;
    font-size: 14px;
    display: block;
    margin-bottom: 6px;
}

.step-content ul {
    margin-top: 8px;
    margin-left: 15px;
}

.step-content li {
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 4px;
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* Suggestion Panel */
.suggestion-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #e6fffa;
    border: 1px solid #81e6d9;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    font-size: 12px;
    color: #234e52;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(129, 230, 217, 0.2);
}

.panel.warning .suggestion-panel {
    display: block;
}

.suggestion-panel .suggestion-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #065f46;
}

.suggestion-panel .suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestion-panel .suggestion-list li {
    padding: 2px 0;
    padding-left: 15px;
    position: relative;
}

.suggestion-panel .suggestion-list li::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 2px;
}

/* Progress indicators */
.progress-indicator {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-bar.error {
    background: linear-gradient(90deg, #f56565, #e53e3e);
}

.progress-bar.warning {
    background: linear-gradient(90deg, #ed8936, #dd6b20);
}

.iframe-notice {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    margin: 20px;
}

.iframe-notice p {
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
}

.iframe-notice p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.tool-features {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tool-features h4 {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.tool-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-features li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #4a5568;
    font-size: 14px;
    border-bottom: 1px solid #f7fafc;
}

.tool-features li:last-child {
    border-bottom: none;
}

.tool-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    max-height: 60vh;
}

.examples-list {
    display: grid;
    gap: 15px;
}

.example-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-item:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-2px);
}

.example-item h4 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.example-item p {
    color: #718096;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 1200px) {
    .three-panel-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .output-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 15px;
        gap: 15px;
    }
    
    .app-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .three-panel-layout {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 300px);
        gap: 15px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .transform-controls {
        flex-direction: column;
        gap: 15px;
    }
}

/* Live preview styles */
.live-preview-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.live-preview-header {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-preview-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    background: #f7fafc;
    padding: 10px;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Modern J2J Transform Studio Styles */
/* Inspired by VS Code, Postman, and modern web tools */

:root {
    --primary-color: #007acc;
    --primary-hover: #005a9f;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --bg-light: #ffffff;
    --bg-panel: #f8f9fa;
    
    --text-primary: #cccccc;
    --text-secondary: #969696;
    --text-muted: #6a6a6a;
    --text-dark: #212529;
    
    --border-color: #3e3e42;
    --border-light: #e1e5e9;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    
    --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --transition: all 0.2s ease;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* Application Shell */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
}

.navbar-brand i {
    color: var(--primary-color);
    font-size: 24px;
}

.brand-text {
    color: var(--text-primary);
}

.version-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Navbar Controls */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Quick Start Selector */
.quick-start-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quick-start-selector label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quick-start-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 200px;
    position: relative;
}

.quick-start-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.quick-start-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.quick-start-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

.quick-start-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-section:last-child {
    border-bottom: none;
}

.section-title {
    padding: 0 1rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.example-item:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--primary-color);
}

.example-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.example-header i {
    width: 16px;
    color: var(--primary-color);
}

.example-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 2rem;
}

.navbar-actions {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-family: inherit;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.nav-btn i {
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: 100%;
    gap: 1px;
    background: var(--border-color);
}

/* Editor Panels */
.editor-panel {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.panel-title i {
    color: var(--primary-color);
    font-size: 16px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.validation-icon {
    font-size: 12px;
}

.validation-status.valid {
    color: var(--success-color);
}

.validation-status.error {
    color: var(--danger-color);
}

.validation-status.warning {
    color: var(--warning-color);
}

.panel-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* CodeMirror Integration */
.CodeMirror {
    height: 100% !important;
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.CodeMirror-gutters {
    background: var(--bg-tertiary) !important;
    border-right: 1px solid var(--border-color) !important;
}

.CodeMirror-linenumber {
    color: var(--text-muted) !important;
}

.CodeMirror-cursor {
    border-left-color: var(--text-primary) !important;
}

.validation-message {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    padding: 8px 16px;
    font-size: 12px;
    transform: translateY(100%);
    transition: var(--transition);
    z-index: 10;
}

.validation-message.show {
    transform: translateY(0);
}

/* Transform Controls */
.transform-controls {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.transform-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-family: inherit;
}

.transform-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Modern Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #444;
    transition: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.performance-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 4px;
}

/* Tree View */
.tree-view {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 16px;
    overflow: auto;
    height: 100%;
    line-height: 1.6;
}

.tree-view .json-key {
    color: #9cdcfe;
    font-weight: 500;
}

.tree-view .json-string {
    color: #ce9178;
}

.tree-view .json-number {
    color: #b5cea8;
}

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

.tree-view .json-null {
    color: #569cd6;
    font-style: italic;
}

/* Status Bar */
.status-bar {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    height: 32px;
    flex-shrink: 0;
}

.status-left,
.status-right {
    display: flex;
    gap: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.status-item i {
    font-size: 12px;
}

.status-item.success {
    color: var(--success-color);
}

.status-item.warning {
    color: var(--warning-color);
}

.status-item.error {
    color: var(--danger-color);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--bg-tertiary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header i {
    color: var(--primary-color);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

/* Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.example-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.example-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.example-card h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.example-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    gap: 20px;
}

.tool-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 16px;
    transition: var(--transition);
}

.tool-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.tool-icon {
    background: var(--primary-color);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tool-info h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.tool-info p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.tool-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.tool-link:hover {
    color: var(--primary-hover);
}

/* Settings */
.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.setting-item label {
    color: var(--text-secondary);
    font-size: 14px;
    min-width: 80px;
}

.setting-item select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
}

/* Notifications */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1500;
    pointer-events: none;
}

.notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--info-color);
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.error .notification-icon {
    color: var(--danger-color);
}

.notification.warning .notification-icon {
    color: var(--warning-color);
}

.notification.info .notification-icon {
    color: var(--info-color);
}

.notification-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.notification-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
    transition: var(--transition);
}

.notification-close:hover {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .editor-panel {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    
    .navbar-controls {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .navbar-actions {
        width: 100%;
        justify-content: center;
    }
    
    .transform-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
}
