/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    height: 100%;
}

/* Game of Life Canvas Background */
#gameOfLifeCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Layout Container */
.container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar Menu (1/4 of viewport) */
.sidebar {
    width: 25%;
    background:
        radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(155, 89, 182, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(41, 128, 185, 0.1) 0%, transparent 60%),
        linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 2rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.menu h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.menu ul {
    list-style: none;
}

.menu li {
    margin-bottom: 1rem;
}

.menu a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.menu a:hover {
    color: #3498db;
}

/* Main Content (3/4 of viewport) */
.content {
    margin-left: 25%;
    width: 75%;
    padding: 3rem;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.95);
}

section {
    margin-bottom: 2rem;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

section p {
    font-size: 1.1rem;
    color: #555;
}

section a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

section a:hover {
    color: #2980b9;
    text-decoration: underline;
}

section ul {
    margin-top: 1rem;
    margin-left: 1.5rem;
    list-style: none;
}

section li {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

section li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: 600;
}

section li strong {
    color: #2c3e50;
    font-weight: 600;
}

section li .description {
    display: block;
    font-size: 0.95rem;
    color: #777;
    margin-top: 0.25rem;
    line-height: 1.5;
}

/* Animation Controls */
.animation-controls {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1.25rem;
    z-index: 100;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.control-group label {
    font-size: 0.75rem;
    color: #555;
    font-weight: 500;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-label-min,
.slider-label-max {
    font-size: 0.875rem;
    color: #888;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
}

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

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

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
}

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

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
    }

    .menu h1 {
        margin-bottom: 1rem;
    }

    .menu ul {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .menu li {
        margin-bottom: 0;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 2rem 1.5rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .animation-controls {
        bottom: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }

    .control-group input[type="range"] {
        width: 80px;
    }
}