/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a231c;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== NAVIGATION ===== */
nav {
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    padding: 35px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    color: white;
    text-align: center;
    z-index: 100;
    position: relative;
}

.nav-content {
    max-width: 1800px;
    margin: 0 auto; 
    display: flex;
    align-items: center;
    justify-content: center; /* Keep centered for the title */
    gap: 50px;
    position: relative; /* Added for absolute positioning of logo */
}

nav h1 {
    font-size: 24px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* ===== MAIN CONTAINER ===== */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    overflow-y: auto;
    padding: 20px;
    z-index: 50;
}

.sidebar h2 {
    color: #1a231c;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 3px solid #66c18e;
    padding-bottom: 8px;
}

/* ===== SETUP STEPS ===== */
.setup-step {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.setup-step.active {
    border-color: #66c18e;
    background: linear-gradient(135deg, #e8f5ee 0%, #f0f8ff 100%);
    box-shadow: 0 4px 12px rgba(102, 193, 142, 0.2);
}

.setup-step h3 {
    color: #45825d;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.status-indicator {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.status-indicator.completed {
    color: #45825d;
    font-weight: 600;
}

/* ===== ION SELECTOR ===== */
#ionSelector {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

#ionSelector:focus {
    outline: none;
    border-color: #66c18e;
    box-shadow: 0 0 0 3px rgba(102, 193, 142, 0.1);
}

/* ===== REAGENT OPTIONS ===== */
#reagentOptions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.reagent-btn {
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(102, 193, 142, 0.3);
}

.reagent-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 193, 142, 0.4);
}

.reagent-btn.selected {
    background: linear-gradient(135deg, #45825d 0%, #356647 100%);
    box-shadow: 0 0 20px rgba(69, 130, 93, 0.6);
}

/* ===== TEST BUTTONS ===== */
.test-btn {
    width: 100%;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(102, 193, 142, 0.3);
}

.test-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45825d 0%, #66c18e 100%);
    transform: translateX(5px);
    box-shadow: 0 6px 16px rgba(102, 193, 142, 0.4);
}

.test-btn.selected {
    background: linear-gradient(135deg, #45825d 0%, #356647 100%);
    box-shadow: 0 0 20px rgba(69, 130, 93, 0.6);
}

.test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== RESET BUTTON ===== */
.reset-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

/* ===== WORK AREA ===== */
.work-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ===== LAB BACKGROUND ===== */
.lab-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
        url('5187314.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    z-index: 1;
}

/* ===== LAB BENCH ===== */
.lab-bench {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(180deg, #8b7355 0%, #6d5a45 100%);
    z-index: 2;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.3);
}

.lab-bench::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(0,0,0,0.05) 80px, rgba(0,0,0,0.05) 82px),
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(139, 115, 85, 0.3) 3px, rgba(139, 115, 85, 0.3) 4px);
    opacity: 0.6;
}

.bench-edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(180deg, #a08968 0%, #8b7355 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* ===== CANVAS ===== */
#canvas {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 3;
}

.instruction-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    color: #45825d;
    font-weight: 600;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
    background: rgba(255, 255, 255, 0.7);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
}

/* ===== APPARATUS CONTAINER ===== */
#apparatusContainer {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ===== APPARATUS BASE STYLES ===== */
.apparatus {
    position: absolute;
    cursor: grab;
    transition: all 0.3s ease;
    z-index: 10;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.25));
}

.apparatus:active {
    cursor: grabbing;
}

.apparatus.dragging {
    opacity: 0.9;
    z-index: 1000;
    transform: scale(1.08);
    filter: drop-shadow(0 15px 30px rgba(102, 193, 142, 0.4));
}

.apparatus.snapped {
    cursor: pointer !important;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
    pointer-events: auto;
}

.apparatus.snapped:hover {
    filter: drop-shadow(0 12px 25px rgba(102, 193, 142, 0.5));
    transform: translateY(-2px);
}

/* Prevent dragging cursor on snapped items */
.apparatus.snapped:active {
    cursor: pointer !important;
}

.apparatus:hover:not(.dragging) {
    filter: drop-shadow(0 12px 25px rgba(102, 193, 142, 0.5));
    transform: translateY(-2px);
}

/* ===== SVG APPARATUS ===== */
.apparatus-svg {
    display: block;
}

/* ===== LIQUID ANIMATIONS ===== */
.liquid-fill {
    transition: fill 1s ease, opacity 0.5s ease;
}

.meniscus {
    transition: fill 1s ease;
}

/* ===== FLAME ANIMATIONS ===== */
.flame-group {
    animation: flameFlicker 0.15s infinite alternate;
}

@keyframes flameFlicker {
    0% { 
        transform: scale(1, 1) translateY(0); 
        opacity: 0.9;
    }
    100% { 
        transform: scale(1.03, 0.97) translateY(-1px); 
        opacity: 1;
    }
}

.flame-outer {
    animation: flameDance 0.3s infinite alternate;
}

@keyframes flameDance {
    0% { transform: translateX(-0.5px); }
    100% { transform: translateX(0.5px); }
}

/* ===== LITMUS PAPER COLOR CHANGE ===== */
.litmus-paper {
    transition: fill 1.5s ease;
}

.litmus-template .litmus-paper {
    fill: #ff6b6b;
}

.apparatus[data-type="litmus"].blue .litmus-paper {
    fill: #4169E1;
}

/* ===== HOT PLATE ANIMATIONS ===== */
.hotplate-template .heat-element {
    transition: display 0.3s ease;
}

.apparatus[data-type="hotplate"].heating .heat-element {
    display: block !important;
    animation: plateGlow 1s infinite alternate;
}

@keyframes plateGlow {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.apparatus[data-type="hotplate"].heating .heating-surface {
    fill: #ff4444;
    animation: surfaceHeat 2s infinite;
}

@keyframes surfaceHeat {
    0%, 100% { fill: #ff4444; }
    50% { fill: #ff6666; }
}

/* ===== HOTPLATE INTERACTION ===== */
.apparatus[data-type="hotplate"] {
    cursor: pointer;
}

.apparatus[data-type="hotplate"]:hover:not(.heating) {
    filter: drop-shadow(0 8px 20px rgba(255, 68, 68, 0.4));
}

.apparatus[data-type="hotplate"].heating {
    animation: hotplateVibrate 0.1s infinite;
}

@keyframes hotplateVibrate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

/* ===== LIMEWATER EFFECTS ===== */
.limewater-fill {
    transition: fill 3s ease, opacity 2s ease;
}

.limewater-fill.cloudy {
    fill: rgba(240,240,240,0.95);
    opacity: 1;
    animation: cloudiness 2s ease-in-out;
}

@keyframes cloudiness {
    0% { 
        fill: rgba(255,255,255,0.9);
        filter: blur(0px);
    }
    50% {
        filter: blur(2px);
    }
    100% { 
        fill: rgba(220,220,220,0.95);
        filter: blur(1px);
    }
}

/* Cloudy particles in limewater */
.cloudy-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(200,200,200,0.6);
    pointer-events: none;
    animation: floatParticle 3s ease-in-out infinite;
}

@keyframes floatParticle {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-10px) translateX(5px); }
}

/* ===== GAS DELIVERY TUBE ANIMATIONS ===== */
.tube-bubbles {
    transition: display 0.3s;
}

.tube-bubbles.active {
    display: block !important;
}

.tube-bubble-1 {
    animation: bubbleFlow1 2s infinite;
}

.tube-bubble-2 {
    animation: bubbleFlow2 2s infinite 0.3s;
}

.tube-bubble-3 {
    animation: bubbleFlow3 2s infinite 0.6s;
}

.tube-bubble-4 {
    animation: bubbleFlow4 2s infinite 0.9s;
}

@keyframes bubbleFlow1 {
    0% { cx: 20; cy: 30; opacity: 0; }
    25% { opacity: 0.7; }
    100% { cx: 60; cy: 50; opacity: 0; }
}

@keyframes bubbleFlow2 {
    0% { cx: 60; cy: 50; opacity: 0; }
    25% { opacity: 0.7; }
    100% { cx: 140; cy: 50; opacity: 0; }
}

@keyframes bubbleFlow3 {
    0% { cx: 140; cy: 50; opacity: 0; }
    25% { opacity: 0.7; }
    100% { cx: 180; cy: 70; opacity: 0; }
}

@keyframes bubbleFlow4 {
    0% { cx: 180; cy: 70; opacity: 0; }
    25% { opacity: 0.7; }
    100% { cx: 180; cy: 85; opacity: 0; }
}

/* ===== SNAP ZONES ===== */
.snap-zone {
    position: absolute;
    border: 3px dashed #66c18e;
    background: rgba(102, 193, 142, 0.08);
    border-radius: 15px;
    pointer-events: none;
    display: none;
    box-shadow: inset 0 0 20px rgba(102, 193, 142, 0.1);
}

.snap-zone.active {
    display: block;
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
        border-color: #66c18e;
    }
    50% { 
        opacity: 1; 
        transform: scale(1.02);
        border-color: #45825d;
    }
}

/* ===== RESULTS PANEL ===== */
.results-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    max-width: 380px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: none;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 193, 142, 0.2);
}

.results-panel.visible {
    display: block;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.results-panel h3 {
    color: #45825d;
    margin-bottom: 12px;
    font-size: 20px;
    border-bottom: 2px solid #66c18e;
    padding-bottom: 8px;
}

#resultsContent {
    color: #1a231c;
    line-height: 1.7;
    font-size: 14px;
}

.observation {
    background: linear-gradient(135deg, #e8f5ee 0%, #f0f8ff 100%);
    border-left: 4px solid #66c18e;
    padding: 15px;
    margin-top: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(102, 193, 142, 0.1);
}

.observation strong {
    color: #1a231c;
}

/* ===== CLICKABLE INDICATORS ===== */
.clickable-indicator {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    animation: bounce 1.2s infinite;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(102, 193, 142, 0.4);
    pointer-events: none;  /* ADD THIS LINE - indicator won't block clicks */
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== DROPLET ANIMATION ===== */
.droplet {
    position: absolute;
    width: 10px;
    height: 14px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), var(--droplet-color));
    border-radius: 50% 50% 50% 0;
    transform: rotate(45deg);
    opacity: 0;
    pointer-events: none;
    z-index: 500;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.droplet.falling {
    animation: dropletFall 1s ease-in forwards;
}

@keyframes dropletFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(45deg) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(90px) rotate(45deg) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translateY(180px) rotate(45deg) scale(0.7);
    }
}

/* ===== PRECIPITATE EFFECTS ===== */
.precipitate-cloud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to bottom, transparent 60%, var(--precip-color));
    opacity: 0;
    border-radius: inherit;
    animation: cloudForm 2.5s ease-out forwards;
    pointer-events: none;
}

@keyframes cloudForm {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

.precip-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--particle-color);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.precip-particle.settling {
    animation: particleSettle var(--settle-duration) ease-in forwards;
}

@keyframes particleSettle {
    0% {
        opacity: 0;
        transform: translateY(var(--start-y)) scale(0.4);
    }
    20% {
        opacity: 0.95;
    }
    80% {
        opacity: 0.85;
    }
    100% {
        opacity: 0.75;
        transform: translateY(var(--end-y)) scale(1);
    }
}

/* ===== MIXING EFFECT ===== */
.liquid-fill.mixing {
    animation: liquidSwirl 2s ease-in-out;
}

@keyframes liquidSwirl {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(3deg) scale(1.03);
    }
    50% {
        transform: rotate(0deg) scale(1);
    }
    75% {
        transform: rotate(-3deg) scale(1.03);
    }
}

/* ===== FORMATION PROGRESS ===== */
.formation-progress {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 600;
    box-shadow: 0 4px 15px rgba(102, 193, 142, 0.5);
}

.formation-progress::before {
    content: '⚗️ ';
}

/* ===== BUBBLING EFFECTS ===== */
.bubble {
    position: absolute;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,1), rgba(135, 206, 250, 0.8));
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 400;
    box-shadow: 0 0 10px rgba(135, 206, 250, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.9);
}

.bubble.rising {
    animation: bubbleRise var(--bubble-duration) ease-out forwards;
}

@keyframes bubbleRise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    30% {
        opacity: 0.95;
        transform: translateY(-30px) scale(1.25);
    }
    70% {
        opacity: 0.75;
        transform: translateY(-60px) scale(1.4);
    }
    100% {
        opacity: 0;
        transform: translateY(-95px) scale(0.4);
    }
}

.liquid-fill.fizzing {
    animation: liquidShake 0.25s infinite;
}

@keyframes liquidShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* ===== VAPOR EFFECTS ===== */
.vapor-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(220, 220, 220, 0.7), rgba(255, 255, 255, 0.4), transparent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 450;
    filter: blur(4px);
}

.vapor-particle.rising {
    animation: vaporRise var(--vapor-duration) ease-out forwards;
}

@keyframes vaporRise {
    0% {
        opacity: 0.8;
        transform: translateY(0) translateX(0) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-50px) translateX(var(--drift-x)) scale(1.6);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) translateX(var(--drift-x)) scale(2.2);
    }
}

.vapor-particle.heat {
    background: radial-gradient(circle, rgba(255, 220, 180, 0.6), rgba(255, 240, 220, 0.4), transparent);
}

.vapor-particle.gas {
    background: radial-gradient(circle, rgba(230, 230, 255, 0.7), rgba(245, 245, 255, 0.4), transparent);
}

/* ===== HEAT EFFECTS ===== */
.heat-glow {
    position: absolute;
    inset: -12px;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(255, 120, 0, 0.5), rgba(255, 170, 0, 0.3), transparent);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    animation: heatPulse 1.8s infinite;
}

@keyframes heatPulse {
    0%, 100% { 
        opacity: 0.7;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.06);
    }
}

.heat-shimmer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        0deg,
        transparent 0%,
        rgba(255, 210, 120, 0.15) 25%,
        rgba(255, 170, 80, 0.25) 50%,
        rgba(255, 210, 120, 0.15) 75%,
        transparent 100%
    );
    opacity: 0;
    pointer-events: none;
    animation: shimmerWave 1s infinite;
}

@keyframes shimmerWave {
    0% {
        opacity: 0;
        transform: translateY(100%);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100%);
    }
}

.temp-indicator {
    position: absolute;
    top: -35px;
    right: -35px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5);
    z-index: 600;
    animation: tempBounce 0.6s ease-out;
}

@keyframes tempBounce {
    0% {
        opacity: 0;
        transform: scale(0.4) translateY(15px);
    }
    60% {
        transform: scale(1.15) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.temp-indicator::before {
    content: '🌡️';
    margin-right: 5px;
}

.liquid-fill.heating {
    animation: liquidBoil 0.35s infinite;
    filter: brightness(1.25) saturate(1.4);
}

@keyframes liquidBoil {
    0%, 100% { 
        transform: translateY(0) scaleY(1);
    }
    25% { 
        transform: translateY(-1.5px) scaleY(1.02);
    }
    75% { 
        transform: translateY(1.5px) scaleY(0.98);
    }
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

.progress-bar-container {
    width: 350px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #e8f5ee 0%, #ffffff 100%);
    border-radius: 15px;
    width: 0%;
    animation: loading 1.8s ease-in-out forwards;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}
    .nichrome-wire {
        transition: stroke 0.5s ease;
    }

    .sample-bead {
        transition: fill 1s ease, opacity 0.8s ease;
    }

    .apparatus.heating .nichrome-wire {
        stroke: #FFD700;
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    }
@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .results-panel {
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 250px;
    }
    
    .results-panel {
        position: relative;
        top: 10px;
        right: 10px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

/* ===== STEP PROGRESS UI ===== */
.step-progress {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #dee2e6;
    margin-bottom: 15px;
}

.step-progress h4 {
    color: #45825d;
    margin-bottom: 12px;
    font-size: 16px;
    border-bottom: 2px solid #66c18e;
    padding-bottom: 6px;
    text-align: center;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 1 !important;
}

.step-item.active {
    background: linear-gradient(135deg, #e8f5ee 0%, #f0f8ff 100%);
    border-color: #66c18e;
    box-shadow: 0 2px 8px rgba(102, 193, 142, 0.3);
    transform: scale(1.02);
}

.step-item.completed {
    background: #e8f5ee;
    opacity: 0.7 !important;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 11px;
    flex-shrink: 0;
}

.step-item.completed .step-number {
    background: linear-gradient(135deg, #45825d 0%, #356647 100%);
}

.step-item.active .step-number {
    animation: pulseStep 1s infinite;
}

@keyframes pulseStep {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.step-text {
    flex: 1;
    color: #1a231c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.step-item.active .step-text {
    font-weight: 600;
    color: #45825d;
}

.step-status {
    font-size: 14px;
    flex-shrink: 0;
}

.next-step-btn {
    width: 100%;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 193, 142, 0.3);
}

.next-step-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45825d 0%, #66c18e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 193, 142, 0.4);
}

.next-step-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== OBSERVATIONS SECTION ===== */
.observations-section {
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #dee2e6;
}

.observations-section h4 {
    color: #45825d;
    margin-bottom: 12px;
    font-size: 16px;
    border-bottom: 2px solid #66c18e;
    padding-bottom: 6px;
}

#observationsList {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.observation-item {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #66c18e;
    font-size: 13px;
    color: #1a231c;
    line-height: 1.6;
    animation: fadeInObservation 0.4s ease-out;
}

@keyframes fadeInObservation {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.observation-item strong {
    color: #45825d;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.step-item.active {
    background: linear-gradient(135deg, #e8f5ee 0%, #f0f8ff 100%);
    border-color: #66c18e;
    box-shadow: 0 2px 8px rgba(102, 193, 142, 0.2);
}

.step-item.completed {
    background: #e8f5ee;
    opacity: 0.8;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.step-item.completed .step-number {
    background: linear-gradient(135deg, #45825d 0%, #356647 100%);
}

.step-text {
    flex: 1;
    color: #1a231c;
    font-size: 14px;
    font-weight: 500;
}

.step-status {
    font-size: 18px;
    flex-shrink: 0;
}

.next-step-btn {
    width: 100%;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 193, 142, 0.3);
}

.next-step-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45825d 0%, #66c18e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 193, 142, 0.4);
}

.next-step-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== ACID DROPLET ANIMATION ===== */
.acid-droplet {
    position: absolute;
    width: 8px;
    height: 10px;
    background: radial-gradient(circle, rgba(255,255,180,0.9), rgba(255,255,100,0.7));
    border-radius: 50% 50% 50% 0;
    transform: rotate(45deg);
    animation: acidDrop 0.8s ease-in forwards;
    pointer-events: none;
    z-index: 550;
}

@keyframes acidDrop {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(45deg);}
100% {
    opacity: 0;
    transform: translateY(30px) rotate(45deg);
}
}
/* ===== LIMEWATER BUBBLE ANIMATION ===== */
.limewater-bubble {
position: absolute;
background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(200,200,200,0.7));
border: 1px solid rgba(255,255,255,0.8);
border-radius: 50%;
opacity: 0;
pointer-events: none;
z-index: 450;
animation: limewaterBubbleRise 2s ease-out forwards;
}
@keyframes limewaterBubbleRise {
0% {
opacity: 1;
transform: translateY(0) scale(1);
}
50% {
opacity: 0.8;
transform: translateY(-40px) scale(1.3);
}
100% {
opacity: 0;
transform: translateY(-80px) scale(0.5);
}
}

/* ===== SMOOTH OBSERVATION TRANSITION ===== */
#currentObservation {
    transition: opacity 0.3s ease;
    min-height: 50px;
}

.observation-item {
    animation: fadeInObservation 0.4s ease-out;
}

/* ===== INTERACTIVE DRAGGABLE ===== */
.interactive-draggable {
    cursor: grab !important;
    transition: filter 0.3s ease;
}

.interactive-draggable:hover {
    filter: drop-shadow(0 0 15px rgba(102, 193, 142, 0.6)) !important;
}

.interactive-draggable:active {
    cursor: grabbing !important;
}

.logo {
    position: absolute; /* Position logo absolutely */
    left: 0; /* Place it on the left */
    width: 90px;
    height: 90px;
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== HINT PULSE - highlights next apparatus to interact with ===== */
.apparatus.hint-pulse {
    animation: hintPulse 1s ease-in-out infinite !important;
    filter: drop-shadow(0 0 18px rgba(102, 193, 142, 0.95)) drop-shadow(0 0 35px rgba(102, 193, 142, 0.6)) !important;
    z-index: 50;
}

@keyframes hintPulse {
    0%, 100% {
        filter: drop-shadow(0 0 12px rgba(102, 193, 142, 0.8)) drop-shadow(0 0 25px rgba(102, 193, 142, 0.4));
        transform: translateY(0) scale(1);
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(102, 193, 142, 1)) drop-shadow(0 0 50px rgba(102, 193, 142, 0.7));
        transform: translateY(-4px) scale(1.04);
    }
}

/* Hint label that appears above pulsing apparatus */
.hint-label {
    position: absolute;
    top: -38px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #66c18e, #45825d);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    box-shadow: 0 3px 12px rgba(102, 193, 142, 0.5);
    animation: hintLabelBounce 1s ease-in-out infinite;
}

.hint-label::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #45825d;
    border-bottom: none;
}

@keyframes hintLabelBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

/* ===== DRAG OVER HIGHLIGHT - when dragging near a valid target ===== */
.apparatus.drag-target-highlight {
    filter: drop-shadow(0 0 20px rgba(255, 200, 50, 0.9)) drop-shadow(0 0 40px rgba(255, 150, 0, 0.5)) !important;
    animation: dragTargetPulse 0.5s ease-in-out infinite !important;
}

@keyframes dragTargetPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ===== STEP PROGRESS - updated without next button ===== */
.step-progress {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #dee2e6;
    margin-bottom: 15px;
}

.step-progress h4 {
    color: #45825d;
    margin-bottom: 12px;
    font-size: 15px;
    border-bottom: 2px solid #66c18e;
    padding-bottom: 6px;
    text-align: center;
}

/* Remove any next-step-btn if it somehow persists */
.next-step-btn {
    display: none !important;
}

/* ===== DROPPER RE-DRAGGABLE STATE ===== */
.apparatus[data-type="dropper"]:not(.snapped) {
    cursor: grab !important;
}

.apparatus[data-type="dropper"]:not(.snapped):hover {
    filter: drop-shadow(0 0 15px rgba(102, 193, 142, 0.7));
    transform: translateY(-3px);
}

/* ===== FLAME TEST - sample collection zone indicator ===== */
.sample-zone {
    position: absolute;
    border: 3px dashed rgba(135, 206, 235, 0.7);
    background: rgba(135, 206, 235, 0.08);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    pointer-events: none;
    display: none;
    animation: sampleZonePulse 1.5s infinite;
}

.sample-zone.active {
    display: block;
}

@keyframes sampleZonePulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ===== INTERACTION FEEDBACK FLASH ===== */
.apparatus.interaction-flash {
    animation: interactionFlash 0.4s ease-out !important;
}

@keyframes interactionFlash {
    0% { filter: drop-shadow(0 0 0px transparent); }
    40% { filter: drop-shadow(0 0 30px rgba(255, 255, 100, 0.9)) brightness(1.4); }
    100% { filter: drop-shadow(0 0 8px rgba(102, 193, 142, 0.4)); }
}

/* ===== OBSERVATION SECTION FADE ===== */
#currentObservation {
    transition: opacity 0.25s ease;
    min-height: 50px;
}

/* ===== RESULTS PANEL SCROLLABLE ===== */
#resultsContent {
    max-height: 65vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #66c18e #f0f0f0;
}

#resultsContent::-webkit-scrollbar { width: 6px; }
#resultsContent::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
#resultsContent::-webkit-scrollbar-thumb { background: #66c18e; border-radius: 3px; }