* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8dcc4 0%, #d4c4a8 100%);
    color: #3a3a3a;
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

body.classroom-mode {
    background: linear-gradient(135deg, #8b7355 0%, #6b5d4f 100%);
}

body.classroom-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

h1 {
    font-size: 2.5em;
    color: #6b4423;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.2em;
    color: #8b6f47;
    font-style: italic;
}

.info-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: help;
}

.tooltip-icon {
    font-size: 24px;
}

.tooltip-text {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: #3a3a3a;
    color: white;
    padding: 15px;
    border-radius: 8px;
    width: 300px;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 100;
}

.info-toggle:hover .tooltip-text {
    display: block;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.panel h2 {
    color: #6b4423;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.canvas-container {
    position: relative;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.light-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffeb3b 0%, #ff9800 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.8);
    pointer-events: none;
}

.projection-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid rgba(139, 111, 71, 0.3);
    pointer-events: none;
    border-radius: 8px;
}

.stage-controls, .control-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b6f47 0%, #6b4423 100%);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.btn.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.btn.small {
    padding: 8px 15px;
    font-size: 12px;
}

.btn.preset {
    flex: 1;
    min-width: 120px;
}

.btn.primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    font-size: 16px;
    padding: 12px 24px;
}

.control-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.2);
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h3 {
    color: #6b4423;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.control-group label span:first-child {
    min-width: 130px;
    font-weight: bold;
    color: #6b4423;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #8b6f47 0%, #ffeb3b 100%);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6b4423;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6b4423;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: none;
}

.value {
    min-width: 70px;
    text-align: right;
    font-weight: bold;
    color: #8b6f47;
}

select {
    flex: 1;
    padding: 8px;
    border: 2px solid #8b6f47;
    border-radius: 6px;
    background: white;
    color: #3a3a3a;
    font-size: 14px;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.projection-info {
    text-align: center;
    padding: 10px;
    background: rgba(139, 111, 71, 0.1);
    border-radius: 6px;
    font-style: italic;
    color: #6b4423;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.educational-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.collapse-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8b6f47 0%, #6b4423 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.collapse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.educational-content {
    margin-top: 15px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.educational-content.collapsed {
    max-height: 0;
}

.fact-box {
    background: rgba(139, 111, 71, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #8b6f47;
}

.fact-box h4 {
    color: #6b4423;
    margin-bottom: 8px;
}

.fact-box p {
    line-height: 1.6;
    color: #3a3a3a;
}

.fun-fact {
    background: linear-gradient(135deg, #fffbf0 0%, #fff4e0 100%);
    padding: 15px;
    border-radius: 8px;
    font-style: italic;
    color: #6b4423;
    border: 2px dashed #8b6f47;
}

footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

footer a {
    color: #6b4423;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}

.tip {
    margin-top: 10px;
    font-style: italic;
    color: #8b6f47;
    font-size: 14px;
}

.flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
    z-index: 9999;
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .control-group label {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-group label span:first-child {
        min-width: auto;
    }
    
    input[type="range"] {
        width: 100%;
    }
}