body { margin: 0; font-family: Arial, sans-serif; background: #eef2f6; color: #333; overflow-x: hidden; }
header { position: relative; text-align: center; padding: 15px; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.logo { position: absolute; left: 20px; top: 10px; height: 40px; }

/* Start Overlay Styles */
#start-overlay { position: fixed; inset: 0; background: rgba(238, 242, 246, 0.95); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.start-box { background: white; padding: 40px; border-radius: 12px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.15); max-width: 450px; }
.start-box h2 { color: #1a4fd8; margin-top: 0; }
#start-sim-btn { background: #1a4fd8; color: white; padding: 15px 30px; font-size: 16px; margin-top: 20px; }

.steps-box { width: 90%; max-width: 1200px; margin: 15px auto; background: white; padding: 15px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.05); }
.steps-box h2 { margin-top: 0; font-size: 18px; text-align: center; }
.step-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.step-item { background: #f0f4f8; padding: 8px 12px; border-radius: 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: bold; }
.step-number { background: #1a4fd8; color: white; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 11px; }

.simulator-layout { display: flex; flex-wrap: wrap; justify-content: center; gap: 25px; padding: 10px 20px 40px; max-width: 1300px; margin: 0 auto; }

/* Left Panel */
.dashboard { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 15px; }
.control-panel { background: white; padding: 15px; border-radius: 10px; box-shadow: 0 3px 12px rgba(0,0,0,0.08); }
.control-panel h2 { margin-top: 0; font-size: 16px; border-bottom: 2px solid #eef2f6; padding-bottom: 5px; }
.control-panel p { font-size: 13px; margin: 10px 0 5px; font-weight: bold; color: #555; }
.instruction { font-weight: normal !important; color: #777 !important; font-style: italic; margin-top: -5px !important; }

.slide-drawer { max-height: 200px; overflow-y: auto; padding-right: 5px; }
.slide-item { background: #dfe5f5; padding: 10px; margin: 8px 0; border-radius: 6px; border: 1px solid #c5d0eb; cursor: pointer; font-size: 13px; font-weight: bold; user-select: none; transition: 0.2s; }
.slide-item:active { transform: scale(0.98); }
.slide-item:hover { background: #c5d0eb; }

input[type=range] { width: 100%; margin-bottom: 5px; }
input[type=range]:disabled { opacity: 0.4; cursor: not-allowed; }
button { width: 100%; padding: 10px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

#powerBtn { margin-bottom: 10px; font-size: 14px; }
.power-off { background: #e0e0e0; color: #555; }
.power-on { background: #ffeaa7; color: #b28900; box-shadow: inset 0 0 10px rgba(255,200,0,0.3); }

.lens-group { display: flex; gap: 5px; }
.lens-btn { flex: 1; background: #ddd; color: #555; padding: 8px 0; }
.lens-btn.active { background: #1a4fd8; color: white; }
#reset-stage { background: #444; color: white; margin-top: 10px; }
#reset-stage:hover:not(:disabled) { background: #222; }

/* Reset Button Styles */
.danger-btn { background: #ff4757; color: white; margin-top: 10px; }
.danger-btn:hover { background: #ff6b81; }

/* Right Panel */
.microscope-panel { flex: 1; min-width: 300px; max-width: 650px; display: flex; flex-direction: column; align-items: center; }
.status-bar { width: 100%; background: white; padding: 12px 15px; border-radius: 10px; box-shadow: 0 3px 12px rgba(0,0,0,0.08); display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 14px; box-sizing: border-box; }
.status-bar strong { color: #1a4fd8; }

.microscope-wrapper { background: #2c3e50; border-radius: 15px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); display: flex; flex-direction: column; align-items: center; width: 100%; box-sizing: border-box; }
.eyepiece { width: 100%; aspect-ratio: 1 / 1; max-width: 500px; background: black; border-radius: 50%; border: 10px solid #1a1a1a; overflow: hidden; position: relative; box-shadow: inset 0 0 40px rgba(0,0,0,0.9); }

#slide-wrapper {will-change: transform; position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) scale(1); transform-origin: center center; transition: transform 0.2s ease; }
#slide-view { filter: brightness(100%) contrast(100%) blur(0px); width: 100%; height: 100%; object-fit: cover; }

#pin-layer { position: absolute; inset: 0; pointer-events: none; }
.tissue-pin { position: absolute; width: 16px; height: 16px; background: #ff4757; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px white, 0 0 10px rgba(255, 71, 87, 0.8); pointer-events: auto; cursor: help; z-index: 20; }
.tissue-pin::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #ff4757; animation: pulse 1.5s infinite ease-out; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }

#light-overlay { position: absolute; inset: 0; background: rgba(0,0,0,1); pointer-events: none; transition: background 0.3s ease; z-index: 50; }
.crosshair { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0.3) 1px, transparent 1px) center / 100% 100%, linear-gradient(90deg, rgba(0,0,0,0.3) 1px, transparent 1px) center / 100% 100%; background-size: 100% 2px, 2px 100%; background-repeat: no-repeat; pointer-events: none; z-index: 40; }

.stage-base { margin-top: 20px; width: 90%; height: 35px; background: #444; border-radius: 5px; color: #aaa; text-align: center; line-height: 35px; font-size: 13px; font-weight: bold; letter-spacing: 1px; border: 2px dashed #666; transition: 0.3s; }
.stage-base.drag-over { background: #1a4fd8; color: white; border-color: white; box-shadow: 0 0 15px rgba(26, 79, 216, 0.5); }

.popup { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); justify-content: center; align-items: center; z-index: 100; }
.popup-box { background: white; padding: 30px; border-radius: 10px; text-align: center; }
#popupOk { background: #1a4fd8; color: white; width: 100px; margin-top: 15px; }

/* RESPONSIVENESS FIXES */
@media (max-width: 800px) {
  .simulator-layout { flex-direction: column-reverse; align-items: center; padding: 10px; }
  .dashboard, .microscope-panel { width: 100%; max-width: 500px; }
  .logo { position: static; display: block; margin: 0 auto 10px; }
  header { padding: 10px; }
  .status-bar { flex-direction: column; gap: 5px; text-align: center; }
}