/* ==========================================
   CSS Variables & Reset
   ========================================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --accent: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --gray-lighter: #cbd5e1;
    --light: #f1f5f9;
    --lighter: #f8fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --transition: all 0.3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--lighter);
    overflow-x: hidden;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.75rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--gray);
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-secondary {
    background: var(--light);
    color: var(--gray);
    padding: 0.625rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.user-profile {
    display: flex;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--dark);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    margin-top: 80px;
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-text > p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--white);
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--white);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

.visual-card {
    background: var(--white);
    color: var(--dark);
    padding: 3rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: rotate(3deg);
    transition: var(--transition);
}

.visual-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.visual-card i {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.visual-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.visual-card p {
    color: var(--gray);
}

/* ==========================================
   Section Headers
   ========================================== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray);
}

/* ==========================================
   Courses Section
   ========================================== */
.courses-section {
    padding: 6rem 0;
    background: var(--lighter);
}

.course-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    background: var(--white);
    color: var(--gray);
    border: 2px solid var(--gray-lighter);
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.course-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: var(--shadow-lg);
}

.course-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

.course-badge.beginner {
    background: var(--secondary);
    color: var(--white);
}

.course-badge.intermediate {
    background: var(--accent);
    color: var(--white);
}

.course-badge.advanced {
    background: var(--danger);
    color: var(--white);
}

.course-image {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-image i {
    font-size: 4rem;
    color: var(--white);
    opacity: 0.9;
}

.course-content {
    padding: 1.5rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.course-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.course-content > p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.course-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-bar {
    height: 0.5rem;
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius);
    transition: width 0.5s ease;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.btn-course {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-course:hover {
    background: var(--primary-dark);
}

/* ==========================================
   Progress Section
   ========================================== */
.progress-section {
    padding: 6rem 0;
    background: var(--white);
}

.progress-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.progress-card {
    background: var(--lighter);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.progress-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow);
}

.progress-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
}

.progress-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.progress-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.progress-card p {
    color: var(--gray);
    font-size: 0.875rem;
}

/* ==========================================
   Resources Section
   ========================================== */
.resources-section {
    padding: 6rem 0;
    background: var(--lighter);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.resource-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-md);
}

.resource-card > i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.resource-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.resource-card p {
    color: var(--gray);
    margin-bottom: 1rem;
}

.resource-link {
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
}

.resource-link:hover {
    color: var(--primary-dark);
}

.resource-link i {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* ==========================================
   Support Section
   ========================================== */
.support-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
}

.support-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.support-content > p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.support-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.support-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-0.25rem);
}

.support-item > i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.support-item h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.support-item p {
    opacity: 0.8;
}

.support-section .btn-primary {
    background: var(--white);
    color: var(--primary);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--gray-light);
    line-height: 1.6;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--gray-light);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--dark-light);
}

.footer-bottom p {
    color: var(--gray-light);
}

/* ==========================================
   Search Modal
   ========================================== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light);
}

.search-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-search {
    background: transparent;
    font-size: 1.25rem;
    color: var(--gray);
    transition: var(--transition);
}

.close-search:hover {
    color: var(--dark);
}

.search-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--light);
}

.search-input i {
    color: var(--gray);
}

.search-input input {
    flex: 1;
    font-size: 1rem;
    color: var(--dark);
}

.search-results {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* ==========================================
   Mobile Menu
   ========================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 300px;
    background: var(--white);
    z-index: 1500;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light);
}

.mobile-menu-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-menu {
    background: transparent;
    font-size: 1.25rem;
    color: var(--gray);
}

.mobile-nav {
    padding: 1rem 0;
}

.mobile-nav li a {
    display: block;
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
}

.mobile-nav li a:hover {
    background: var(--light);
    color: var(--primary);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 4rem 0;
    }

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

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

    .hero-stats {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .courses-section,
    .progress-section,
    .resources-section,
    .support-section {
        padding: 4rem 0;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }

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

    .hero-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .course-filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }
}

/* ==========================================
   Course Pages (Shared Styles)
   ========================================== */
.course-page {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

.course-hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.course-hero-content {
    max-width: 800px;
}

.course-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    opacity: 0.9;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.course-back:hover {
    opacity: 1;
}

.course-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.course-hero p {
    font-size: 1.125rem;
    opacity: 0.9;
}

.course-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.course-meta-bar span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
}

.course-content-wrapper {
    padding: 4rem 0;
    background: var(--lighter);
}

.course-main {
    max-width: 900px;
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lesson-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.lesson-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(0.5rem);
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lesson-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.lesson-info {
    flex: 1;
}

.lesson-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lesson-info p {
    color: var(--gray);
    font-size: 0.875rem;
}

.lesson-status {
    color: var(--gray-light);
    font-size: 1.25rem;
}

.lesson-status.completed {
    color: var(--secondary);
}

.course-sidebar {
    margin-top: 3rem;
}

.course-progress-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.course-progress-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.progress-track {
    margin-bottom: 1.5rem;
}

.progress-track-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-track-bar {
    height: 0.75rem;
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
}

.progress-track-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius);
    transition: width 0.5s ease;
}

.btn-start-lesson {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-start-lesson:hover {
    background: var(--primary-dark);
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.course-card {
    animation: fadeIn 0.5s ease forwards;
}

.course-card:nth-child(2) {
    animation-delay: 0.1s;
}

.course-card:nth-child(3) {
    animation-delay: 0.2s;
}
