:root {
    --primary: #6a11cb;
    --primary-gradient: linear-gradient(45deg, #6a11cb, #2575fc);
    --secondary: #f0f2f5;
    --text: #333333;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    --shadow: 0 4px 15px rgba(101, 41, 255, 0.2);
    --border-radius: 12px;
    --font-primary: 'Poppins', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

.dark-mode {
    --primary: #8e44ad;
    --primary-gradient: linear-gradient(45deg, #8e44ad, #3498db);
    --secondary: #121212;
    --text: #e0e0e0;
    --card-bg: #1e1e1e;
    --sidebar-bg: #252525;
    --header-bg: #1e1e1e;
    --shadow: 0 4px 15px rgba(101, 41, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
}

body {
    background: var(--secondary);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: var(--secondary);
}

.sidebar {
    background: var(--sidebar-bg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    position: relative;
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.logo {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1.2px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--primary);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text);
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 1.1rem;
    box-shadow: 0 0 0 transparent;
    transition: all 0.3s ease;
}

nav a i {
    font-size: 1.3rem;
}

nav a.active, nav a:hover {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 8px 20px rgba(101, 41, 255, 0.3);
    transform: translateY(-3px);
}

.content {
    padding: 2.5rem 3rem;
    overflow-y: auto;
    max-height: 100vh;
    background: var(--secondary);
}

.header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    background: var(--header-bg);
    padding: 1.2rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    align-items: center;
}

.search-bar {
    background: var(--card-bg);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 320px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    color: var(--text);
    outline: none;
    font-size: 1rem;
    font-weight: 400;
}

.search-bar i {
    color: var(--primary);
    font-size: 1.2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}

.avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: var(--shadow);
    user-select: none;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(101, 41, 255, 0.3);
}

.card h3 {
    margin-bottom: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.3rem;
}

.card p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.course-card {
    position: relative;
    padding-bottom: 1.2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.8rem 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(101, 41, 255, 0.25);
}

.course-card h3 {
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--primary);
}

.course-card p {
    font-size: 1rem;
    color: var(--text);
    opacity: 0.85;
    margin-bottom: 1.8rem;
    min-height: 48px;
}

.enroll-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 6px 15px rgba(101, 41, 255, 0.3);
    transition: background 0.3s ease;
}

.enroll-btn:hover {
    background: #4a0fc1;
}

.enroll-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.course-header {
    margin-bottom: 2.5rem;
}

.progress-bar {
    height: 14px;
    background: #e0e0e0;
    border-radius: 7px;
    margin-top: 1.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 7px;
    transition: width 0.6s ease;
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.lesson {
    background: var(--card-bg);
    padding: 1.2rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.lesson:hover {
    background: var(--primary-gradient);
    color: white;
}

.video-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: black;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-container iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.video-controls button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 6px 15px rgba(101, 41, 255, 0.3);
    transition: background 0.3s ease;
}

.video-controls button:hover {
    background: #4a0fc1;
}

.hidden {
    display: none !important;
}

.back-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 6px 15px rgba(101, 41, 255, 0.3);
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #4a0fc1;
}

.recent-courses {
    margin-top: 3rem;
}

.recent-courses h2 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--primary);
}

.course-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.3s ease, color 0.3s ease;
}

.course-item:hover {
    background: var(--primary-gradient);
    color: white;
}

.course-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(101, 41, 255, 0.3);
    user-select: none;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

.sidebar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.sidebar-mobile.active {
    transform: translateX(0);
}

.close-sidebar {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-sidebar:hover {
    color: var(--primary);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

.recommended-tutorials {
    margin-top: 3rem;
}

.recommended-tutorials h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.tutorial-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tutorial-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.tutorial-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(101, 41, 255, 0.2);
}

.tutorial-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.tutorial-item p {
    font-size: 0.95rem;
    color: var(--text);
    opacity: 0.85;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tutorial-item .tutorial-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.7;
}

.tutorial-item .tutorial-meta i {
    color: var(--primary);
}
