/* ========================================
   The Isomer Detective - Virtual Lab Styles
   CHE 201 Module 4: Stereochemistry
   Expanded version with pre-lab and post-lab
   ======================================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bench-color: #8b7355;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ========== Header ========== */
.lab-header {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.lab-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.lab-header .subtitle {
    opacity: 0.9;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.header-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.compound-info {
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.sample-badge {
    background: rgba(255,255,255,0.25);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

.timer {
    font-family: 'Courier New', monospace;
    background: rgba(0,0,0,0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.header-controls {
    margin-top: 0.5rem;
}

/* ========== Buttons ========== */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
}

.btn-heat {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
}

.btn-mark {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* ========== Phase Indicator ========== */
.phase-indicator {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.phase {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--surface-color);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.phase.active {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.phase.completed {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.phase-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
}

.phase.active .phase-num {
    background: var(--primary-color);
    color: white;
}

.phase.completed .phase-num {
    background: var(--success-color);
    color: white;
    font-size: 0;
}

.phase.completed .phase-num::after {
    content: '✓';
    font-size: 0.8rem;
}

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

.phase.active .phase-name,
.phase.completed .phase-name {
    color: var(--text-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    .phase-name {
        display: none;
    }
}

/* ========== Section Container ========== */
.phase-section {
    animation: fadeIn 0.3s ease;
}

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

.section-container {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-container h2 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.section-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.info-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

/* ========== Pre-Lab Quiz ========== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-question {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.question-text {
    margin-bottom: 1rem;
    font-size: 1rem;
}

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

.option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.option:hover {
    background: #f8fafc;
}

.option input[type="radio"] {
    margin-top: 0.2rem;
}

.feedback {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.feedback.correct {
    background: #dcfce7;
    border: 1px solid var(--success-color);
}

.feedback.incorrect {
    background: #fee2e2;
    border: 1px solid var(--danger-color);
}

.feedback .correct {
    color: var(--success-color);
    font-weight: 600;
}

.feedback .incorrect {
    color: var(--danger-color);
    font-weight: 600;
}

.feedback .error {
    color: var(--danger-color);
}

.quiz-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.quiz-results {
    max-width: 500px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 8px;
    text-align: center;
}

.quiz-results h3 {
    margin-bottom: 0.5rem;
}

.quiz-results .success {
    color: var(--success-color);
    font-weight: 600;
}

.quiz-results .warning {
    color: var(--warning-color);
    font-weight: 600;
}

/* ========== PPE Station ========== */
.ppe-station {
    max-width: 600px;
    margin: 0 auto;
}

.ppe-items {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ppe-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--background-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    min-width: 130px;
}

.ppe-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.ppe-item.worn {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.ppe-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.ppe-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: #fee2e2;
    color: var(--danger-color);
    margin-top: 0.5rem;
}

.ppe-item.worn .ppe-status {
    background: #dcfce7;
    color: var(--success-color);
}

.ppe-complete {
    text-align: center;
    padding: 1rem;
    background: #dcfce7;
    border-radius: 8px;
    color: #166534;
    font-weight: 500;
    margin-top: 1rem;
}

/* ========== Lab Bench ========== */
.lab-bench {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, #a08060, #8b7355, #6b5344);
    border-radius: 12px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.station {
    background: var(--surface-color);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.station h3 {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.station.locked {
    opacity: 0.5;
    pointer-events: none;
}

/* ========== Vial ========== */
.vial-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vial {
    cursor: grab;
    transition: all 0.3s ease;
}

.vial:active { cursor: grabbing; }

.vial.dragging {
    opacity: 0.5;
    transform: scale(1.1);
}

.vial-graphic {
    position: relative;
    width: 50px;
    height: 100px;
    pointer-events: none;
}

.vial-graphic * {
    pointer-events: none;
}

.vial-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 85px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.7), rgba(255,255,255,0.3));
    border: 2px solid #94a3b8;
    border-radius: 0 0 17px 17px;
    overflow: hidden;
}

.vial-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, #fef9c3, #fde047);
    border-radius: 0 0 15px 15px;
}

.vial-cap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 20px;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    border-radius: 3px 3px 0 0;
}

.vial-label {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.instruction {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ========== Equipment ========== */
.equipment-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.equipment-status {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.4rem 0.6rem;
    background: var(--background-color);
    border-radius: 6px;
}

.equipment-status.ready {
    background: #dcfce7;
    color: #166534;
}

.equipment-status.complete {
    background: #dbeafe;
    color: #1e40af;
}

/* Results Preview Station */
.results-station {
    display: flex;
    flex-direction: column;
}

.results-preview {
    text-align: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.results-preview .result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

/* Balance */
.balance {
    width: 140px;
    height: 90px;
    background: linear-gradient(180deg, #e2e8f0, #cbd5e1);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px dashed transparent;
    transition: all 0.3s ease;
}

.balance.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.balance-display {
    background: #1e293b;
    color: #4ade80;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
}

.balance-pan {
    width: 80px;
    height: 12px;
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border-radius: 4px;
    margin-top: auto;
}

/* Flask */
.flask {
    width: 80px;
    height: 110px;
    border: 2px dashed transparent;
    border-radius: 6px;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.flask.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.flask-graphic {
    position: relative;
    width: 70px;
    height: 100px;
    margin: 0 auto;
}

.flask-graphic.large {
    width: 100px;
    height: 140px;
}

.flask-neck {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 30px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.6), rgba(255,255,255,0.3));
    border: 2px solid #94a3b8;
    border-bottom: none;
}

.flask-graphic.large .flask-neck {
    width: 22px;
    height: 40px;
}

.flask-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 65px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.6), rgba(255,255,255,0.3));
    border: 2px solid #94a3b8;
    border-radius: 0 0 27px 27px;
    overflow: hidden;
}

.flask-graphic.large .flask-body {
    width: 80px;
    height: 95px;
    border-radius: 0 0 40px 40px;
}

.flask-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, rgba(254, 249, 195, 0.8), rgba(253, 224, 71, 0.8));
    transition: height 0.5s ease;
}

.flask-liquid.filled {
    height: 70%;
}

/* Polarimeter */
.polarimeter {
    width: 160px;
    height: 80px;
    border: 2px dashed transparent;
    border-radius: 6px;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.polarimeter.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.polarimeter-graphic {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.polarimeter-eyepiece {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 50%;
    border: 2px solid #64748b;
}

.polarimeter-body {
    width: 100px;
    height: 40px;
    background: linear-gradient(180deg, #64748b, #475569);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.polarimeter-tube {
    width: 80px;
    height: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.4), rgba(255,255,255,0.2));
    border: 2px solid #94a3b8;
    border-radius: 4px;
}

/* Mel-Temp */
.meltemp {
    width: 120px;
    height: 100px;
    border: 2px dashed transparent;
    border-radius: 6px;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.meltemp.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.meltemp-graphic {
    background: linear-gradient(180deg, #374151, #1f2937);
    border-radius: 6px;
    padding: 0.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.meltemp-graphic * {
    pointer-events: none;
}

.meltemp-display {
    background: #1e293b;
    color: #4ade80;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 0.4rem;
}

.meltemp-chamber {
    flex: 1;
    width: 70%;
    background: linear-gradient(180deg, #fef3c7, #fde68a);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capillary-slot {
    width: 6px;
    height: 45px;
    background: #1e293b;
    border-radius: 2px;
}

.capillary-slot.filled {
    background: linear-gradient(180deg, #1e293b 40%, #fde047 40%);
}

/* ========== Modals ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

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

.modal-content h2 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.modal-content .instruction {
    margin-bottom: 1rem;
    text-align: left;
    font-size: 0.95rem;
}

.modal-content.warning {
    border: 3px solid var(--warning-color);
    text-align: center;
}

.modal-content.warning h2 {
    color: var(--warning-color);
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* Balance Modal */
.balance-modal-display {
    text-align: center;
    margin: 1.5rem 0;
}

.digital-display {
    display: inline-block;
    background: #1e293b;
    color: #4ade80;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
}

.balance-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Flask Modal */
.flask-modal-content {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.flask-info {
    flex: 1;
    min-width: 200px;
}

.flask-info p {
    margin-bottom: 0.75rem;
}

.input-group {
    margin: 1rem 0;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Polarimeter Scope */
.scope-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.scope {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 6px solid #1e293b;
    overflow: hidden;
    position: relative;
    background: #000;
}

.scope-half {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    transition: background-color 0.1s ease;
}

.scope-half.left {
    left: 0;
    background: #666;
}

.scope-half.right {
    right: 0;
    background: #999;
}

.scope-divider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: #333;
}

.polarimeter-controls {
    text-align: center;
    margin: 1rem 0;
}

.rotation-control {
    margin-top: 1rem;
}

.rotation-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.rotation-control input[type="range"] {
    width: 100%;
    max-width: 350px;
    height: 8px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

.rotation-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.rotation-display {
    margin-top: 0.5rem;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
}

.polarimeter-result,
.meltemp-result {
    background: #f0fdf4;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
}

.polarimeter-result h3,
.meltemp-result h3 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

/* Melting Point Modal */
.meltemp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.capillary-view {
    width: 80px;
    height: 120px;
    background: linear-gradient(180deg, #fef3c7, #fde68a);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #d97706;
}

.capillary-tube {
    width: 16px;
    height: 100px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.7), rgba(255,255,255,0.4));
    border: 2px solid #94a3b8;
    border-radius: 0 0 8px 8px;
    position: relative;
    overflow: hidden;
}

.sample-crystals {
    position: absolute;
    bottom: 5px;
    left: 2px;
    right: 2px;
    height: 35px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-content: flex-end;
    transition: all 0.5s ease;
}

.sample-crystals .crystal {
    width: 5px;
    height: 5px;
    background: #fde047;
    border: 1px solid #ca8a04;
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.sample-crystals.softening .crystal {
    opacity: 0.8;
    transform: rotate(45deg) scale(0.9);
}

.sample-crystals.melting .crystal {
    border-radius: 50%;
    transform: rotate(0deg);
    opacity: 0.6;
}

.sample-crystals.melted {
    height: 18px;
    background: linear-gradient(180deg, rgba(253, 224, 71, 0.8), rgba(234, 179, 8, 0.9));
    border-radius: 0 0 6px 6px;
}

.sample-crystals.melted .crystal {
    display: none;
}

.temp-display-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
}

.temp-graph {
    width: 100%;
    max-width: 400px;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.meltemp-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.heat-rate-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heat-rate-control select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ========== Analysis Section ========== */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.analysis-grid > div {
    background: var(--background-color);
    border-radius: 10px;
    padding: 1.25rem;
}

.analysis-grid h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.05rem;
}

.data-summary .data-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.data-summary .data-item:last-child {
    border-bottom: none;
}

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

.data-summary span {
    font-weight: 600;
}

/* Structure Diagram */
.structure-display {
    text-align: center;
}

.structure-diagram {
    max-width: 250px;
    margin: 0 auto;
}

.molecule-svg {
    width: 100%;
    height: auto;
}

.mol-text {
    font-size: 13px;
    fill: var(--text-color);
}

.mol-bond {
    stroke: var(--text-color);
    stroke-width: 2;
}

.carbon-circle {
    fill: #dbeafe;
    stroke: var(--primary-color);
    stroke-width: 2;
}

.carbon-label {
    font-size: 11px;
    font-weight: bold;
    fill: var(--primary-color);
}

.structure-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Config Assignment */
.config-row,
.input-row {
    margin-bottom: 1rem;
}

.config-row label,
.input-row label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.config-select,
.input-row input {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--surface-color);
}

.config-select:focus,
.input-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Results Modal */
.results-view {
    text-align: center;
    max-width: 600px;
}

.score-display,
.time-display {
    font-size: 1.1rem;
    margin: 0.25rem 0;
}

.results-summary {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
    text-align: left;
}

.results-summary h3 {
    margin-bottom: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: var(--text-muted);
}

.result-value {
    text-align: right;
}

.result-value.correct {
    color: var(--success-color);
}

.result-value.incorrect {
    color: var(--danger-color);
}

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

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

.feedback-text {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
}

.notebook-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    text-align: left;
}

.notebook-summary h4 {
    margin-bottom: 0.5rem;
}

.notebook-summary ul {
    margin-left: 1.25rem;
}

.notebook-summary li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* ========== Post-Lab ========== */
.postlab-container {
    max-width: 700px;
    margin: 0 auto;
}

.postlab-question {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.postlab-question h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.postlab-question p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.postlab-question textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

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

.postlab-question input[type="number"] {
    width: 150px;
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.postlab-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.postlab-results {
    max-width: 500px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: #dcfce7;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--success-color);
}

.postlab-results h3 {
    color: var(--success-color);
    margin-bottom: 0.75rem;
}

/* ========== Notifications ========== */
.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--surface-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1100;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
}

/* ========== Footer ========== */
.lab-footer {
    text-align: center;
    padding: 1.25rem;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lab-footer .hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== Drag & Drop Feedback ========== */
.drag-over {
    border-color: var(--primary-color) !important;
    background: #eff6ff !important;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .lab-header h1 {
        font-size: 1.4rem;
    }

    .header-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .lab-bench {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .meltemp-controls {
        flex-direction: column;
    }

    .meltemp-controls .btn {
        width: 100%;
    }
}

/* ========== Knowledge Check Modal ========== */
.knowledge-check-modal .modal-content {
    max-width: 600px;
}

.knowledge-check-modal h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.knowledge-check-modal h2::before {
    content: '?';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.kc-question {
    font-size: 1.05rem;
    margin: 1.25rem 0;
    line-height: 1.6;
}

.kc-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.kc-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--background-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.kc-option:hover {
    background: #e2e8f0;
}

.kc-option.selected {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.kc-option.correct {
    border-color: var(--success-color);
    background: #dcfce7;
}

.kc-option.incorrect {
    border-color: var(--danger-color);
    background: #fee2e2;
}

.kc-option input[type="radio"],
.kc-option input[type="checkbox"] {
    margin-top: 0.15rem;
}

.kc-feedback {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.kc-feedback.show {
    display: block;
}

.kc-feedback.correct {
    background: #dcfce7;
    border: 2px solid var(--success-color);
}

.kc-feedback.correct::before {
    content: '✓ Correct! ';
    color: var(--success-color);
    font-weight: 600;
}

.kc-feedback.incorrect {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
}

.kc-feedback.incorrect::before {
    content: '✗ Incorrect. ';
    color: var(--danger-color);
    font-weight: 600;
}

.kc-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ========== Progress Bar Component ========== */
.progress-delay {
    background: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.progress-delay h4 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    border-radius: 12px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-time {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ========== Instruction Panel ========== */
.instruction-panel {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.instruction-panel.collapsed .instruction-content {
    display: none;
}

.instruction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #e0f2fe;
    cursor: pointer;
    user-select: none;
}

.instruction-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0369a1;
    margin: 0;
    font-size: 1rem;
}

.instruction-header h4::before {
    content: '📋';
}

.instruction-toggle {
    font-size: 1.25rem;
    color: #0369a1;
    transition: transform 0.2s;
}

.instruction-panel.collapsed .instruction-toggle {
    transform: rotate(-90deg);
}

.instruction-content {
    padding: 1.25rem;
}

.instruction-content ol,
.instruction-content ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.instruction-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.instruction-content .note {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 0.75rem 1rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.instruction-acknowledge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #dcfce7;
    border-radius: 6px;
    margin-top: 1rem;
}

.instruction-acknowledge input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.instruction-acknowledge label {
    font-weight: 500;
    color: #166534;
    cursor: pointer;
}

/* ========== Observation Entry ========== */
.observation-entry {
    background: #fffbeb;
    border: 2px solid #fcd34d;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.observation-entry label {
    display: block;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.observation-entry label::before {
    content: '📝 ';
}

.observation-entry .required {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.observation-entry textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #fcd34d;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.observation-entry textarea:focus {
    outline: none;
    border-color: var(--warning-color);
}

.observation-entry textarea.invalid {
    border-color: var(--danger-color);
    background: #fef2f2;
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: var(--warning-color);
}

.char-counter.error {
    color: var(--danger-color);
}

/* ========== Reference Data Table ========== */
.reference-table-container {
    background: var(--surface-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.reference-table-container h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.reference-table th {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.reference-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.reference-table tr:hover {
    background: #f8fafc;
}

.reference-table tr.selected {
    background: #eff6ff;
    border: 2px solid var(--primary-color);
}

.reference-table tr.clickable {
    cursor: pointer;
}

.reference-table tr.clickable:hover {
    background: #e0f2fe;
}

.reference-table tr.match-correct {
    background: #dcfce7;
    border: 2px solid var(--success-color);
}

.reference-table tr.match-incorrect {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
}

/* ========== Safety Section Enhancements ========== */
.safety-briefing {
    background: #fef3c7;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.safety-briefing h3 {
    color: #92400e;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.safety-briefing h3::before {
    content: '⚠️';
}

.ppe-explanation {
    display: none;
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    border-left: 4px solid var(--primary-color);
}

.ppe-item.worn .ppe-explanation,
.ppe-item:focus .ppe-explanation {
    display: block;
}

.equipment-checklist {
    background: var(--background-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.equipment-checklist h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.checklist-item.checked label {
    color: var(--success-color);
    text-decoration: line-through;
}

.sds-section {
    background: #fce7f3;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.sds-section h3 {
    color: #9d174d;
    margin-bottom: 0.5rem;
}

.sds-expandable {
    margin-top: 1rem;
}

.sds-toggle {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    background: #fbcfe8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sds-content {
    display: none;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 0 0 6px 6px;
    font-size: 0.9rem;
}

.sds-content.show {
    display: block;
}

.sds-content ul {
    margin-left: 1.25rem;
}

.sds-content li {
    margin-bottom: 0.5rem;
}

/* ========== Typed Confirmation Input ========== */
.typed-confirmation {
    background: var(--background-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.typed-confirmation label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.typed-confirmation input {
    width: 150px;
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.typed-confirmation input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.typed-confirmation input.correct {
    border-color: var(--success-color);
    background: #dcfce7;
}

.typed-confirmation input.incorrect {
    border-color: var(--danger-color);
    background: #fee2e2;
}

.typed-confirmation .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ========== Multiple Readings Display ========== */
.readings-table {
    width: 100%;
    margin: 1rem 0;
}

.readings-table th,
.readings-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.readings-table th {
    background: var(--background-color);
}

.readings-table .average-row {
    background: #dcfce7;
    font-weight: 600;
}

/* ========== Step Indicator (within phase) ========== */
.step-indicator {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--surface-color);
    border-radius: 16px;
    font-size: 0.85rem;
    border: 2px solid var(--border-color);
}

.step-indicator .step.active {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.step-indicator .step.completed {
    border-color: var(--success-color);
    background: #dcfce7;
}

.step-indicator .step .step-num {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
}

.step-indicator .step.active .step-num {
    background: var(--primary-color);
    color: white;
}

.step-indicator .step.completed .step-num {
    background: var(--success-color);
    color: white;
}

.step-indicator .step.completed .step-num::after {
    content: '✓';
}

/* ========== Error Analysis Section ========== */
.error-analysis {
    background: #faf5ff;
    border: 2px solid #c4b5fd;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.error-analysis h4 {
    color: #6d28d9;
    margin-bottom: 1rem;
}

.error-calc-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.error-calc-row label {
    font-weight: 500;
    min-width: 150px;
}

.error-calc-row input {
    width: 100px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.error-calc-row .unit {
    color: var(--text-muted);
}

/* ========== Reasoning Text Entry ========== */
.reasoning-entry {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.reasoning-entry label {
    display: block;
    font-weight: 600;
    color: #166534;
    margin-bottom: 0.75rem;
}

.reasoning-entry textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #86efac;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.reasoning-entry textarea:focus {
    outline: none;
    border-color: var(--success-color);
}

/* ========== Final Summary Screen ========== */
.final-summary {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
}

.final-summary h2 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.score-item {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
}

.score-item .section-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.score-item .section-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.improvement-areas {
    text-align: left;
    background: #fef3c7;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.improvement-areas h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.improvement-areas ul {
    margin-left: 1.25rem;
}

/* ========== Quiz Explanation Box ========== */
.explanation-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
}

/* ========== Responsive Adjustments for New Components ========== */
@media (max-width: 600px) {
    .reference-table {
        font-size: 0.8rem;
    }

    .reference-table th,
    .reference-table td {
        padding: 0.5rem;
    }

    .step-indicator {
        justify-content: center;
    }

    .error-calc-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .kc-option {
        padding: 0.6rem 0.75rem;
    }
}
