:root {
    --primary-color: #1E3A8A;
    --accent-color: #34D399;
    --text-secondary-color: #D1D5DB;
    --sidebar-bg: #1A1A2E;
    --card-bg: #36395A;
    --text-color: #F8F8F8;
    --search-bg: #30304D;
}

.light-mode {
    --primary-color: #F0F4F8;
    --accent-color: #10B981;
    --text-secondary-color: #6B7280;
    --sidebar-bg: #FFFFFF;
    --card-bg: #E5E7EB;
    --text-color: #1A1A2E;
    --search-bg: #D1D5DB;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    padding: 30px 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.logo-highlight {
  color: #34D399;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 50px;
    color: var(--text-color);
    cursor: pointer;
}

a {
    text-decoration: none;
    color: var(--text-color)
}

.menu-title {
    font-size: 0.8em;
    color: var(--text-secondary-color);
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
    cursor: pointer;
}

.nav-item a {
    display: block;
    padding: 10px 15px;
    color: var(--text-secondary-color);
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.nav-item a i {
    margin-right: 10px;
}

.nav-item a:hover {
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--text-color);
}

.nav-item.active a {
    background-color: var(--accent-color);
    color: var(--sidebar-bg);
    font-weight: 600;
}

.mode-toggle-container {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    color: var(--text-secondary-color);
    font-size: 0.9em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-secondary-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.content {
    flex-grow: 1;
    padding: 30px 40px;
    background-color: var(--content-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    color: var(--text-secondary-color);
    text-decoration: none;
    background-color: transparent;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.back-button:hover {
    background-color: var(--search-bg);
    color: var(--text-color);
}

.search-bar {
    background-color: var(--search-bg);
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    max-width: 50%;
    flex-grow: 1;
}

.search-bar i {
    color: var(--text-secondary-color);
    margin-right: 10px;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-color);
    outline: none;
    width: 100%;
    font-size: 1em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--text-color);
    font-weight: 400;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
}

.user-profile span {
    font-size: 1.1em;
    font-weight: 400;
}

.user-profile i {
    font-size: 0.7em;
    color: var(--text-secondary-color);
    margin-left: 2px;
    margin-top: 5px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 5px;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
}

.video-player-container {
    flex-basis: auto;
    flex-grow: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #1A1A2E;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin: 0 2px;
    
}

.video-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.video-controls .fa-play {
    font-size: 2em;
    cursor: pointer;
}

.video-time {
    font-size: 0.9em;
}

.lesson-content-container {
    flex-basis: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.lesson-details {
    background-color: var(--sidebar-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-grow: 1;
}

.lesson-details header {
    margin-bottom: 20px;
}

.lesson-details h1 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
}

.intro-text {
    font-size: 0.95em;
    color: var(--text-secondary-color);
    line-height: 1.5;
}

.resources {
    margin-top: 30px;
}

.resources h2 {
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 15px;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.resource-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.resource-card .icon {
    font-size: 1.8em;
    color: var(--accent-color);
    margin-right: 15px;
}

.resource-card .resource-info h3 {
    font-size: 1em;
    margin: 0;
    color: var(--text-color);
}

.resource-card .resource-info p {
    font-size: 0.8em;
    margin: 0;
    color: var(--text-secondary-color);
}

.main-footer {
    margin-top: 20px;
    padding-top: 20px;
    text-align: right;
    color: var(--text-secondary-color);
    font-size: 0.9em;
    opacity: 0.6;
}

.mobile-header {
    display: none; 
}

.mobile-nav {
    display: none;
}

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        display: none; 
    }

    .top-header {
        display: none;
    }
    
    .mobile-header {
        display: flex;
        justify-content: space-between; 
        align-items: center;
        background-color: var(--sidebar-bg);
        padding: 15px 20px;
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
    }

    .mobile-header .logo-mobile {
        font-size: 1.4em;
        font-weight: 700;
        color: var(--text-color);
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-header .menu-icon {
        font-size: 1.5em;
        color: var(--text-secondary-color);
        cursor: pointer;
    }
    
    .mobile-header .header-icons {
      display: flex;
      gap: 15px; 
    }

    .mobile-header .profile-icon,
    .mobile-header .search-icon {
        font-size: 1.5em;
        color: var(--text-secondary-color);
        cursor: pointer;
    }

    .mobile-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        background-color: var(--sidebar-bg);
        padding: 20px;
        z-index: 999;
        transition: transform 0.3s ease-in-out;
        transform: translateY(-100%);
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav.show {
        display: block;
        transform: translateY(0);
    }

    .content {
        padding: 0;
        margin-top: 0;
    }

    .content-container {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .lesson-details {
        padding: 20px;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .main-footer {
        position: static;
        text-align: center;
        margin-top: 40px;
        padding-bottom: 20px;
        opacity: 1;
    }

    #mobile-theme-toggle {
    display: flex;
    align-items: center;
    }

    #mobile-theme-toggle .fa-moon,
    #mobile-theme-toggle .fa-sun {
    font-size: 1.5em; 
    color: var(--text-secondary-color);
    cursor: pointer;
    }
}