/* General reset and box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Define CSS custom properties for the visual theme */
:root {
    --color-background: #FAFAFA;
    --color-foreground: #F5F5F5;
    --color-accent: #007BFF;
    --color-text: #212529;
    --color-border: #E0E0E0;
    --font-family: 'Arial', sans-serif;
    --spacing-unit: 8px;
}

/* General body styles */
body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    margin: var(--spacing-unit);
}

/* Header styles */
header {
    background-color: var(--color-foreground);
    padding: var(--spacing-unit);
    text-align: center;
    border-bottom: 2px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2rem;
    color: var(--color-text);
}

/* Main content container */
main {
    padding: calc(var(--spacing-unit) * 2);
    max-width: 1200px;
    margin: 0 auto;
}

/* Introduction section */
#introduction {
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-align: center;
}

#introduction h2 {
    color: var(--color-text);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-unit);
}

#introduction p {
    color: var(--color-text);
    font-size: 1rem;
}

/* Simulation container */
#simulation-container {
    margin-bottom: calc(var(--spacing-unit) * 2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#simulation-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-unit);
    margin-bottom: var(--spacing-unit);
}

#simulation-controls label {
    font-size: 1rem;
    color: var(--color-text);
}

#simulation-controls .control-description {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-top: calc(var(--spacing-unit) / 4);
}

#simulation-controls #speed-value,
#simulation-controls #rotation-value {
    font-weight: bold;
    color: var(--color-accent);
}

#simulation-controls input[type="range"] {
    width: 150px;
    cursor: pointer;
    transition: background 0.3s;
}

#simulation-controls input[type="range"]::-webkit-slider-thumb {
    background: var(--color-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    height: 20px;
    width: 20px;
    transition: background 0.3s;
}

#simulation-controls input[type="range"]:focus {
    outline: none;
}

#simulation-controls input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--color-text);
}

#simulation-controls button {
    padding: calc(var(--spacing-unit) / 2) calc(var(--spacing-unit));
    background-color: var(--color-accent);
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#simulation-controls button:not(:last-child) {
    margin-right: var(--spacing-unit);
}

#simulation-controls button:hover {
    background-color: var(--color-foreground);
    transform: scale(1.05);
}

#simulation {
    border: 2px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    width: 800px;
    height: 600px;
    background-color: var(--color-foreground);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#simulation-canvas {
    display: block;
    border: none;
}

/* Educational content section */
#educational-content {
    margin-top: calc(var(--spacing-unit) * 2);
}

#educational-content h2 {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-unit);
}

#educational-content #content-article {
    padding: var(--spacing-unit);
    background-color: var(--color-foreground);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    line-height: 1.5;
}

#educational-content #content-article p {
    margin-bottom: var(--spacing-unit);
}

/* Footer styles */
footer {
    text-align: center;
    padding: var(--spacing-unit);
    background-color: var(--color-foreground);
    border-top: 2px solid var(--color-border);
}

footer p {
    color: var(--color-text);
    font-size: 0.8rem;
}