/* ============ DSOS — DUN Seating Optimization System ============ */

* { font-family: 'Inter', system-ui, sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

body { -webkit-font-smoothing: antialiased; }

/* ----------- Scrollbars ----------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ----------- Navigation ----------- */
.nav-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-btn:hover { background: #1e293b; color: #f1f5f9; }
.nav-btn.active {
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(244,63,94,0.15));
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.3);
}

/* ----------- KPI Cards ----------- */
.kpi-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s;
}
.kpi-card:hover { border-color: #334155; transform: translateY(-2px); }
.kpi-icon {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-bottom: 4px;
}
.kpi-label { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi-value { font-size: 16px; font-weight: 800; color: #f1f5f9; font-family: 'JetBrains Mono', monospace; line-height: 1.2; }

/* ----------- Splitter ----------- */
#splitter:hover .splitter-handle { background: #f59e0b !important; }
body.resizing { cursor: col-resize !important; user-select: none !important; }
body.resizing iframe, body.resizing svg { pointer-events: none; }

/* ----------- Buttons ----------- */
.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #dc2626);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-secondary:hover { background: #334155; border-color: #475569; }

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16,185,129,0.3); }

.ctrl-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(15,23,42,0.85);
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 12px;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}
.ctrl-btn:hover { background: #1e293b; color: #fbbf24; border-color: #fbbf24; }

/* ----------- Form Inputs ----------- */
.form-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #f1f5f9;
    transition: all 0.2s;
}
.form-input:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
select.form-input { cursor: pointer; }

/* ----------- Settings Cards ----------- */
.setting-card {
    background: rgba(15,23,42,0.6);
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 18px;
    transition: border-color 0.2s;
}
.setting-card:hover { border-color: #334155; }
.setting-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.setting-header h3 { font-size: 14px; font-weight: 700; color: #f1f5f9; }
.setting-header i { font-size: 14px; }
.setting-desc { font-size: 11px; color: #94a3b8; line-height: 1.5; }

/* Model option pill */
.model-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #1e293b;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #0b1220;
}
.model-option:hover { border-color: #475569; }
.model-option input { accent-color: #f59e0b; }
.model-option:has(input:checked) {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(220,38,38,0.05));
    box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}

/* ----------- Dropzones ----------- */
.dropzone {
    border: 2px dashed #334155;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(15,23,42,0.4);
}
.dropzone:hover { border-color: #f59e0b; background: rgba(245,158,11,0.05); }
.dropzone.dragover { border-color: #f59e0b; background: rgba(245,158,11,0.1); transform: scale(1.01); }

.file-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    font-size: 11px;
}
.file-pill .file-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex; align-items: center; justify-content: center;
    color: white;
    flex-shrink: 0;
}
.file-pill .file-meta { flex: 1; min-width: 0; }
.file-pill .file-name { font-weight: 600; color: #f1f5f9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill .file-size { color: #64748b; font-size: 10px; }
.file-pill .file-remove {
    color: #ef4444; cursor: pointer; padding: 4px 8px;
    border-radius: 6px; transition: background 0.2s;
}
.file-pill .file-remove:hover { background: rgba(239,68,68,0.15); }

/* ----------- Pipeline ----------- */
.pipeline-step {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #0b1220;
    border: 1px solid #1e293b;
    border-radius: 10px;
    transition: all 0.3s;
}
.pipeline-step.active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(220,38,38,0.03));
    box-shadow: 0 0 20px rgba(245,158,11,0.15);
}
.pipeline-step.complete { border-color: #10b981; }
.pipeline-step.complete .step-icon { background: rgba(16,185,129,0.2); color: #10b981; }
.pipeline-step.active .step-icon { background: rgba(245,158,11,0.2); color: #fbbf24; animation: pulse-glow 1.5s ease-in-out infinite; }

.step-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: #1e293b;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.step-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: #1e293b;
    color: #94a3b8;
}
.pipeline-step.active .step-status { background: rgba(245,158,11,0.2); color: #fbbf24; }
.pipeline-step.complete .step-status { background: rgba(16,185,129,0.2); color: #10b981; }

.progress-bar {
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 2px;
    transition: width 0.3s ease-out;
}
.pipeline-step.complete .progress-fill { background: linear-gradient(90deg, #10b981, #34d399); }

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* ----------- Chamber Seats ----------- */
.seat-group {
    cursor: pointer;
    transition: filter 0.2s;
}
.seat-group:hover { filter: brightness(1.3) drop-shadow(0 0 8px currentColor); }
.seat-group.dragging { cursor: grabbing; opacity: 0.8; }
.seat-group.editable { cursor: grab; }

.seat-circle {
    transition: r 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                cx 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                cy 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                fill 0.4s;
}

.seat-label {
    pointer-events: none;
    font-size: 7px;
    font-weight: 700;
    fill: white;
    text-anchor: middle;
}
.seat-num {
    pointer-events: none;
    font-size: 9px;
    font-weight: 800;
    fill: white;
    text-anchor: middle;
}

.seat-glow {
    animation: seat-spawn 0.6s ease-out;
}
@keyframes seat-spawn {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

.seat-pulse {
    animation: seat-pulse 1s ease-in-out;
}
@keyframes seat-pulse {
    0% { filter: drop-shadow(0 0 0 currentColor); }
    50% { filter: drop-shadow(0 0 12px currentColor) brightness(1.5); }
    100% { filter: drop-shadow(0 0 0 currentColor); }
}

/* ----------- Toast ----------- */
.toast {
    background: #1e293b;
    border: 1px solid #334155;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 16px;
    color: #f1f5f9;
    font-size: 12px;
    min-width: 280px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: toast-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }
@keyframes toast-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ----------- Draft Cards ----------- */
.draft-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 10px 12px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}
.draft-card:hover { border-color: #475569; }
.draft-card.active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(220,38,38,0.05));
    box-shadow: 0 0 0 1px rgba(245,158,11,0.3);
}
.draft-card.active::before {
    content: '';
    position: absolute;
    left: -1px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: #f59e0b;
    border-radius: 0 2px 2px 0;
}
.draft-mini-score {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}
.draft-recalculating {
    animation: recalc-pulse 0.6s ease-in-out;
}
@keyframes recalc-pulse {
    0% { background: rgba(245,158,11,0.3); }
    100% { background: transparent; }
}

/* Recalc badge on KPIs */
.kpi-recalc {
    animation: kpi-flash 0.6s ease-out;
}
@keyframes kpi-flash {
    0% { color: #fbbf24; transform: scale(1.15); }
    100% { color: inherit; transform: scale(1); }
}

/* History items */
.history-item {
    background: rgba(15,23,42,0.7);
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s;
    cursor: pointer;
}
.history-item:hover { border-color: #f59e0b; transform: translateX(4px); }

/* View transitions */
.view-section { animation: view-fade 0.3s ease-out; }
@keyframes view-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----------- Modal ----------- */
#draft-modal:not(.hidden) { display: flex !important; animation: modal-fade-in 0.2s ease-out; }
#draft-modal > div { animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modal-pop {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-draft-option {
    background: rgba(15,23,42,0.7);
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-draft-option:hover { border-color: #475569; background: rgba(30,41,59,0.6); }
.modal-draft-option.selected {
    border-color: #ef4444;
    background: rgba(239,68,68,0.1);
    box-shadow: 0 0 0 1px rgba(239,68,68,0.4);
}
.modal-draft-option.selected .modal-draft-radio {
    background: #ef4444;
    border-color: #ef4444;
}
.modal-draft-option.selected .modal-draft-radio::after {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 9px;
}
.modal-draft-radio {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid #475569;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
