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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.angular-momentum-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.simulation-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.main-panel {
    background: #f9fafb;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.canvas-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#mainCanvas {
    display: block;
    width: 100%;
    height: 400px;
}

.scenario-selector {
    margin-bottom: 20px;
}

.scenario-selector h3 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 10px;
    font-weight: 600;
}

.scenario-btn {
    background: #e5e7eb;
    border: none;
    padding: 10px 15px;
    margin-right: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.scenario-btn:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.scenario-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.realtime-values {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.value-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 8px;
}

.value-item span:first-child {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 5px;
    text-align: center;
}

.value-item span:last-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

.charts-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-container {
    background: #f9fafb;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 10px;
    font-weight: 600;
}

.chart-container canvas {
    display: block;
    width: 100%;
    height: 120px;
    background: white;
    border-radius: 8px;
}

.controls-panel {
    background: #f9fafb;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.controls-panel h3 {
    font-size: 1.3rem;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 700;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 10px;
    font-weight: 500;
}

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

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.checkbox-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.control-button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.control-button.start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.control-button.pause {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.control-button.reset {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.control-button.action {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.formulas-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.formulas-section h3 {
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 700;
}

.formula-list {
    display: grid;
    gap: 12px;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.formula-label {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
    min-width: 150px;
}

.formula {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 600;
    background: white;
    padding: 8px 15px;
    border-radius: 6px;
}

.explanation {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 700;
}

.explanation h3 {
    font-size: 1.3rem;
    color: #1f2937;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

.explanation p {
    font-size: 1rem;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 15px;
}

@media (max-width: 1024px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }

    .controls-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 20px;
    }

    .realtime-values {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .control-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }
}
