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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #faf8f3;
    --bg-secondary: #f0ebe5;
    --border-color: #e8e3dc;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 24px 0 rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.progress-section {
    margin-bottom: 2rem;
}

.progress-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.modules-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.module-list {
    list-style: none;
}

.module-item {
    margin-bottom: 0.75rem;
}

.module-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.module-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.module-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.module-link.completed {
    opacity: 0.7;
}

.module-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.module-name {
    flex: 1;
}

.module-expand {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.module-link.expanded .module-expand {
    transform: rotate(90deg);
}

/* Subsections */
.subsection-list {
    list-style: none;
    margin: 0.5rem 0 0.5rem 2.5rem;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.subsection-list.expanded {
    max-height: 500px;
}

.subsection-item {
    margin-bottom: 0.25rem;
}

.subsection-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.subsection-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.subsection-link.active {
    background-color: var(--bg-accent);
    color: var(--primary-color);
    font-weight: 500;
}

.subsection-icon {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    margin-left: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.back-link {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

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

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 0.75rem;
    font-weight: 300;
}

/* Sections */
section {
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

section:last-child {
    border-bottom: none;
}

.content-section {
    background-color: var(--bg-secondary);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.intro-text strong {
    font-weight: 600;
    color: var(--primary-color);
}

/* Content Box */
.content-box {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.content-box h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.content-box p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.content-box ul {
    margin-left: 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.content-box li {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Module Navigation */
.module-nav {
    background-color: var(--bg-secondary);
    padding: 3rem 2rem;
}

.nav-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.nav-button:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    section {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 1024px) {
    body {
        grid-template-columns: 240px 1fr;
    }

    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

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

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }

    .main-content {
        margin-left: 0;
    }

    .module-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .module-link {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 3rem 1.5rem;
    }

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

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

    .section-title {
        font-size: 1.75rem;
    }

    section {
        padding: 2.5rem 1.5rem;
    }

    .nav-buttons {
        gap: 1rem;
    }

    .nav-button {
        min-width: auto;
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2.5rem 1rem;
    }

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

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

    .section-title {
        font-size: 1.5rem;
    }

    section {
        padding: 2rem 1rem;
    }

    .module-list {
        grid-template-columns: 1fr;
    }

    .module-link {
        padding: 1.25rem 1rem;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-button {
        width: 100%;
        padding: 1.25rem;
        font-size: 1rem;
    }

    .sidebar-title {
        font-size: 1.25rem;
    }

    .content-box {
        padding: 1.5rem;
    }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
