/* --- Global Styles & THEME Variables --- */
:root {
    /* Light Mode (Default variables) */
    --background-color: #f4f8fa;
    --text-color: #333333;
    --heading-color: #2f6485;
    --card-background: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --primary-color: #3a7ca5;
    --primary-color-dark: #2f6485;
    --accent-color: #ffc43d;
    --hero-bg: #e0eafc;
    --robot-head-fill: #ffffff;
    --robot-head-stroke: var(--primary-color);
    --robot-antenna-stroke: #333;
    --robot-treads-fill: #555;
    --font-family: 'Space Grotesk', sans-serif;
}

body.dark-mode {
    /* Dark Mode variables */
    --background-color: #1a202c;
    --text-color: #edf2f7;
    --heading-color: #a0aec0;
    --card-background: #2d3748;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --hero-bg: #2d3748;
    --robot-head-fill: #4a5568;
    --robot-head-stroke: #a0aec0;
    --robot-antenna-stroke: #a0aec0;
    --robot-treads-fill: #718096;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Theme Toggle Switch --- */
.theme-switch-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}
/* Moon/Sun icons */
.slider:after{
    content: '☀️';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 9px;
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.4s;
}
input:checked + .slider:after {
    opacity: 0;
}
.slider:before {
    content: '🌙';
    text-align: center;
    line-height: 26px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.4s;
}
input:checked + .slider:before {
    opacity: 1;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* --- Animation & General Layout --- */
.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.show {
    opacity: 1;
    transform: translateY(0);
}

.content-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    color: var(--heading-color);
    margin-bottom: 20px;
}

/* --- Hero Section & Animated Background --- */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    background-color: var(--hero-bg);
    min-height: 80vh;
    transition: background-color 0.3s;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content, .hero-robot {
    z-index: 2;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
}
.blob1 {
    width: 400px; height: 400px;
    background: rgba(58, 124, 165, 0.3);
    top: -100px; left: -150px;
    animation: move 25s infinite alternate;
}
.blob2 {
    width: 300px; height: 300px;
    background: rgba(255, 196, 61, 0.3);
    bottom: -50px; right: -100px;
    animation: move 30s infinite alternate-reverse;
}
.blob3 {
    width: 250px; height: 250px;
    background: rgba(173, 216, 230, 0.4);
    bottom: 100px; left: 100px;
    animation: move 20s infinite alternate;
}

/* --- Glassmorphism Button Style --- */
.cta-button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}
.cta-button:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

/* --- Robot Styles --- */
.robot-head {
    fill: var(--robot-head-fill);
    stroke: var(--robot-head-stroke);
}
.robot-antenna { stroke: var(--robot-antenna-stroke); }
.robot-treads { fill: var(--robot-treads-fill); }

.hero-robot { margin-left: 50px; }
.robot-body { animation: float 3s ease-in-out infinite; }
.antenna-light { animation: blink 2s linear infinite; }
.robot-arm-right {
    transform-origin: 175px 125px;
    animation: wave 2.5s ease-in-out infinite 1s;
}

/* --- Content Sections --- */
.chapter-card, .prereq-item {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.chapter-card {
    border-left: 4px solid var(--primary-color);
    text-align: left;
}
.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--card-shadow);
}
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.prerequisites-list {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-top: 40px;
    text-align: center;
}
.prereq-item { padding: 30px; }
.prereq-item h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* --- Video Section --- */
.video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: 12px;
    margin-top: 40px;
    box-shadow: 0 8px 25px var(--card-shadow);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Footer --- */
.final-section {
    background-color: #2c3e50;
    color: #edf2f7;
    text-align: center;
    padding: 60px 20px;
}
.final-section .cta-button {
    background: var(--accent-color);
    color: #333;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.final-section .cta-button:hover { background: #ffb700; }
.footer-links {
    margin-top: 40px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- Animations & Responsive --- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes blink { 0%, 48%, 52%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-25deg); } }
@keyframes move { from { transform: translate(0, 0) rotate(0deg) scale(1); } to { transform: translate(100px, 50px) rotate(180deg) scale(1.2); } }

@media (max-width: 768px) {
    .hero { flex-direction: column; text-align: center; }
    .hero-content, .hero-robot { text-align: center; margin-left: 0; }
    .hero-robot { margin-top: 40px; }
    .hero h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .prerequisites-list { flex-direction: column; }
}
