/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    overflow: hidden;
}

/* Main container - responsive design for iframe and full screen */
.container {
    width: 100%;
    height: 450px; /* Default iframe height */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Full screen mode detection */
@media (min-height: 500px) {
    .container {
        height: 90vh;
    }
}

/* Control panel styling */
.control-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #ddd;
    min-height: 60px;
}

.controls {
    display: flex;
    gap: 10px;
}

/* Interactive button styling with touch-friendly sizes */
.control-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 70px;
    min-height: 36px; /* Touch-friendly size */
}

.control-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.control-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* Object selector styling */
.object-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.object-selector label {
    font-weight: 500;
    color: #333;
}

.object-selector select {
    padding: 6px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    min-height: 36px;
}

.object-selector select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Simulation area container */
.simulation-area {
    flex: 1;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

/* Canvas styling for the physics simulation */
#simulationCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    background: linear-gradient(to bottom, #87CEEB 0%, #f0f0f0 100%);
}

#simulationCanvas:active {
    cursor: grabbing;
}

/* Information panel for educational content */
.info-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 250px;
    font-size: 12px;
}

.info-item {
    margin-bottom: 5px;
    line-height: 1.4;
}

.info-item:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    .control-panel {
        flex-direction: column;
        gap: 10px;
        padding: 8px 15px;
    }
    
    .controls {
        justify-content: center;
    }
    
    .control-btn {
        min-width: 60px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .info-panel {
        font-size: 11px;
        max-width: 200px;
    }
}

/* Animation classes for smooth transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}