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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.info-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.info-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.main-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

.controls-left, .controls-right {
    flex: 1;
    min-width: 250px;
}

.canvas-container {
    position: relative;
    flex: 2;
    display: flex;
    justify-content: center;
}

#canvas {
    border: 4px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    cursor: none;
    background: #000;
}

.crosshair {
    position: fixed;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: #ff4444;
    box-shadow: 0 0 4px rgba(255,68,68,0.8);
}

.crosshair::before {
    width: 20px;
    height: 2px;
    top: 9px;
    left: 0;
}

.crosshair::after {
    width: 2px;
    height: 20px;
    top: 0;
    left: 9px;
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.panel h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.findings-log {
    background: #f8f9ff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.finding {
    margin-bottom: 0.5rem;
    padding: 0.25rem;
    border-left: 3px solid #3498db;
    padding-left: 0.75rem;
    background: white;
    border-radius: 0 4px 4px 0;
}

.reference {
    font-size: 0.9rem;
}

.ref-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f8f9ff;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.ref-item strong {
    color: #2c3e50;
}

label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #2c3e50;
}

input[type="range"] {
    width: 100%;
    margin-top: 0.5rem;
    accent-color: #3498db;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.zoom-controls, .speculum-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.zoom-btn, .spec-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.zoom-btn:hover, .spec-btn:hover {
    border-color: #3498db;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.zoom-btn.active, .spec-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.bottom-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 2rem 2rem;
    flex-wrap: wrap;
}

.bottom-controls button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.bottom-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bottom-controls button:active {
    transform: translateY(0);
}

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

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-top: -10px;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #555;
}

.footer {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    margin-top: 2rem;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    
    .controls-left, .controls-right {
        width: 100%;
        max-width: 500px;
    }
    
    #canvas {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    #canvas {
        width: 300px;
        height: 300px;
    }
    
    .bottom-controls {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .bottom-controls button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .zoom-controls, .speculum-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .bottom-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .bottom-controls button {
        width: 100%;
        max-width: 200px;
    }
}