/* lesson-layout.css - Layout styles for lesson pages */
/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --primary: #007849;
    --secondary: #EF3340;
    --accent: #FFD100;
    --light: #f8f9fa;
    --dark: #1D1D1B;
    --text: #34495e;
    --sidebar-width: 280px;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0,0,0,0.08);
    --radius: 8px;
    --border-light: 1px solid rgba(0,0,0,0.08);
    --border-accent: 1px solid rgba(255, 209, 0, 0.2);
    --header-height: 70px;
}

/* ========== BODY LAYOUT GRID ========== */
body {
    background-color: var(--light);
    color: var(--text);
    line-height: 1.5;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas: 
        "top-nav top-nav"
        "sid-bar body-data"
        "sid-bar footer";
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* ========== TOP NAVIGATION ========== */
/* Main header with logo and navigation menu */
.top-nav {
    grid-area: top-nav;
    background: white;
    color: var(--dark);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 120, 73, 0.1);
    width: 100%;
    height: var(--header-height);
}

/* Logo container with image and text */
.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 38px;
    height: 38px;
    background: transparent;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation container and menu */
.nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    right: 0;
    background: white;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 10px 10px;
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.nav-menu.active {
    display: flex;
}

/* Navigation items styling */
.nav-item {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
    background: rgba(0, 120, 73, 0.1);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(0, 120, 73, 0.05);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-item.active i {
    color: var(--secondary);
}

.nav-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
    transition: color 0.3s;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========== SIDEBAR ========== */
/* Main sidebar for desktop */
.sid-bar {
    grid-area: sid-bar;
    background: var(--light);
    padding: 1rem;
    border-right: var(--border-light);
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section {
    padding-bottom: 1.5rem;
    border-bottom: var(--border-light);
}

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

.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

/* ========== MOBILE TOPICS TOGGLE ========== */
.mobile-topic-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    margin-right: 0.5rem;
}

.mobile-topics-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background: var(--light);
    z-index: 1002;
    overflow-y: auto;
    padding: 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    border-right: var(--border-light);
}

.mobile-topics-sidebar.active {
    transform: translateX(0);
}

.mobile-topics-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
    z-index: 1003;
    padding: 0.5rem;
}

/* ========== MAIN CONTENT AREA ========== */
.body-data.tutorial-content {
    grid-area: body-data;
    padding: 2rem;
    background: white;
    overflow-y: auto;
}

/* Lesson header with breadcrumb and title */
.lesson-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: var(--border-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.breadcrumb i {
    font-size: 0.8rem;
    color: #999;
}

.breadcrumb .current {
    color: var(--dark);
    font-weight: 500;
}

.lesson-title-section {
    margin-bottom: 1.5rem;
}

.lesson-title {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.lesson-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.lesson-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-meta i {
    color: var(--primary);
}

/* Lesson content container */
.lesson-container {
    max-width: 900px;
    margin: 0 auto;
}

.lesson-text-content h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
}

.lesson-text-content h3 {
    font-size: 1.4rem;
    color: var(--dark);
    margin: 1.5rem 0 0.8rem;
}

.lesson-text-content p {
    margin-bottom: 1.2rem;
    line-height: 1.6;
    color: var(--text);
}

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

/* ========== NAVIGATION CONTROLS ========== */
.lesson-navigation-controls {
    margin: 3rem 0 1rem;
    padding: 1rem 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

.nav-controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.nav-control-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    min-width: 140px;
    justify-content: center;
}

.nav-control-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-control-btn:hover .nav-control-icon {
    color: white;
}

.nav-control-btn.prev-btn {
    justify-content: flex-start;
}

.nav-control-btn.next-btn {
    justify-content: flex-end;
}

.nav-control-icon {
    font-size: 1.2rem;
    color: var(--primary);
    transition: var(--transition);
}

.nav-control-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.nav-control-btn:hover .nav-control-text {
    color: white;
}

/* ========== FOOTER ========== */
footer {
    grid-area: footer;
    background: var(--dark);
    color: white;
    padding: 1.5rem 1.5rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: white;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ddd;
}

.contact-item i {
    color: var(--accent);
    width: 20px;
}

.copyright {
    width: 100%;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #aaa;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        box-shadow: none;
        padding: 0;
        width: auto;
        z-index: auto;
        max-height: none;
        overflow-y: visible;
    }
    
    .nav-item {
        color: var(--primary);
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "top-nav"
            "body-data"
            "footer";
    }
    
    .sid-bar {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 280px;
        height: calc(100vh - var(--header-height));
        background: var(--light);
        z-index: 999;
        padding: 1.5rem;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    
    .sid-bar.active {
        display: block;
        transform: translateX(0);
    }
    
    .mobile-topic-toggle {
        display: block;
    }
    
    .body-data.tutorial-content {
        padding: 1.5rem;
    }
    
    .sidebar-content {
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0.8rem 1rem;
    }
    
    .mobile-topics-sidebar {
        width: 100%;
    }
    
    .lesson-title {
        font-size: 1.8rem;
    }
    
    .lesson-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-controls-container {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .nav-control-btn {
        padding: 0.8rem 1rem;
        min-width: 120px;
    }
    
    .nav-control-text {
        font-size: 1rem;
    }
    
    .nav-control-icon {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .body-data.tutorial-content {
        padding: 1rem;
    }
    
    .lesson-title {
        font-size: 1.5rem;
    }
    
    .nav-control-btn {
        padding: 0.7rem 0.8rem;
        gap: 0.5rem;
        min-width: 100px;
    }
    
    .nav-control-text {
        font-size: 0.9rem;
    }
    
    .nav-control-icon {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .nav-control-btn {
        padding: 0.6rem 0.7rem;
        min-width: 90px;
    }
    
    .nav-control-text {
        font-size: 0.85rem;
    }
    
    .nav-control-icon {
        font-size: 0.85rem;
    }
}