/* Lesson Links */
.lesson-links {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.lesson-link {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: #1f2937;
    transition: all 0.2s ease;
    border-left: 4px solid #4f46e5;
}

.lesson-link:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background-color: #f9fafb;
}

.lesson-number {
    font-weight: 600;
    color: #4f46e5;
    margin-right: 1.5rem;
    min-width: 3rem;
    text-align: center;
    font-size: 0.95rem;
    background: #eef2ff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.lesson-title {
    flex-grow: 1;
    font-size: 1.05rem;
    font-weight: 500;
}

.lesson-link::after {
    content: '→';
    color: #4f46e5;
    font-weight: bold;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lesson-link:hover::after {
    opacity: 1;
}

/* Table of Contents */
.toc {
    padding: 5rem 0;
    background-color: #f9fafb;
}

.toc h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #1f2937;
    font-size: 2.25rem;
}

.toc-container {
    max-width: 900px;
    margin: 0 auto;
}

.toc-unit {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toc-unit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.toc-unit h3 {
    background: #f3f4f6;
    margin: 0;
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toc-unit h3 i {
    color: #4f46e5;
    font-size: 1.1em;
}

.toc-lessons {
    padding: 0.5rem 0;
}

.toc-lesson {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #374151;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.toc-lesson:hover {
    background-color: #f9fafb;
    border-left-color: #4f46e5;
}

.lesson-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.lesson-info {
    flex: 1;
}

.lesson-info h4 {
    margin: 0 0 0.25rem 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.lesson-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.toc-lesson i.fas {
    color: #9ca3af;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: 1rem;
}

.toc-lesson:hover i.fas {
    transform: translateX(3px);
    color: #4f46e5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toc {
        padding: 3rem 0;
    }
    
    .toc h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    .toc-unit h3 {
        font-size: 1.1rem;
        padding: 1rem;
    }
    
    .toc-lesson {
        padding: 0.75rem 1rem;
    }
    
    .lesson-info h4 {
        font-size: 1rem;
    }
    
    .lesson-info p {
        font-size: 0.85rem;
    }
}

/* Motherboard Connections */
.connections-container {
    padding: 1.5rem;
}

.connection-type {
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.connection-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.connection-header i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    color: #3b82f6;
}

.connection-header h5 {
    margin: 0;
    color: #1e40af;
    font-size: 1.1rem;
}

.connection-content {
    padding: 1.25rem 1.5rem;
}

.connection-content ul {
    margin: 0.75rem 0 0 1.25rem;
    padding: 0;
}

.connection-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Analogy Box */
.analogy-box {
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
    margin-top: 2rem;
    overflow: hidden;
}

.analogy-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #e0f2fe;
    border-bottom: 1px solid #bae6fd;
}

.analogy-header i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    color: #0369a1;
}

.analogy-header h5 {
    margin: 0;
    color: #075985;
    font-size: 1.1rem;
}

.analogy-content {
    padding: 1.25rem 1.5rem;
}

.analogy-item {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
}

.analogy-label {
    font-weight: 600;
    color: #075985;
    min-width: 120px;
}

.analogy-desc {
    flex: 1;
    color: #0c4a6e;
}

/* Bus Section Styles */
.definition-box h4 {
    margin-top: 0;
    color: #1e40af;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.definition-box h4 i {
    color: #3b82f6;
}

.importance-note {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 4px 4px 0;
}

.importance-note h5 {
    margin: 0 0 0.5rem 0;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.importance-note h5 i {
    color: #f59e0b;
}

.importance-note p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

.bus-characteristics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.characteristic {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.characteristic i {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.characteristic h4 {
    margin: 0.5rem 0;
    color: #1e40af;
}

.characteristic p {
    margin: 0.5rem 0 0;
    color: #4b5563;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .analogy-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .analogy-label {
        margin-bottom: 0.25rem;
    }
}

/* Reset and Base Styles */
:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --dark: #1f2937;
    --light: #f3f4f6;
    --gray: #6b7280;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--white);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark);
}

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

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.main-content {
    padding-top: 80px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Chapters Section */
.chapters-section {
    padding: 2rem 0 4rem;
}

.chapters-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #1f2937;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.chapter-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e5e7eb;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #4f46e5;
}

.chapter-icon {
    background: #4f46e5;
    color: white;
    padding: 1.5rem;
    text-align: center;
    font-size: 2rem;
}

.chapter-icon i {
    transition: transform 0.3s ease;
}

.chapter-card:hover .chapter-icon i {
    transform: scale(1.1);
}

.chapter-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chapter-number {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.chapter-content h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.chapter-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 0 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.logo:hover {
    background-color: rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.logo i {
    margin-right: 0.5rem;
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Topics Section */
.topics {
    padding: 5rem 0;
    background-color: var(--white);
}

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

.topic-card {
    display: block;
    background: var(--white);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    color: var(--dark);
    text-decoration: none;
    border: 1px solid #e5e7eb;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.topic-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.topic-card:hover i {
    transform: scale(1.1);
}

.topic-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
    transition: color 0.3s ease;
}

.topic-card:hover h3 {
    color: var(--primary);
}

.topic-card p {
    color: var(--gray);
    transition: color 0.3s ease;
}

.topic-card:hover p {
    color: var(--dark);
}

/* About Section */
.about {
    padding: 5rem 0;
    background-color: var(--light);
    text-align: center;
}

.about p {
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background-color: var(--white);
    text-align: center;
}

.contact p {
    margin-bottom: 2rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background-color: var(--dark);
    color: var(--light);
    padding: 2rem 0;
    text-align: center;
}

footer p {
    color: var(--light);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 2rem 0;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .hamburger {
        display: block;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

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

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

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}
