:root {
    --primary: #2c3e50;
    --secondary: #567E4C;
    --gingiva: #D68D91;
    --tooth-root: #D9B28C;
    --light: #ecf0f1;
    --success: #90EE90;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: var(--primary);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

header {
    background-color: var(--primary);
    color: white;
    width: 100%;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

nav { margin: 20px 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

button {
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s, transform 0.1s;
}

button:active { transform: scale(0.98); }

.btn-nav { background-color: #bdc3c7; color: var(--primary); }
.btn-nav.active { background-color: var(--secondary); color: white; box-shadow: 0 0 0 3px rgba(86, 126, 76, 0.3); }

.btn-help { background-color: var(--primary); color: white; }
.btn-help:hover { background-color: #1a252f; }

.main-container {
    width: 95%;
    max-width: 1100px;
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Simulator Styling */
.sim-view {
    position: relative;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    touch-action: none;
    user-select: none; /* Prevents text highlighting when dragging SVG */
}

#correct-badge {
    background-color: var(--success);
    color: black;
    padding: 10px 40px;
    font-size: 28px;
    font-weight: bold;
    border: 3px solid var(--secondary);
    border-radius: 4px;
    margin-top: -50px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

#move-zone { cursor: move; }
#rotate-zone { cursor: pointer; }

/* Focus styles for keyboard accessibility */
#move-zone:focus, #rotate-zone:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Control Panel */
.controls { display: flex; flex-direction: column; gap: 20px; }

.control-group {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

label { display: block; font-weight: bold; margin-bottom: 10px; font-size: 0.9rem; }
input[type="range"] { width: 100%; cursor: pointer; accent-color: var(--secondary); }

.feedback-box {
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    border-left: 5px solid #ccc;
    background: #f8f9fa;
}

.action-btn {
    background-color: var(--secondary);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.hidden { display: none !important; }

#test-id-stamp {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    color: #999;
}

/* --- Slider Menu Styles --- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.slide-menu.open {
    right: 0;
}

.slide-menu-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.slide-menu-header h2 { margin: 0; font-size: 1.3rem; }

.close-btn {
    background: none;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}
.close-btn:hover { background: rgba(255,255,255,0.2); }

.slide-menu-content {
    padding: 25px 20px;
    line-height: 1.6;
}
.slide-menu-content h3 {
    color: var(--secondary);
    border-bottom: 2px solid var(--light);
    padding-bottom: 5px;
    margin-top: 0;
}
.slide-menu-content ul { padding-left: 20px; margin-bottom: 25px; }
.slide-menu-content li { margin-bottom: 12px; }

kbd {
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 6px;
    font-family: monospace;
    font-size: 0.9em;
    color: #333;
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

/* --- Lightbox Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-box {
    background: var(--white);
    width: 90%;
    max-width: 550px;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-box {
    transform: translateY(0);
}
.modal-box h2 {
    margin-top: 0;
    color: var(--secondary);
    font-size: 1.6rem;
}
.modal-box p {
    line-height: 1.6;
    color: var(--primary);
}
.modal-box ul {
    padding-left: 20px;
    line-height: 1.6;
}
.modal-box li {
    margin-bottom: 10px;
}

@media (max-width: 850px) { .main-container { grid-template-columns: 1fr; } }