:root {
    /* Cores PrimÃ¡rias */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #8b5cf6;
    
    /* Neutras */
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    
    /* Status */
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 80px;
    
    /* Componentes */
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Fontes */
    --font-main: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* ==================
   SIDEBAR
   ================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    flex-shrink: 0;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #eef2ff;
    color: var(--primary-color);
}

.nav-links a i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ==================
   MAIN CONTENT
   ================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-box input {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px 40px 10px 16px;
    border-radius: 24px;
    width: 280px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
}

/* ==================
   HERO / CONTINUE LEARNING
   ================== */
.learning-hero {
    background: linear-gradient(120deg, var(--card-bg) 0%, #eff6ff 100%);
    border-radius: var(--border-radius);
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.5);
}

.hero-content h2 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.hero-content p {
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* ==================
   FILTERS & GRID
   ================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.filter-chips {
    display: flex;
    gap: 8px;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chip.active {
    background-color: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.chip:hover:not(.active) {
    background-color: #f3f4f6;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.course-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #e0e7ff;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-blue { background-color: #dbeafe; color: #1e40af; }
.badge-purple { background-color: #f3e8ff; color: #7e22ce; }
.badge-green { background-color: #d1fae5; color: #047857; }

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.4;
    color: var(--text-main);
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
    margin-top: auto;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-bar {
    width: 60px;
    height: 6px;
    background-color: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 3px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    color: var(--text-main);
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ==================
   LOGIN PAGE
   ================== */
.login-body {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 420px;
    padding: 48px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    background-color: var(--bg-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background-color: white;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
}

/* ==================
   LESSON PAGE (AULA)
   ================== */
.lesson-container {
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 24px;
    font-size: 14px;
}

.back-link:hover {
    color: var(--primary-color);
}

.lesson-header {
    margin-bottom: 32px;
}

.lesson-meta-large {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.lesson-tag {
    background-color: #f3f4f6;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.content-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    line-height: 1.8;
    color: #374151;
}

/* Markdown Styling inside content */
.content-card h1, .content-card h2, .content-card h3 {
    color: var(--text-main);
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

.content-card ul {
    padding-left: 20px;
    margin-bottom: 1.5em;
}

.content-card li {
    margin-bottom: 0.5em;
}

.content-card strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Video Placeholder */
.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 12px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(135deg, #1f2937, #111827);
}

.video-play-btn {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid rgba(255,255,255,0.4);
}

.video-play-btn i {
    font-size: 24px;
    color: white;
    margin-left: 4px; /* Optical adjustment */
}

.video-play-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.action-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* ==================
   RESPONSIVE (MOBILE)
   ================== */
@media (max-width: 768px) {
    body {
        flex-direction: column; /* Stack sidebar and content */
        overflow: auto; /* Allow body scrolling on mobile */
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 15px;
        display: none; /* Hide sidebar on mobile for cleaner view, or implement toggle */
    }

    .main-content {
        padding: 20px;
        overflow: visible; /* Let body handle scroll */
    }

    .learning-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero-image, .fa-rocket {
        display: none; /* Hide illustrative elements on mobile */
    }

    .search-box input {
        width: 100%; /* Full width search on mobile */
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-actions {
        width: 100%;
        justify-content: space-between;
    }

    .course-grid {
        grid-template-columns: 1fr; /* Single column */
    }
    
    .login-card {
        padding: 24px;
        margin: 20px;
    }
}

/* ==================
   LESSON METADATA
   ================== */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.meta-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.meta-card.full-width {
    grid-column: 1 / -1;
}

.meta-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.meta-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}


/* ==================
   TOGGLE SWITCH & STATUS
   ================== */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    margin-left: auto; /* Push to right if in flex container */
    user-select: none;
}

.status-toggle:hover {
    background: #e5e7eb;
}

.status-toggle.active {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.toggle-checkbox {
    display: none;
}

.toggle-icon {
    font-size: 18px;
    color: #9ca3af;
}

.status-toggle.active .toggle-icon {
    color: #059669;
}

.toggle-text {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-toggle.active .toggle-text {
    color: #065f46;
}

/* ==================
   NEW CARD GRID SYSTEM
   ================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card.completed {
    border-color: var(--success-color);
    background: #f0fdf4; /* Very light green bg */
}

/* Status Badge in Grid - Pill Shape */
.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.aula-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duration {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    flex-grow: 1; /* Pushes button to bottom */
}

.tags {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Update Mobile Adjustments for Grid */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}


/* ==================
   ENHANCED CONTENT SECTIONS STYLING
   ================== */

/* Original Section (Objetivos, Objetos, Descrição) */
.original-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
}

.subsection-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection-title:first-child {
    margin-top: 0;
}

.subsection-title i {
    font-size: 18px;
}

.subsection-content {
    color: #475569;
    line-height: 1.8;
    padding-left: 28px;
    font-size: 15px;
}

/* Detailed Sections */
.detailed-sections {
    display: grid;
    gap: 20px;
}

.info-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.info-section:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-header {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
}

.section-header i {
    font-size: 20px;
    min-width: 24px;
}

.section-header span {
    font-variant: small-caps;
    letter-spacing: 0.3px;
}

.section-body {
    color: #334155;
    line-height: 1.8;
    font-size: 15px;
    padding-left: 36px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .original-section {
        padding: 20px;
    }
    
    .subsection-content {
        padding-left: 0;
    }
    
    .section-body {
        padding-left: 0;
        font-size: 14px;
    }
    
    .info-section {
        padding: 16px;
    }
}

/* ==================
   MOBILE MENU IMPROVEMENTS
   ================== */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* Menu Overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .menu-overlay {
        display: block;
        pointer-events: none;
    }
    
    .menu-overlay.active {
        pointer-events: all;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
padding-top: 80px;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ==================
   MOBILE HEADER WITH LOGO
   ================== */

/* Mobile Header - Hidden by default */
.mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: white;
        border-bottom: 1px solid #e5e7eb;
        z-index: 998;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .mobile-header img {
        height: 50px;
        width: auto;
    }
    
    /* Adjust main content padding to account for fixed header */
    .main-content {
        padding-top: 90px !important;
    }
    
    /* Adjust mobile menu button position */
    .mobile-menu-btn {
        top: 10px;
        left: 10px;
    }
}
