/* Log-Loss Classification Lab - Custom Styles */
/* Extends shared/css/main.css - follows MAE tool patterns */

/* Professor Mode styles are centralized in shared/css/main.css */

/* Position Professor Mode toggle in hero header */
.hero-header .professor-mode-toggle {
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* ===== Model Sections ===== */
.model-section {
    margin-bottom: 1.5rem;
}

.model-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--app-border, #e2e8f0);
}

.model-header h3 {
    margin: 0;
    color: var(--app-text, #1e293b);
    font-size: 1.15rem;
}

/* ===== Controls Grid ===== */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--app-text, #1e293b);
}

.param-name {
    font-size: 0.95rem;
}

.param-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 1rem;
    color: var(--app-accent, #2563eb);
    font-weight: 700;
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
}

.slider-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-input-row input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #dbeafe, var(--app-accent, #2563eb));
    border-radius: 4px;
    outline: none;
}

.slider-input-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--app-accent, #2563eb);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.slider-input-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.5);
}

.slider-input-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--app-accent, #2563eb);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.slider-input-row input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--app-border, #e2e8f0);
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

/* ===== Results Display ===== */
.results-display {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.equation-display {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.95rem;
    color: var(--app-text, #1e293b);
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--app-border, #e2e8f0);
}

.equation-display .dynamic-value {
    color: var(--app-accent, #2563eb);
    font-weight: 700;
}

.metrics-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.logloss-display,
.accuracy-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.metric-label {
    font-weight: 600;
    color: var(--app-muted, #64748b);
    font-size: 0.95rem;
}

.metric-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
}

.logloss-value {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.logloss-value.excellent {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.logloss-value.good {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.logloss-value.poor {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.accuracy-value {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #5b21b6;
}

/* ===== Plot Container ===== */
.plot-container {
    width: 100%;
    min-height: 400px;
    border-radius: 12px;
    background: white;
    margin-bottom: 1rem;
}

/* ===== Confusion Matrix ===== */
.confusion-matrix-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.confusion-matrix-container h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: var(--app-muted, #64748b);
}

.confusion-matrix {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 4px;
    max-width: 320px;
}

.cm-header {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--app-muted, #64748b);
    text-align: center;
    padding: 0.5rem;
}

.cm-row-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--app-muted, #64748b);
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
}

.cm-cell {
    padding: 0.75rem;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
}

.cm-tn {
    background: #d1fae5;
    color: #065f46;
}

.cm-tp {
    background: #d1fae5;
    color: #065f46;
}

.cm-fp {
    background: #fee2e2;
    color: #991b1b;
}

.cm-fn {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== Comparison Section ===== */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.comparison-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.comparison-item.comparison-optimal {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.comparison-label {
    font-size: 0.85rem;
    color: var(--app-muted, #64748b);
    margin-bottom: 0.5rem;
}

.comparison-value {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--app-text, #1e293b);
}

.gap-value {
    color: #ea580c;
}

.comparison-verdict {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #eff6ff;
    border-left: 4px solid var(--app-accent, #2563eb);
    border-radius: 0 8px 8px 0;
}

.comparison-verdict p {
    margin: 0;
}

/* ===== Categorical Toggle ===== */
.categorical-toggle-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fefce8;
    border-radius: 10px;
    border: 1px solid #fde047;
}

.categorical-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.categorical-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.categorical-toggle input:checked + .toggle-slider {
    background: #f59e0b;
}

.categorical-toggle input:checked + .toggle-slider::after {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 600;
    color: var(--app-text, #1e293b);
}

.category-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.category-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.category-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.categorical-controls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--app-border, #e2e8f0);
}

/* ===== Interpretation Aid ===== */
.interpretation-aid {
    margin-top: 1rem;
}

.interpretation-content {
    padding: 1rem;
}

.dynamic-interpretation {
    font-size: 0.95rem;
    line-height: 1.6;
}

.dynamic-interpretation p {
    margin: 0.5rem 0;
}

.dynamic-interpretation .interp-highlight {
    background: #fef3c7;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== Concept Grid ===== */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.concept-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 3px solid var(--app-accent, #2563eb);
}

.concept-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--app-text, #1e293b);
}

.concept-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--app-muted, #64748b);
}

/* ===== Guide Sections ===== */
.guide-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--app-border, #e2e8f0);
}

.guide-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.guide-section h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--app-text, #1e293b);
}

.guide-section p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--app-muted, #64748b);
    line-height: 1.6;
}

/* ===== Scenario Description ===== */
.scenario-description-container {
    margin-top: 1rem;
}

.scenario-placeholder {
    color: var(--app-muted, #64748b);
    font-style: italic;
}

/* ===== Equation Block ===== */
.equation-block {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.equation-block p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

/* ===== Callout Boxes ===== */
.callout-box {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.callout-blue {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
}

.callout-amber {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.callout-box p {
    margin: 0;
}

/* ===== Footer Styles ===== */
.app-footer {
    background: #1e293b;
    color: #e2e8f0;
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-nav {
    margin-bottom: 1rem;
}

.footer-nav .back-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 500;
}

.footer-nav .back-link:hover {
    text-decoration: underline;
}

.footer-meta {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.footer-meta .separator {
    margin: 0 0.5rem;
}

.footer-citation {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.citation-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.footer-citation a {
    color: #93c5fd;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 1rem;
}

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--app-text, #1e293b);
}

.data-table td {
    color: var(--app-muted, #64748b);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .confusion-matrix {
        max-width: 100%;
    }
}
