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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 300;
}

.subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
}

.tab.active {
    background: #007bff;
    color: white;
}

.tab:hover:not(.active) {
    background: #e9ecef;
}

/* Format selector styles */
.format-selector {
    margin-bottom: 20px;
}

.format-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.format-tab {
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.format-tab:hover:not(.active) {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.format-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.format-icon {
    font-size: 18px;
}

.clear-btn {
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #dc3545;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #dc3545;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clear-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.clear-icon {
    font-size: 16px;
}

.format-content {
    display: none;
}

/* JSON Parser Options */
.parse-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.option-label:hover {
    color: #007bff;
}

@media (max-width: 768px) {
    .parse-options {
        gap: 8px;
    }
}

/* Enhanced Parser Output Formats */
.output-formats {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 123, 255, 0.05);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 6px;
}

.format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
}

.format-option:hover {
    color: #007bff;
}

.multi-format-outputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.format-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.format-section h5 {
    background: #f8f9fa;
    margin: 0;
    padding: 12px 16px;
    color: #495057;
    font-size: 0.95em;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.output-container {
    position: relative;
}

.js-output, .python-output {
    background: #f8f9fa;
    border: none;
    border-radius: 0;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre;
    color: #2c3e50;
    margin: 0;
}

.js-output {
    background: #fffbf0;
    color: #856404;
}

.python-output {
    background: #f0f8ff;
    color: #0f5132;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid #007bff;
    color: #007bff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #007bff;
    color: white;
}

/* JSON Parser Results */
.parse-result-success {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.parse-result-success h4 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.parse-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
}

.parse-mode, .parse-types {
    font-size: 0.9em;
    color: #155724;
    font-weight: 500;
}

.parse-output {
    margin-bottom: 20px;
}

.parse-output h5 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 1em;
}

.json-output {
    background: #ffffff;
    border: 1px solid #d4edda;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #2c3e50;
    margin: 0;
}

.parse-details {
    border-top: 1px solid #28a745;
    padding-top: 15px;
}

.parse-details h5 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.object-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.object-details span {
    background: rgba(40, 167, 69, 0.15);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #155724;
    font-weight: 500;
}

/* Enhanced Parser Features */
.auto-detect-notice {
    background: rgba(0, 123, 255, 0.1) !important;
    color: #007bff !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    border-left: 3px solid #007bff !important;
}

.intermediate-step {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 6px;
}

.intermediate-step h5 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.json-intermediate {
    background: #fffbf0;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #856404;
    margin: 0;
}

.format-content.active {
    display: block;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.textarea-container {
    position: relative;
    display: flex;
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: border-color 0.3s ease;
}

.textarea-container:focus-within {
    border-color: #007bff;
}

.textarea-container.has-error {
    border-color: #dc3545;
}

.line-numbers {
    width: 50px;
    min-height: 200px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px 5px;
    color: #6c757d;
    text-align: right;
    user-select: none;
    white-space: pre;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.line-numbers .error-line {
    background: #dc3545;
    color: white;
    font-weight: bold;
    margin: 0 -5px;
    padding: 0 5px;
    border-radius: 3px;
    position: relative;
}

.line-numbers .error-line::after {
    content: '⚠';
    position: absolute;
    right: -15px;
    top: 0;
    color: #dc3545;
    font-size: 12px;
}

.error-highlight {
    position: absolute;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
}

textarea {
    flex: 1;
    min-height: 200px;
    padding: 15px;
    border: none;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: transparent;
    border-radius: 0;
    position: relative;
    z-index: 2;
}

.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
}

.file-input {
    display: none;
}

.file-label {
    display: block;
    padding: 15px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.file-label.has-file {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid;
}

.result.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.result.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Enhanced Comparison Display Styles */
.comparison-result {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.comparison-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.comparison-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.2em;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.view-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9em;
}

.view-btn {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #495057;
}

.view-btn:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.view-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.comparison-view {
    display: none;
    padding: 20px;
}

.comparison-view.active {
    display: block;
}

/* Summary View Styles */
.diff-summary {
    margin-bottom: 20px;
}

.summary-stats {
    background: #e3f2fd;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.stat-item {
    font-weight: 600;
    color: #1565c0;
    font-size: 0.9em;
}

.diff-item {
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.2s ease;
}

.diff-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.diff-item-header {
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.diff-item-header:hover {
    background: #e9ecef;
}

.diff-item.expanded .diff-item-header {
    background: #e3f2fd;
}

.diff-icon {
    font-size: 1.1em;
}

.diff-label {
    font-weight: 600;
    color: #495057;
}

.diff-path {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #6c757d;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.toggle-icon {
    margin-left: auto;
    color: #6c757d;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.diff-item.expanded .toggle-icon {
    transform: rotate(180deg);
}

.diff-content {
    border-top: 1px solid #e9ecef;
    background: #ffffff;
}

.diff-changes {
    padding: 16px;
}

.change-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f3f4;
}

.change-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.change-path {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.change-values {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.old-value, .new-value {
    flex: 1;
    min-width: 200px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    padding: 12px;
    border-radius: 6px;
    line-height: 1.4;
}

.old-value {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.new-value {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

.value-label {
    font-weight: bold;
    margin-right: 8px;
}

.old-value .value-label {
    color: #d32f2f;
}

.new-value .value-label {
    color: #388e3c;
}

.change-value {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    font-size: 0.85em;
}

/* Side-by-Side View Styles */
.side-by-side-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.side-by-side-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.side-header {
    padding: 12px 16px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    border-right: 1px solid #e9ecef;
}

.side-header:last-child {
    border-right: none;
}

.side-by-side-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 300px;
    max-height: 600px;
}

.side-original, .side-modified {
    border-right: 1px solid #e9ecef;
    overflow: auto;
}

.side-modified {
    border-right: none;
}

.side-original pre, .side-modified pre {
    margin: 0;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    background: transparent;
    white-space: pre-wrap;
    word-break: break-word;
}

.side-original pre {
    background: #fff8f0;
}

.side-modified pre {
    background: #f0fff0;
}

.side-original.has-differences pre {
    background: #ffebee;
}

.side-modified.has-differences pre {
    background: #e8f5e8;
}

/* Unified View Styles */
.unified-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.unified-section {
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.unified-section-header {
    background: #f8f9fa;
    padding: 12px 16px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.unified-change {
    background: #ffffff;
}

.unified-path {
    background: #e3f2fd;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #1565c0;
    font-weight: 600;
}

.unified-line {
    padding: 4px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    white-space: pre-wrap;
}

.unified-line.removed {
    background: #ffebee;
    color: #d32f2f;
}

.unified-line.added {
    background: #e8f5e8;
    color: #388e3c;
}

/* Tree View Styles */
.tree-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.tree-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    max-height: 500px;
    overflow-y: auto;
}

.tree-node {
    margin: 2px 0;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1.6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tree-node:hover {
    background: #f8f9fa;
}

.tree-node.changed {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding-left: 12px;
}

.tree-node.level-1 { margin-left: 20px; }
.tree-node.level-2 { margin-left: 40px; }
.tree-node.level-3 { margin-left: 60px; }
.tree-node.level-4 { margin-left: 80px; }

.tree-change-details {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #6c757d;
}

.tree-old-value {
    color: #d32f2f;
    margin-bottom: 4px;
}

.tree-new-value {
    color: #388e3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comparison-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-controls {
        justify-content: center;
    }
    
    .view-btn {
        flex: 1;
        text-align: center;
        font-size: 0.8em;
        padding: 6px 8px;
    }
    
    .side-by-side-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .side-by-side-header {
        grid-template-columns: 1fr;
    }
    
    .side-header {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .side-header:last-child {
        border-bottom: none;
    }
    
    .change-values {
        flex-direction: column;
    }
    
    .old-value, .new-value {
        min-width: unset;
    }
}

/* Legacy diff styles for compatibility */
.diff-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.diff-added {
    background: #d4edda;
    border-color: #28a745;
}

.diff-removed {
    background: #f8d7da;
    border-color: #dc3545;
}

.diff-changed {
    background: #fff3cd;
    border-color: #ffc107;
}

.diff-type {
    background: #e2e3e5;
    border-color: #6c757d;
}

.diff-label {
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.diff-icon {
    margin-right: 8px;
    font-size: 18px;
}

.diff-content {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.seo-content {
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.seo-content h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.seo-content h3 {
    color: #495057;
    font-size: 1.2rem;
    margin: 20px 0 10px 0;
    font-weight: 500;
}

.seo-content p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.seo-content ul, .seo-content ol {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
    padding-left: 20px;
}

.seo-content li {
    margin-bottom: 8px;
}

.seo-content strong {
    color: #495057;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #6c757d;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
}