:root {
    --bg-dark: #1A100E;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --bg-panel-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);

    --primary: #E17055;
    --primary-hover: #fa8568;
    --secondary: #FAB1A0;
    --accent: #FFEAA7;

    --text-main: #f5f5f5;
    --text-muted: #a09896;

    --radius: 12px;
    --transition: 200ms ease;

    --diff-add: rgba(46, 204, 113, 0.2);
    --diff-sub: rgba(231, 76, 60, 0.2);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Glassmorphism */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo svg {
    width: 24px;
    height: 24px;
}

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

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-list li {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background var(--transition);
    color: var(--text-muted);
}

.menu-list li:hover {
    background: var(--bg-panel-hover);
    color: var(--text-main);
}

.mt-auto {
    margin-top: auto;
    padding-top: 24px;
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-header {
    height: 73px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.workspace-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
}

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

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(225, 112, 85, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(225, 112, 85, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-panel-hover);
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.text-btn:hover {
    color: var(--primary);
}

.text-xs {
    font-size: 0.75rem;
}

/* Shared Context & Inputs */
.shared-context {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-a {
    background: rgba(225, 112, 85, 0.2);
    color: var(--secondary);
    border: 1px solid rgba(225, 112, 85, 0.3);
}

.badge-b {
    background: rgba(255, 234, 167, 0.1);
    color: var(--accent);
    border: 1px solid rgba(255, 234, 167, 0.2);
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    padding: 16px;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

#sharedInput {
    height: 100px;
}

#promptA,
#promptB {
    height: 250px;
}

/* Split View */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.variant-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-mini {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Results Area */
.hidden {
    display: none !important;
}

.mt-4 {
    margin-top: 24px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.score-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.score-card h4 {
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.output-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.output-box h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sim-output {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--secondary);
    min-height: 100px;
}

/* Diff View */
.diff-view {
    padding: 24px;
}

.diff-content {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

.diff-add {
    background-color: var(--diff-add);
    color: #2ecc71;
    padding: 2px 4px;
    border-radius: 4px;
}

.diff-sub {
    background-color: var(--diff-sub);
    color: #e74c3c;
    text-decoration: line-through;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}