:root {
    --bg-dark: #020617;
    --panel-glass: rgba(15, 23, 42, 0.7);
    --border-glass: rgba(148, 163, 184, 0.15);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #10b981;
    --accent: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body.prism-theme {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #000;
    color: var(--text-main);
    overflow: hidden;
    touch-action: none;
}

#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-dark);
    transform-origin: 0 0;
}

/* Standarized Navigation */
nav {
    position: relative !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    flex-shrink: 0;
    top: 0 !important;
    z-index: 1000;
}

#sim-app {
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.sim-container {
    height: 100%;
    display: flex;
    flex-direction: row;
    width: 100%;
}

.canvas-panel {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at 15% 50%, #1e1b4b 0%, #020617 100%);
    overflow: hidden;
    cursor: default;
}

canvas#simCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Control Panel */
.control-panel {
    width: 320px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-glass);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
    height: 100%;
    overflow-y: auto;
}

.phet-box {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.phet-box:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.section-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 12px;
}

.control-group label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.highlight-val {
    color: var(--primary);
    font-weight: 800;
    background: var(--primary-glow);
    padding: 2px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

#wave-val {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Radio Cards */
.radio-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    display: none;
}

.radio-label {
    display: block;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.radio-card input:checked + .radio-label {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Checkboxes */
.checkbox-group-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.check-modern input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.check-modern input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.check-modern input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Buttons */
.btn-reset {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Range Inputs */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: all 0.2s;
}

.wavelength-gradient {
    height: 12px;
    border-radius: 6px;
    margin-top: 15px;
    background: linear-gradient(to right, #8f00ff, #4b0082, #0000ff, #00ff00, #ffff00, #ff7f00, #ff0000);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Help Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #fff;
    color: #0f172a;
    width: 500px;
    padding: 0;
    border-radius: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-content header {
    padding: 25px 40px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content header h2 {
    margin: 0;
    font-weight: 800;
    font-size: 1.5rem;
}

.modal-body {
    padding: 30px 40px;
}

.guide-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.guide-item i {
    font-size: 1.25rem;
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.modal-content footer {
    padding: 20px 40px;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Toast Notification */
.toast {
    position: absolute;
    top: 30px;
    left: 40%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    color: #fff;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
