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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Navigation Bar */
.navigation {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(15px, 3vw, 25px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-icon {
    font-size: 1.2em;
}

.nav-text {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: white;
}

.nav-title {
    flex: 1;
    text-align: center;
}

.nav-title h1 {
    color: white;
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Suggested Simulations Section */
.suggested-section {
    background: white;
    padding: clamp(20px, 4vw, 40px);
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

.suggested-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.simulation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(15px, 3vw, 25px);
}

.simulation-card {
    display: block;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.simulation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    background: white;
}

.card-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
}

.simulation-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}

.simulation-card p {
    color: #666;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.5;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(10px, 3vw, 20px);
    width: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* Theory Section Styles */
.theory-section {
    margin-bottom: 30px;
    background: white;
    padding: clamp(15px, 3vw, 25px);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theory-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.theory-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: clamp(15px, 3vw, 25px);
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.theory-card:last-child {
    margin-bottom: 0;
}

.theory-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
}

.theory-content {
    color: #34495e;
    line-height: 1.6;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.theory-content p {
    margin-bottom: 15px;
}

.theory-content ul {
    list-style-type: none;
    padding-left: 20px;
    margin-bottom: 15px;
}

.theory-content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}

.theory-content ul li:before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.equation {
    background: #fff;
    padding: clamp(10px, 2vw, 15px);
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-family: 'KaTeX_Math', serif;
    border: 2px solid #3498db;
    color: #2c3e50;
    font-weight: 500;
}

/* Simulation Container */
.simulation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.shm-container {
    background: white;
    border-radius: 10px;
    padding: clamp(15px, 3vw, 25px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.shm-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

#springCanvas,
#pendulumCanvas {
    width: 100%;
    height: 300px;
    background: #f8f9fa;
    border: 2px solid #3498db;
    border-radius: 8px;
    display: block;
    margin-bottom: 15px;
}

.shm-container div {
    text-align: center;
    color: #34495e;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Controls */
.controls {
    background: white;
    border-radius: 10px;
    padding: clamp(15px, 3vw, 25px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: bold;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    margin-bottom: 8px;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.control-group .value {
    text-align: right;
    color: #34495e;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    font-weight: 500;
}

.control-group select {
    width: 100%;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #2c3e50;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Buttons */
button {
    background: #3498db;
    color: white;
    border: none;
    padding: clamp(10px, 2vw, 12px) clamp(20px, 3vw, 24px);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px;
    transition: all 0.3s ease;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button.active {
    background: #e74c3c;
}

button.active:hover {
    background: #c0392b;
}

/* Status Display */
.status-display {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #3498db;
}

.status-display h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    color: #34495e;
}

/* Comparison Table */
.comparison-table {
    margin-top: 20px;
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

.comparison-table th {
    background: rgba(52, 152, 219, 0.2);
    color: #2c3e50;
    font-weight: bold;
}

.comparison-table td {
    background: #f8f9fa;
}

/* Graphs Container */
.graphs-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.graph-box {
    background: white;
    border-radius: 10px;
    padding: clamp(15px, 3vw, 25px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.graph-box h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
}

.graph-box canvas {
    max-height: 300px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .simulation-container {
        grid-template-columns: 1fr;
    }
    
    .graphs-container {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 0.8rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px;
    }
    
    .control-group input[type="range"] {
        height: 8px;
    }
    
    .control-group input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .control-group input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}
