:root {
    /* Amber Gold Palette */
    --bg-page: #1A150A; /* Dark Amber/Brown tint */
    --bg-panel: rgba(30, 24, 12, 0.8);
    --bg-surface: rgba(45, 36, 18, 0.8);
    --bg-hover: rgba(65, 52, 26, 0.8);
    
    --text-primary: #FDF9F1;
    --text-secondary: #FFEAA7; /* Secondary Gold */
    --text-muted: #B39B75;
    
    --border-color: rgba(243, 156, 18, 0.3);
    --border-light: rgba(243, 156, 18, 0.1);
    
    --primary: #F39C12; /* Primary Amber Gold */
    --primary-hover: #D68910;
    --primary-glow: rgba(243, 156, 18, 0.4);
    
    --accent: #00CEC9; /* Teal accent */
    --accent-glow: rgba(0, 206, 201, 0.4);
    
    --success: #2ECC71;
    --error: #E74C3C;
    --warning: #F1C40F;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 15% 30%, rgba(243, 156, 18, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(0, 206, 201, 0.05) 0%, transparent 40%);
}

/* Utilities */
.font-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.85rem; }
.hide { display: none !important; }

/* Layout */
.app-container {
    width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 1.5rem; min-height: 100vh;
}

/* Glass panel */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative; overflow: hidden;
}

/* Header */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 1rem; }
.logo {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #111;
}
.logo i { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5);}
.title-group h1 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.badge { background: var(--bg-surface); color: var(--text-secondary); padding: 0.15rem 0.5rem; border-radius: 99px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--border-light);}

/* Buttons */
.btn {
    display: inline-flex; justify-content: center; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.2rem; border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; cursor: pointer; transition: all 0.2s;
}
.btn.sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn i { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #111; border: none; box-shadow: 0 2px 10px var(--primary-glow); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 15px var(--primary-glow); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--bg-surface); color: var(--text-primary); }
.full-width { width: 100%; }

.icon-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md); border: none; background: transparent; color: var(--text-secondary);
    cursor: pointer; transition: 0.2s;
}
.icon-btn.sm { width: 28px; height: 28px; border-radius: 6px; }
.icon-btn.sm i { width: 14px; height: 14px; }
.icon-btn i { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Workspace */
.workspace {
    display: flex; flex-direction: column; gap: 1.5rem; flex: 1;
}

.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-light);
}
.panel-header h2 { font-size: 1.1rem; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 1rem; }

/* Input Section */
.input-section { display: flex; flex-direction: column; }
.split-inputs {
    display: flex; gap: 1rem; padding: 1.5rem; align-items: stretch; min-height: 400px;
}
.compare-icon-wrapper {
    display: flex; align-items: center; justify-content: center; color: var(--text-muted); padding: 0 0.5rem;
}
.compare-icon-wrapper i { width: 24px; height: 24px; opacity: 0.5; }

.spec-input-container {
    flex: 1; display: flex; flex-direction: column; border-radius: var(--radius-md);
    border: 1px solid var(--border-light); overflow: hidden; background: var(--bg-page);
}
.spec-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); background: var(--bg-surface);
}
.spec-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.spec-actions { display: flex; gap: 0.5rem; }

textarea {
    flex: 1; width: 100%; padding: 1rem; border: none; background: transparent; color: var(--text-primary);
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5; resize: none; outline: none; white-space: pre;
}

.panel-footer {
    padding: 1.5rem; border-top: 1px solid var(--border-light); background: var(--bg-surface);
}

/* Output Section */
.output-body { padding: 1.5rem; }

/* SemVer Badge */
.semver-badge {
    background: var(--bg-page); border: 1px solid var(--accent); color: var(--accent);
    padding: 0.4rem 0.8rem; border-radius: 99px; font-size: 0.85rem; font-weight: 600; font-family: var(--font-mono);
}
.semver-badge.major { border-color: var(--error); color: var(--error); background: rgba(231, 76, 60, 0.1); }
.semver-badge.minor { border-color: var(--warning); color: var(--warning); background: rgba(241, 196, 15, 0.1); }
.semver-badge.patch { border-color: var(--success); color: var(--success); background: rgba(46, 204, 113, 0.1); }

/* Stats Grid */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    background: var(--bg-page); border: 1px solid var(--border-light);
}
.stat-icon i { width: 24px; height: 24px; }
.stat-info { display: flex; flex-direction: column; }
.stat-val { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); line-height: 1; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* Changelog List */
.changelog-container { display: flex; flex-direction: column; gap: 2rem; }
.change-group { display: none; } /* Hidden if empty */
.change-group.active { display: block; }
.group-title { font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); }
.group-title i { width: 18px; height: 18px; }

.change-list { display: flex; flex-direction: column; gap: 0.75rem; }
.change-item {
    background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.change-item-header { display: flex; align-items: center; gap: 0.75rem; }

.method-badge {
    padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; color: #111;
}
.method-get { background: #3498DB; color: white;}
.method-post { background: #2ECC71; }
.method-put { background: #F39C12; }
.method-delete { background: #E74C3C; color: white; }
.method-patch { background: #9B59B6; color: white;}

.endpoint-path { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; }

.diff-list { display: flex; flex-direction: column; gap: 0.25rem; background: var(--bg-page); padding: 0.75rem; border-radius: var(--radius-sm); margin-top: 0.5rem; }
.diff-item { font-family: var(--font-mono); font-size: 0.8rem; display: flex; align-items: flex-start; gap: 0.5rem; }
.diff-item.add { color: var(--success); }
.diff-item.add::before { content: "+"; font-weight: bold; width: 12px;}
.diff-item.remove { color: var(--error); }
.diff-item.remove::before { content: "-"; font-weight: bold; width: 12px;}
.diff-item.modify { color: var(--warning); }
.diff-item.modify::before { content: "~"; font-weight: bold; width: 12px;}
.diff-item.breaking { color: var(--error); font-weight: 600; border-bottom: 1px solid rgba(231, 76, 60, 0.3); padding-bottom: 2px; }
.diff-item.breaking::before { content: "!"; font-weight: bold; width: 12px;}

/* Modals */
.modal-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.modal {
    background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    width: 100%; max-width: 500px; box-shadow: var(--shadow-md); padding: 1.5rem;
}
.modal-header { font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.modal-body { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; }

/* Toasts */
.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--primary); color: #111; padding: 0.75rem 1.5rem; border-radius: 99px;
    font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow-md); z-index: 2000;
    opacity: 0; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 900px) {
    .split-inputs { flex-direction: column; }
    .compare-icon-wrapper { padding: 0.5rem 0; transform: rotate(90deg); }
    .spec-input-container { min-height: 300px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
}
