/* Pythagoras Animation - Styles */
* { box-sizing: border-box; }
:root {
    --primary: #8b5cf6;
    --accent: #06b6d4;  /* Cyan for square B */
    --accent-red: #ef4444; /* Red for square A */
    --accent-green: #10b981; /* Green for square C */
    --bg: #0f172a;
    --grid: rgba(255, 255, 255, 0.05);
}

body.math-lab-theme { 
    margin: 0; padding: 0; background: var(--bg); color: white; 
    width: 100%; height: 100%; overflow: hidden; display: flex; flex-direction: column; 
    font-family: 'Outfit', sans-serif; touch-action: none;
}

#phet-stage {
    position: absolute;
    top: 0; left: 0;
    width: 1280px; height: 720px;
    background: var(--bg);
    display: flex; flex-direction: column;
    overflow: hidden;
    transform-origin: 0 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
    touch-action: none;
}

#sim-app {
    flex: 1; display: flex; 
    width: 100%; height: 100%; overflow: hidden;
    position: relative;
    background: #0f172a;
}

/* Floating Mode Switcher Bar - Fixed to bottom of window so it's never cut off */
.mode-switcher-container {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    padding: 0; display: flex; justify-content: center; z-index: 1000;
}

.mode-switcher {
    display: flex; background: rgba(30, 41, 59, 0.75); border-radius: 12px; padding: 4px;
    border: 1px solid rgba(255,255,255,0.08); backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.mode-btn {
    background: transparent; border: none; color: #94a3b8; padding: 8px 16px;
    font-size: 0.85rem; font-family: 'Outfit'; font-weight: 700; cursor: pointer;
    border-radius: 8px; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex; align-items: center; gap: 8px;
}

.mode-btn i { font-size: 0.8rem; }

.mode-btn.active { 
    background: var(--primary); color: white; 
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.mode-btn:hover:not(.active) { color: white; background: rgba(255,255,255,0.05); }

.mode-layout {
    width: 100%; height: 100%; overflow: hidden;
    display: none; grid-template-columns: 1fr 380px; 
}

.mode-layout.active { display: grid; }

.canvas-panel { 
    position: relative; width: 100%; height: 100%; 
    background: radial-gradient(var(--grid) 1px, transparent 1px); 
    background-size: 40px 40px; 
    overflow: hidden;
}

/* Trig Overlay Specifics */
.trig-math-overlay {
    position: absolute; top: 30px; left: 30px; 
    pointer-events: none;
}

.formula-title {
    color: var(--primary); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 2px; font-weight: 800; margin-bottom: 10px; display: block;
}

.large-trig-result {
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    padding: 15px 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-left: 4px solid var(--primary);
}

.large-trig-result .ratio-def { font-size: 0.8rem; margin-bottom: 5px; color: #94a3b8; }
.large-trig-result .ratio-val { font-size: 1.4rem; font-family: 'JetBrains Mono'; color: white; }

#mainCanvas { width: 100%; height: 100%; display: block; }

.controls-overlay {
    position: absolute; top: 30px; left: 30px; display: flex; gap: 15px; z-index: 10;
}

.action-btn {
    background: var(--primary); color: white; border: none; padding: 12px 24px;
    border-radius: 8px; font-weight: 700; font-family: 'Outfit'; font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.2s;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}
.action-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.action-btn.outline { background: transparent; border: 2px solid rgba(255,255,255,0.2); box-shadow: none; color: white; }
.action-btn.outline:hover { border-color: white; background: rgba(255,255,255,0.1); }

/* Equation HUD at the top-right of the canvas */
#equation-hud {
    position: absolute; top: 30px; right: 30px;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    padding: 12px 20px; font-size: 1.5rem; font-weight: 800; font-family: 'JetBrains Mono', monospace;
    display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 10;
}
#equation-hud small { font-size: 0.8rem; opacity: 0.6; margin-left: 2px; }

.eq-term { transition: 0.3s; padding: 0 10px; border-radius: 10px; }
.eq-term.active-a { color: var(--accent-red); background: rgba(239, 68, 68, 0.15); box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);}
.eq-term.active-b { color: var(--accent); background: rgba(6, 182, 212, 0.15); box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);}
.eq-term.active-c { color: var(--accent-green); background: rgba(16, 185, 129, 0.15); text-shadow: 0 0 20px rgba(16, 185, 129, 0.5); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);}

/* Sidebar Details */
.calc-sidebar {
    background: #1e293b; border-left: 1px solid rgba(255,255,255,0.05); padding: 30px;
    display: flex; flex-direction: column; gap: 20px; overflow-y: auto;
}

.controls-card {
    background: rgba(0,0,0,0.2); padding: 20px; border-radius: 12px;
    display: flex; flex-direction: column; gap: 15px; margin-top: 15px;
}
.control-row { display: flex; flex-direction: column; gap: 10px; }
.control-row label { font-size: 0.9rem; color: #94a3b8; font-weight: 600; display: flex; justify-content: space-between;}
.control-row label span { color: var(--primary); font-family: 'JetBrains Mono'; font-weight: 800; font-size: 1.1rem;}

input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: #334155; border-radius: 3px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; border: 3px solid #1e293b;
}

.theorem-card h2 { font-size: 1.8rem; margin: 0 0 10px; background: linear-gradient(135deg, #a855f7, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;}
.subtitle { color: #94a3b8; line-height: 1.5; font-size: 0.95rem; }

.formula-box {
    margin-top: 20px; background: #0f172a; padding: 15px; border-radius: 12px;
    text-align: center; border: 1px solid rgba(255,255,255,0.1);
}
.math-font { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700; color: white; letter-spacing: 2px;}

.step-guide { display: flex; flex-direction: column; gap: 15px; }

.step-item {
    display: flex; gap: 15px; padding: 15px; background: rgba(0,0,0,0.2);
    border-radius: 12px; border: 1px solid transparent; transition: 0.3s;
    opacity: 0.4;
}
.step-item.active {
    opacity: 1; border-color: var(--primary); background: rgba(139, 92, 246, 0.1);
}

.step-num {
    width: 30px; height: 30px; border-radius: 50%; background: #334155;
    flex-shrink: 0; display: flex; justify-content: center; align-items: center; 
    font-weight: 800; font-size: 0.9rem;
}
.step-item.active .step-num { background: var(--primary); color: white; }

.step-text h4 { margin: 0 0 5px; font-size: 1rem; color: #f8fafc; }
.step-text p { margin: 0; font-size: 0.85rem; color: #94a3b8; line-height: 1.4; }

.insight-box {
    margin-top: 20px; padding: 20px; background: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.3); border-radius: 12px;
    display: flex; gap: 15px; align-items: center; color: #fbbf24;
}
.insight-box i { font-size: 1.5rem; }
.insight-box p { margin: 0; font-size: 0.9rem; color: #fcd34d; line-height: 1.4; }
.insight-box strong { color: white; }

/* Trigonometry Section Styles */
.trig-card { border: 1px solid rgba(139, 92, 246, 0.2); }

.trig-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px;
}

.trig-btn {
    background: #0f172a; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    color: #94a3b8; padding: 10px; font-weight: 700; font-family: 'JetBrains Mono';
    font-size: 0.9rem; cursor: pointer; transition: 0.2s;
}

.trig-btn:hover { background: #334155; color: white; border-color: var(--primary); }

.trig-btn.active {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.trig-result {
    margin-top: 15px; min-height: 80px; display: flex; flex-direction: column; 
    justify-content: center; gap: 5px; background: #0f172a !important;
}

.ratio-def { 
    font-size: 0.85rem; color: #94a3b8; font-family: 'Outfit';
    text-transform: uppercase; letter-spacing: 1px;
}

.ratio-val { 
    font-size: 1.35rem; font-family: 'JetBrains Mono'; color: white;
}

.ratio-val span { color: var(--primary); font-weight: 800; }
.ratio-val small { color: #475569; margin-left: 5px; }

/* Side Highlighting Neon Effects */
.high-a { color: var(--accent-red) !important; text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.high-b { color: var(--accent) !important; text-shadow: 0 0 10px rgba(6, 182, 212, 0.5); }
.high-c { color: var(--accent-green) !important; text-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
