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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #1a2a6c, #2a4d69, #4b86b4);
    background-attachment: fixed;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    padding: 1rem 0;
    background: rgba(255,255,255,0.1);
    margin: 0;
}

nav li {
    margin: 0 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: normal;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover, nav a:focus {
    background: rgba(255,255,255,0.2);
}

nav a[style*="font-weight: bold"] {
    background: rgba(255,255,255,0.2);
    font-weight: bold !important;
}

/* Main Content */
main {
    padding: 2rem 0;
}

section {
    background: rgba(255, 255, 255, 0.92);
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #2a4d69;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #4b86b4;
    padding-bottom: 0.5rem;
}

h3 {
    color: #1a2a6c;
    margin: 1rem 0 0.5rem 0;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    margin-top: 0;
    color: #2a4d69;
}

/* Simulation Stages */
.simulation-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stage-card {
    background: #e3f2fd;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #2a4d69;
}

.stage-card h3 {
    margin-top: 0;
    color: #1a2a6c;
}

/* Stage Selection */
.stage-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.stage-button {
    padding: 0.8rem 1.5rem;
    background: #2a4d69;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.stage-button:hover {
    background: #1a2a6c;
    transform: translateY(-2px);
}

.stage-button.active {
    background: #4b86b4;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px 5px 0 0;
    margin-right: 0.25rem;
}

.tab-button:hover {
    background: #e2e2e2;
}

.tab-button.active {
    background: #2a4d69;
    color: white;
    border-color: #2a4d69;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stage Forms */
.stage-form {
    display: none;
}

.stage-form.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2a4d69;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.run-simulation-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    margin: 1.5rem auto;
    transition: all 0.3s ease;
}

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

/* Results Section */
#output {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    min-height: 200px;
}

.result-item {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: white;
    border-left: 4px solid #4b86b4;
    border-radius: 4px;
}

.result-item h3 {
    color: #2a4d69;
    margin-bottom: 0.3rem;
}

/* Visualization */
#visualization {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
}

#thrust-chart, #altitude-chart {
    width: 100%;
    height: 300px;
    background: white;
    border-radius: 4px;
    margin: 1rem auto;
    display: block;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

footer a {
    color: #4b86b4;
    text-decoration: none;
}

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

/* Lists */
ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .container {
        width: 95%;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        margin: 0;
    }
    
    .form-group {
        margin: 0 0 1.5rem 0;
        min-width: 100%;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 5px;
        margin-bottom: 0.25rem;
        text-align: center;
    }
    
    #thrust-chart, #altitude-chart {
        height: 250px;
    }
    
    nav ul {
        flex-wrap: wrap;
    }
    
    nav li {
        margin: 0.25rem 0.5rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.5s ease-out;
}

/* Scientific Explanation Styles */
.scientific-explanations {
    margin-top: 20px;
}

.explanation-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.explanation-section h3 {
    color: #2a4d69;
    margin-top: 0;
}

.explanation-content {
    line-height: 1.6;
}

.explanation-controls {
    background: #e9ecef;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.explanation-controls h3 {
    color: #2a4d69;
    margin-top: 0;
    margin-bottom: 10px;
}

.explanation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.explanation-mode-button, .export-report-button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.explanation-mode-button {
    background-color: #6c757d;
    color: white;
}

.explanation-mode-button:hover {
    background-color: #5a6268;
}

.explanation-mode-button.active {
    background-color: #2a4d69;
    color: white;
}

.export-report-button {
    background-color: #2a4d69;
    color: white;
}

.export-report-button:hover {
    background-color: #1f3a58;
}

/* Responsive styles */
@media (max-width: 768px) {
    .explanation-buttons, .export-buttons {
        flex-direction: column;
    }
    
    .explanation-mode-button, .export-report-button {
        width: 100%;
    }
}
