
:root {
    /* Refined dark theme with warm accents */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #23232f;
    
    --text-primary: #e8e8f0;
    --text-secondary: #a8a8b8;
    --text-tertiary: #707080;
    
    --accent-primary: #ff6b35;
    --accent-secondary: #f7931e;
    --accent-tertiary: #ffd23f;
    
    --success: #4ecca3;
    --danger: #ee4266;
    --warning: #f7931e;
    --info: #4a90e2;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(78, 204, 163, 0.05) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    z-index: -1;
}

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

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 3rem;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--accent-primary), 
        var(--accent-secondary),
        transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

h1 {
    font-family: 'Space Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Control Panel */
.control-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.input-label.left {
    color: var(--accent-primary);
}

.input-label.right {
    color: var(--success);
}

.input-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'Space Mono', monospace;
    font-weight: 600;
}

.btn-small:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    transition: all var(--transition-medium);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

textarea.error {
    border-color: var(--danger);
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    font-family: 'Space Mono', monospace;
    padding: 0.5rem;
    background: rgba(238, 66, 102, 0.1);
    border-radius: 6px;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

/* Options */
.options-section {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.options-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-wrapper label {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.checkbox-wrapper:hover label {
    color: var(--text-primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary {
    padding: 1rem 3rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

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

.btn-primary:hover::before {
    left: 100%;
}

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

.btn-secondary {
    padding: 1rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 2px solid var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.results-section.show {
    display: block;
}

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

.results-header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent-primary);
}

.results-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

.stat-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
}

.stat-badge.added {
    background: rgba(78, 204, 163, 0.2);
    color: var(--success);
}

.stat-badge.removed {
    background: rgba(238, 66, 102, 0.2);
    color: var(--danger);
}

.stat-badge.modified {
    background: rgba(247, 147, 30, 0.2);
    color: var(--warning);
}

.results-body {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 2rem;
    max-height: 800px;
    overflow-y: auto;
}

.results-body::-webkit-scrollbar {
    width: 12px;
}

.results-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 0 0 16px 0;
}

.results-body::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 6px;
}

.results-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* View Modes */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.4rem;
    border-radius: 8px;
}

.view-btn {
    padding: 0.5rem 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn.active {
    background: var(--accent-primary);
    color: white;
}

.view-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

/* Highlight Filters */
.highlight-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.filter-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-checkbox:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-checkbox label {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-count {
    padding: 0.2rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
}

.filter-checkbox.missing-prop label {
    color: var(--success);
}

.filter-checkbox.missing-prop .filter-count {
    background: rgba(78, 204, 163, 0.2);
    color: var(--success);
}

.filter-checkbox.incorrect-type label {
    color: #ff6b9d;
}

.filter-checkbox.incorrect-type .filter-count {
    background: rgba(255, 107, 157, 0.2);
    color: #ff6b9d;
}

.filter-checkbox.unequal-value label {
    color: #4a90e2;
}

.filter-checkbox.unequal-value .filter-count {
    background: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
}

/* Diff Items */
.diff-item {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    transition: all var(--transition-medium);
}

.diff-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.diff-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.diff-path {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.diff-type {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.diff-type.added {
    background: rgba(78, 204, 163, 0.2);
    color: var(--success);
}

.diff-type.removed {
    background: rgba(238, 66, 102, 0.2);
    color: var(--danger);
}

.diff-type.modified {
    background: rgba(247, 147, 30, 0.2);
    color: var(--warning);
}

.diff-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: none;
}

.diff-content.expanded {
    display: block;
}

.value-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.value-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.value-content {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-all;
}

.value-content.removed {
    color: var(--danger);
    text-decoration: line-through;
}

.value-content.added {
    color: var(--success);
}

/* Side by Side View */
.side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.side-panel {
    background: var(--bg-primary);
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.side-panel:first-child {
    border-right: 1px solid var(--border-subtle);
}

.side-panel::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.side-panel::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.side-panel::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.json-line {
    display: flex;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.2rem 1rem;
    min-height: 28px;
    align-items: center;
    position: relative;
}

.json-line:hover {
    background: var(--bg-secondary);
}

.line-number {
    display: inline-block;
    width: 40px;
    color: var(--text-tertiary);
    text-align: right;
    margin-right: 1rem;
    user-select: none;
    flex-shrink: 0;
}

.line-content {
    flex: 1;
    white-space: pre;
    color: var(--text-primary);
}

/* Highlight styles */
.highlight-missing {
    background: rgba(78, 204, 163, 0.15);
}

.highlight-incorrect-type {
    background: rgba(255, 107, 157, 0.15);
}

.highlight-unequal {
    background: rgba(74, 144, 226, 0.15);
}

.highlight-missing .line-content {
    color: var(--success);
}

.highlight-incorrect-type .line-content {
    color: #ff6b9d;
}

.highlight-unequal .line-content {
    color: #4a90e2;
}

/* Navigation */
.diff-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.nav-button:hover:not(:disabled) {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-info {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* No differences message */
.no-diff {
    text-align: center;
    padding: 4rem 2rem;
}

.no-diff-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-diff-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.no-diff-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Loading State */
.loading {
    display: none;
    text-align: center;
    padding: 3rem;
}

.loading.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .input-section {
        grid-template-columns: 1fr;
    }
    
    .side-by-side {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .control-panel {
        padding: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}