/* JSON Beautifier Styles with CodeMirror */

.editor-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.settings-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.settings-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.file-buttons {
    display: flex;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item label {
    margin: 0;
    font-size: 0.9rem;
}

.setting-item select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.setting-item input[type="checkbox"] {
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* CodeMirror Container */
#json-editor {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#json-editor .CodeMirror {
    height: 600px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    background-color: #ffffff;
    color: #24292e;
}

#json-editor .CodeMirror-gutters {
    background-color: #f6f8fa;
    border-right: 1px solid #e1e4e8;
}

#json-editor .CodeMirror-linenumber {
    color: #959da5;
}

#json-editor .CodeMirror-cursor {
    border-left: 2px solid #24292e;
}

#json-editor .CodeMirror-selected {
    background-color: #c8e1ff;
}

#json-editor .CodeMirror-line::selection,
#json-editor .CodeMirror-line > span::selection,
#json-editor .CodeMirror-line > span > span::selection {
    background-color: #c8e1ff;
}

/* Error state */
#json-editor.json-error {
    border-color: #dc3545;
}

#json-editor.json-error .CodeMirror {
    background-color: #fff5f5;
}

/* Notification */
.json-notification {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.json-notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.json-notification-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .settings-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-group {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons button {
        flex: 1;
    }

    #json-editor .CodeMirror {
        height: 400px;
    }
}

/* Dark theme support */
[data-theme="dark"] .settings-bar {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .setting-item label {
    color: #e0e0e0;
}

[data-theme="dark"] .setting-item select {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

[data-theme="dark"] #json-editor {
    border-color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #json-editor .CodeMirror {
    background-color: #1e1e1e;
    color: #d4d4d4;
}

[data-theme="dark"] #json-editor .CodeMirror-gutters {
    background-color: #252526;
    border-right: 1px solid #3e3e42;
}

[data-theme="dark"] #json-editor .CodeMirror-linenumber {
    color: #858585;
}

[data-theme="dark"] #json-editor .CodeMirror-cursor {
    border-left: 2px solid #d4d4d4;
}

[data-theme="dark"] #json-editor .CodeMirror-selected {
    background-color: #264f78;
}

[data-theme="dark"] #json-editor .CodeMirror-line::selection,
[data-theme="dark"] #json-editor .CodeMirror-line > span::selection,
[data-theme="dark"] #json-editor .CodeMirror-line > span > span::selection {
    background-color: #264f78;
}

[data-theme="dark"] #json-editor .CodeMirror-activeline-background {
    background-color: #2a2a2a;
}

[data-theme="dark"] #json-editor.json-error .CodeMirror {
    background-color: #3d1f1f;
}

[data-theme="dark"] .json-notification-error {
    background-color: #5c2b2b;
    color: #f8d7da;
    border-color: #8b3a3a;
}

[data-theme="dark"] .json-notification-info {
    background-color: #1f4b54;
    color: #d1ecf1;
    border-color: #2d6b7a;
}

/* Drag and drop styles */
#json-editor.drag-over {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Dark Mode Syntax Highlighting */
[data-theme="dark"] .cm-s-default .cm-string { color: #ce9178; }
[data-theme="dark"] .cm-s-default .cm-string-2 { color: #ce9178; }
[data-theme="dark"] .cm-s-default .cm-number { color: #b5cea8; }
[data-theme="dark"] .cm-s-default .cm-atom { color: #569cd6; }
[data-theme="dark"] .cm-s-default .cm-keyword { color: #c586c0; }
[data-theme="dark"] .cm-s-default .cm-variable { color: #9cdcfe; }
[data-theme="dark"] .cm-s-default .cm-def { color: #dcdcaa; }
[data-theme="dark"] .cm-s-default .cm-property { color: #9cdcfe; }
[data-theme="dark"] .cm-s-default .cm-operator { color: #d4d4d4; }
[data-theme="dark"] .cm-s-default .cm-comment { color: #6a9955; }
[data-theme="dark"] .cm-s-default .cm-meta { color: #569cd6; }
