/* Button Styles */
.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 2px;
    min-width: 70px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 60px;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon i {
    font-size: 14px;
}

/* Status Styles */
.status-inline {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.status-inline.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

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

.status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    min-height: 20px;
    animation: fadeIn 0.3s ease-in;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

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

/* Controls Section */
.controls-section {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

/* Editor Section */
.editor-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    position: relative;
}

.input-panel, .output-panel {
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.resize-bar {
    width: 12px;
    background: #f8f9fa;
    border-left: 1px solid #e1e5e9;
    border-right: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
    position: relative;
    transition: background-color 0.2s ease;
    user-select: none;
}

.resize-bar:hover {
    background: #e9ecef;
}

.resize-bar.dragging {
    background: #e9ecef;
}

.resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    transition: color 0.2s ease;
}

.resize-bar:hover .resize-handle {
    color: #495057;
}

.resize-bar.dragging .resize-handle {
    color: #495057;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.panel-header h3 {
    color: #333;
    font-size: 1.1rem;
    margin: 0;
}

.input-container, .output-container {
    flex: 1;
    position: relative;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
    overflow-y: scroll;
}

.floating-buttons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.input-floating-buttons {
    top: 8px;
    right: 8px;
    left: auto;
}

/* CodeMirror customization */
.CodeMirror {
    min-height: 800px;
    max-height: 600px !important;
    font-family: 'Maple Mono', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.CodeMirror-lines {
    padding: 4px 0 !important;
}

.CodeMirror pre {
    word-wrap: break-word !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

.CodeMirror-line {
    word-wrap: break-word !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

.CodeMirror-gutters {
    background: #2d2d2d !important;
    border-right: 1px solid #404040 !important;
}

.CodeMirror-linenumber {
    color: #858585 !important;
    padding: 0 8px !important;
}

.CodeMirror-scroll {
    overflow: auto !important;
}

/* Textarea fallback styling */
textarea {
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    resize: none !important;
    font-family: 'Maple Mono', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: inherit !important;
    padding: 8px !important;
}

#jsonInput, #output {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
