/* ==========================================================================
   BioSinergia - Design System & Custom Stylesheet
   Theme: Glassmorphism Premium (Dark & Light support)
   ========================================================================== */

/* Cores de Acento Compartilhadas */
:root {
    --syn-green: #10b981;
    --syn-cyan: #06b6d4;
    --ant-coral: #f43f5e;
    --ant-magenta: #ec4899;
    --violet-main: #8b5cf6;
    
    --transition-speed: 0.3s;
    --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', sans-serif;
    --font-header: 'Outfit', sans-serif;
}

/* Modo Escuro (Padrão) */
[data-theme="dark"] {
    --bg-grad-1: #09090b;
    --bg-grad-2: #18181b;
    --bg-glow-c1: rgba(139, 92, 246, 0.12); /* Violet Glow */
    --bg-glow-c2: rgba(6, 182, 212, 0.08);  /* Cyan Glow */
    
    --panel-bg: rgba(24, 24, 27, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: rgba(0, 0, 0, 0.5);
    
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --input-bg: rgba(39, 39, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: var(--violet-main);
    --input-text: #ffffff;
    
    --btn-primary-bg: linear-gradient(135deg, var(--violet-main), #7c3aed);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: rgba(63, 63, 70, 0.6);
    --btn-secondary-border: rgba(255, 255, 255, 0.05);
    --btn-secondary-text: #e4e4e7;
    
    --matrix-header-bg: rgba(39, 39, 42, 0.8);
    --matrix-cell-bg: rgba(63, 63, 70, 0.3);
    --matrix-cell-border: rgba(255, 255, 255, 0.05);
    --matrix-drug-bg: rgba(139, 92, 246, 0.15);
    --matrix-control-bg: rgba(9, 9, 11, 0.6);
}

/* Modo Claro */
[data-theme="light"] {
    --bg-grad-1: #f8fafc;
    --bg-grad-2: #e2e8f0;
    --bg-glow-c1: rgba(139, 92, 246, 0.06);
    --bg-glow-c2: rgba(6, 182, 212, 0.05);
    
    --panel-bg: rgba(255, 255, 255, 0.75);
    --panel-border: rgba(15, 23, 42, 0.08);
    --panel-shadow: rgba(15, 23, 42, 0.08);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(15, 23, 42, 0.12);
    --input-focus: var(--violet-main);
    --input-text: #0f172a;
    
    --btn-primary-bg: linear-gradient(135deg, var(--violet-main), #7c3aed);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: rgba(226, 232, 240, 0.8);
    --btn-secondary-border: rgba(15, 23, 42, 0.05);
    --btn-secondary-text: #334155;
    
    --matrix-header-bg: rgba(226, 232, 240, 0.9);
    --matrix-cell-bg: rgba(241, 245, 249, 0.8);
    --matrix-cell-border: rgba(15, 23, 42, 0.08);
    --matrix-drug-bg: rgba(139, 92, 246, 0.1);
    --matrix-control-bg: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background var(--transition-speed) var(--transition-curve), 
                color var(--transition-speed) var(--transition-curve);
}

/* Glow Background Effects */
.bg-glow-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bg-glow-c1) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    right: -100px;
    z-index: 0;
    pointer-events: none;
    transition: background var(--transition-speed) var(--transition-curve);
}

.bg-glow-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bg-glow-c2) 0%, rgba(0,0,0,0) 70%);
    bottom: -50px;
    left: -100px;
    z-index: 0;
    pointer-events: none;
    transition: background var(--transition-speed) var(--transition-curve);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 4px 30px var(--panel-shadow);
    transition: background var(--transition-speed) var(--transition-curve), 
                border-color var(--transition-speed) var(--transition-curve);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--violet-main);
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    animation: pulse-slow 3s infinite ease-in-out;
}

.logo-area h1 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-primary), var(--violet-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-beta {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--violet-main);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Main Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto auto;
    gap: 1.25rem;
    flex-grow: 1;
}

/* For larger screens: side panel, mid matrix, right results */
@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 320px 1fr 1fr;
        grid-template-rows: 1fr;
    }
    
    .panel-matrix {
        grid-column: 2;
    }
    
    .panel-results {
        grid-column: 3;
    }
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .panel-matrix {
        grid-column: 1;
    }
    
    .panel-results {
        grid-column: 1;
    }
}

/* ==========================================================================
   Panel Components (Glassmorphism)
   ========================================================================== */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--panel-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background var(--transition-speed) var(--transition-curve), 
                border-color var(--transition-speed) var(--transition-curve),
                transform var(--transition-speed) var(--transition-curve);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.panel-header i {
    color: var(--violet-main);
    font-size: 1.2rem;
}

.panel-header h2 {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.panel-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex-grow: 1;
}

.flex-column-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ==========================================================================
   Interactive Forms & Controls
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper, .select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-input {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="text"], input[type="number"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.25rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--input-text);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* File Upload Wrapper */
.file-upload-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: var(--input-bg);
    border: 2px dashed var(--input-border);
    border-radius: 10px;
    transition: all 0.2s var(--transition-speed) var(--transition-curve);
    overflow: hidden;
    min-height: 80px;
}

.file-upload-wrapper:hover {
    border-color: var(--violet-main);
    background: rgba(139, 92, 246, 0.05);
}

.file-upload-wrapper.has-file {
    border-color: var(--syn-green);
    background: rgba(16, 185, 129, 0.05);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-btn-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
    pointer-events: none;
    z-index: 1;
}

.upload-btn-placeholder i {
    font-size: 1.4rem;
    color: var(--violet-main);
    transition: transform 0.2s ease;
}

.file-upload-wrapper:hover .upload-btn-placeholder i {
    transform: translateY(-2px);
}

.file-upload-wrapper.has-file .upload-btn-placeholder i {
    color: var(--syn-green);
}

.upload-section {
    margin-bottom: 0.5rem;
}

/* Segmented Control (Tabs & Toggle Switches) */
.segmented-control {
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.25rem;
    border-radius: 10px;
    gap: 0.25rem;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
}

.segmented-control input[type="radio"]:checked + label {
    background: var(--violet-main);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* Mini Segmented Control for Graphs */
.segmented-control.mini {
    border-radius: 8px;
    padding: 0.15rem;
}

.segmented-control.mini label {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
}

/* Preset Options */
.preset-section {
    border-top: 1px solid var(--panel-border);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

.preset-section h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.preset-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-preset {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.btn-preset i {
    font-size: 0.85rem;
}

.btn-preset:hover {
    color: var(--text-primary);
    border-color: var(--violet-main);
}

.btn-preset.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--violet-main);
    color: var(--violet-main);
    font-weight: 600;
}

/* Buttons */
button {
    font-family: var(--font-primary);
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s var(--transition-curve);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    font-size: 0.95rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

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

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--violet-main);
    color: var(--violet-main);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--ant-coral);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

.btn-danger:hover {
    background: var(--ant-coral);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-theme-toggle {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--btn-secondary-border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.1rem;
}

.btn-theme-toggle:hover {
    color: var(--violet-main);
    border-color: var(--violet-main);
    transform: rotate(15deg);
}

/* Icons toggle based on theme */
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: inline-block; }
[data-theme="light"] .sun-icon { display: inline-block; }
[data-theme="light"] .moon-icon { display: none; }

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid var(--panel-border);
    padding-top: 1.25rem;
    margin-top: auto;
}

/* ==========================================================================
   Matrix Grid Styling (Central Area)
   ========================================================================== */
.matrix-scroll-container {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 0.5rem;
}

.styled-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    font-size: 0.85rem;
}

.styled-matrix th, .styled-matrix td {
    padding: 0.4rem;
    text-align: center;
    border-radius: 6px;
    min-width: 65px;
    height: 50px;
}

/* Header Cells (Labels) */
.styled-matrix th {
    background: var(--matrix-header-bg);
    color: var(--text-secondary);
    font-family: var(--font-header);
    font-weight: 600;
}

/* Drug names corners */
.styled-matrix .drug-label-corner {
    background: transparent;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 100px;
    word-wrap: break-word;
}

/* Concentration Inputs */
.styled-matrix .conc-cell {
    background: var(--matrix-control-bg);
    border: 1px solid var(--input-border);
}

.styled-matrix .conc-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--input-text);
    font-weight: 600;
    text-align: center;
    outline: none;
    font-size: 0.85rem;
    padding: 0 !important; /* Reset icon padding for matrix cells */
}

/* Center Response Cells */
.styled-matrix .value-cell {
    background: var(--matrix-cell-bg);
    border: 1px solid var(--matrix-cell-border);
    transition: all 0.2s ease;
}

.styled-matrix .value-cell:hover {
    border-color: var(--violet-main);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.styled-matrix .cell-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: center;
    outline: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 !important; /* Reset icon padding for matrix cells */
}

/* Hide default browser up/down arrows (spin buttons) inside the matrix cells */
.styled-matrix input[type="number"]::-webkit-outer-spin-button,
.styled-matrix input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.styled-matrix input[type="number"] {
    -moz-appearance: textfield;
}

/* Color scaling classes based on viability (updated by JS) */
.styled-matrix .viab-high {
    background: rgba(16, 185, 129, 0.25) !important; /* High viability (green) */
    border-color: rgba(16, 185, 129, 0.4);
}
.styled-matrix .viab-mid {
    background: rgba(139, 92, 246, 0.2) !important;  /* Mid (purple) */
    border-color: rgba(139, 92, 246, 0.3);
}
.styled-matrix .viab-low {
    background: rgba(244, 63, 94, 0.25) !important;  /* Low (red) */
    border-color: rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   Tabs & Visualizations
   ========================================================================== */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tabs-container {
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.2rem;
    border-radius: 10px;
    gap: 0.15rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--panel-bg);
    color: var(--violet-main);
    box-shadow: 0 2px 8px var(--panel-shadow);
    font-weight: 600;
}

.tab-content {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    min-height: 380px;
}

.tab-content.active {
    display: flex;
}

.model-selector-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.selector-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chart-container {
    width: 100%;
    height: 100%;
    min-height: 340px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    overflow: hidden;
}

/* ==========================================================================
   Synergy Summary Card
   ========================================================================== */
.synergy-summary-card {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-metric .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.score-value {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--violet-main);
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-synergy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--syn-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-neutral {
    background: rgba(139, 92, 246, 0.2);
    color: var(--violet-main);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-antagonism {
    background: rgba(244, 63, 94, 0.2);
    color: var(--ant-coral);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.summary-details p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Details Table (Tab Content 3)
   ========================================================================== */
.table-responsive {
    overflow-y: auto;
    max-height: 340px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.details-table th, .details-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.details-table th {
    background: var(--matrix-header-bg);
    color: var(--text-primary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.details-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.text-center {
    text-align: center !important;
}

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

.export-row {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    border-top: 1px solid var(--panel-border);
    padding-top: 1rem;
}

.export-row button {
    flex: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--panel-border);
    margin-top: auto;
}

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: scale-up 0.3s var(--transition-curve);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.modal-header h2 {
    font-family: var(--font-header);
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-body ol {
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-body h3 {
    font-size: 1rem;
    font-weight: 600;
}

.model-explainer {
    background: rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.model-explainer strong {
    color: var(--violet-main);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes scale-up {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* ==========================================================================
   Multi-Experiment and Dual-Upload Styles
   ========================================================================== */

/* Active Experiment Switcher overrides */
.active-experiment-switcher label {
    font-size: 0.8rem;
    padding: 0.6rem 0.5rem;
}

.active-experiment-switcher label i {
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

/* Upload Sub-tabs */
.upload-tabs-header {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.15rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--panel-border);
}

.upload-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.45rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: center;
}

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

.upload-tab-btn.active {
    background: var(--panel-bg);
    color: var(--violet-main);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.upload-tab-content {
    display: none;
}

.upload-tab-content.active {
    display: block;
}

/* Dual upload grid styling */
.dual-upload-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mini-upload {
    min-height: 55px !important;
    padding: 0.5rem 0.75rem !important;
}

.mini-upload .upload-btn-placeholder {
    gap: 0.25rem;
}

.mini-upload .upload-btn-placeholder i {
    font-size: 1.1rem !important;
}

.mini-upload .upload-btn-placeholder span {
    font-size: 0.7rem !important;
}

.btn-full-width {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem !important;
    font-size: 0.8rem !important;
}

button:disabled, button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Comparison Layouts */
.comparison-summary-card {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    line-height: 1.45;
}

.comparison-charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    flex-grow: 1;
}

@media (min-width: 576px) {
    .comparison-charts-row {
        grid-template-columns: 1fr 1fr;
    }
}

.comparison-chart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comparison-chart-wrapper h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
}

.comp-score-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.comp-score-badge.synergy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--syn-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.comp-score-badge.neutral {
    background: rgba(139, 92, 246, 0.15);
    color: var(--violet-main);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.comp-score-badge.antagonism {
    background: rgba(244, 63, 94, 0.15);
    color: var(--ant-coral);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.mini-chart {
    min-height: 280px !important;
}

/* ==========================================================================
   Print Styles for Reports
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .main-header, .panel-config, .nav-actions, .export-row, .app-footer, .tabs-container {
        display: none !important;
    }
    .app-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 2rem !important;
    }
    .panel {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    .styled-matrix {
        page-break-inside: avoid;
    }
    .chart-container {
        page-break-inside: avoid;
        background: transparent !important;
        border: 1px solid #ccc !important;
    }
    .tab-content {
        display: flex !important;
    }
    #tab-surface {
        display: none !important; /* 3D plots are often problematic in print */
    }
}

/* ==========================================================================
   Login Overlay & Logout Button Styles
   ========================================================================== */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: none; /* Controlled by class login-overlay-active */
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#login-overlay.login-overlay-active {
    display: flex;
}

.login-glow-1 {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(0,0,0,0) 70%);
    top: 20%;
    left: 25%;
    z-index: 1;
    pointer-events: none;
}

.login-glow-2 {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(0,0,0,0) 70%);
    bottom: 20%;
    right: 25%;
    z-index: 1;
    pointer-events: none;
}

.login-card {
    background: rgba(24, 24, 27, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    z-index: 2;
    animation: scale-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.login-logo i {
    font-size: 2.5rem;
    color: var(--violet-main);
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    animation: pulse-slow 3s infinite ease-in-out;
}

.login-logo h2 {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, var(--violet-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 0.5rem;
}

.login-logo p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.login-error-message {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout {
    background: rgba(244, 63, 94, 0.1) !important;
    border: 1px solid rgba(244, 63, 94, 0.2) !important;
    color: #f43f5e !important;
}

.btn-logout:hover {
    background: #f43f5e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25) !important;
}
