:root {
    --bg-dark: #0d1b2a;
    --bg-card: #1b263b;
    --bg-input: #0a111a;
    --primary: #0984e3;
    --secondary: #74b9ff;
    --accent: #e17055;
    --text: #e0e1dd;
    --text-muted: #8d99ae;
    --border: #415a77;

    --added: #00b894;
    --added-bg: rgba(0, 184, 148, 0.1);
    --removed: #d63031;
    --removed-bg: rgba(214, 48, 49, 0.1);
    --changed: #fdcb6e;
    --changed-bg: rgba(253, 203, 110, 0.1);

    --radius: 8px;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

.bg-dark {
    background-color: var(--bg-dark);
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.navbar {
    height: 64px;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--secondary);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
}

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

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
    overflow-y: auto;
}

.editor-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 300px;
    height: 40vh;
}

.editor-container {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

textarea {
    flex: 1;
    background-color: var(--bg-input);
    color: var(--text);
    border: none;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

textarea:focus {
    background-color: #0c1521;
}

.results-area {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 400px;
}

.stats-bar {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.stat-chips {
    display: flex;
    gap: 12px;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.stat-chip .label {
    color: var(--text-muted);
}

.stat-chip .value {
    font-weight: 600;
}

.stat-chip.added .value { color: var(--added); }
.stat-chip.removed .value { color: var(--removed); }
.stat-chip.changed .value { color: var(--changed); }

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

.divider {
    width: 1px;
    height: 20px;
    background-color: var(--border);
    margin: 0 4px;
}

.diff-viewer-container {
    padding: 24px;
    overflow-x: auto;
}

.diff-output {
    white-space: pre;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.mono {
    font-family: var(--font-mono);
}

/* Tree Styles */
.diff-row {
    display: flex;
    padding: 2px 0;
}

.diff-indent {
    width: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.diff-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diff-added { background-color: var(--added-bg); border-left: 3px solid var(--added); }
.diff-removed { background-color: var(--removed-bg); border-left: 3px solid var(--removed); }
.diff-changed { background-color: var(--changed-bg); border-left: 3px solid var(--changed); }

.text-added { color: var(--added); }
.text-removed { color: var(--removed); }
.text-changed { color: var(--changed); }

.diff-key {
    color: var(--secondary);
    font-weight: 500;
}

.diff-value {
    color: var(--text);
}

.diff-toggle {
    cursor: pointer;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.diff-toggle.collapsed {
    transform: rotate(-90deg);
}

.diff-nested {
    margin-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: #0a94ff;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background-color: #4e6a8d;
}

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

.tool-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.tool-btn i {
    width: 18px;
    height: 18px;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #721c24;
    color: #f8d7da;
    padding: 12px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #f5c6cb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.footer {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    background-color: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .editor-section {
        grid-template-columns: 1fr;
        height: auto;
    }
}
