/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --dark-bg: #0f0f1e;
    --darker-bg: #0a0a14;
    --card-bg: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b2b2b2;
    --border-color: #2d2d44;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #74b9ff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Common Logo Styles */
.logo-img {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto 15px;
    filter: drop-shadow(0 0 10px rgba(108, 92, 231, 0.5));
}

.sidebar-logo {
    width: 45px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(108, 92, 231, 0.6));
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: rotate(5deg) scale(1.05);
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    position: relative;
    z-index: 100;
    /* Increased to ensure it's above particles */
}

.login-box {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease;
    position: relative;
    z-index: 200;
    /* Ensure it's above everything */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-section h1 {
    font-size: 28px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 42px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.remember-me {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-me input {
    margin-right: 8px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-color);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.register-link {
    text-align: center;
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 14px;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

.security-notice {
    margin-top: 30px;
    padding: 15px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(108, 92, 231, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.security-notice i {
    color: var(--primary-color);
}

/* Particles Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    /* Crucial: ensures clicks pass through to the form */
}

/* Dashboard Layout */
.dashboard-page {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(180deg, rgba(108, 92, 231, 0.05) 0%, transparent 100%);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, #fff, #a29bfe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--dark-bg);
}

.topbar {
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--darker-bg);
    border-radius: 10px;
    padding: 10px 15px;
    gap: 10px;
    width: 400px;
}

.search-bar i {
    color: var(--text-secondary);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    flex: 1;
    outline: none;
    font-family: inherit;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    position: relative;
}

.notification-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-profile span {
    font-weight: 500;
}

.user-profile i {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Content Area */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple {
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-color);
}

.stat-icon.blue {
    background: rgba(116, 185, 255, 0.2);
    color: var(--info);
}

.stat-icon.green {
    background: rgba(0, 184, 148, 0.2);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
}

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Section */
.section {
    margin-bottom: 40px;
}

.section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

/* Course Cards */
.course-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-thumbnail {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: white;
}

.course-info {
    padding: 20px;
}

.course-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.course-author {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 15px;
}

.progress-bar {
    background: var(--darker-bg);
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.progress-text {
    color: var(--text-secondary);
}

.btn-continue {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

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

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #1f1f3a;
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-icon.green {
    background: rgba(0, 184, 148, 0.2);
    color: var(--success);
}

.activity-icon.blue {
    background: rgba(116, 185, 255, 0.2);
    color: var(--info);
}

.activity-icon.purple {
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-color);
}

.activity-content p {
    margin-bottom: 5px;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Courses Page */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

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

.sort-dropdown select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
}

.course-card-detailed {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card-detailed:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.course-image {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    color: white;
    position: relative;
}

.course-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.course-badge.beginner {
    background: rgba(0, 184, 148, 0.9);
}

.course-badge.intermediate {
    background: rgba(253, 203, 110, 0.9);
}

.course-badge.advanced {
    background: rgba(214, 48, 49, 0.9);
}

.course-content {
    padding: 25px;
}

.course-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.course-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.course-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 13px;
}

.module-item.completed {
    border-left-color: var(--success);
}

.module-item.completed i {
    color: var(--success);
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.course-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
}

.course-actions {
    display: flex;
    gap: 15px;
}

.btn-enroll,
.btn-preview {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

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

.btn-preview {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-preview:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* User Dropdown */
.user-dropdown {
    animation: fadeIn 0.2s ease;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .toggle-sidebar {
        display: block;
    }
}

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

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

/* Course Badge Style */
.course-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 15, 30, 0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid rgba(108, 92, 231, 0.3);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.course-actions {
    display: flex;
    gap: 10px;
}

.btn-enroll {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

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

.btn-preview {
    background: var(--darker-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-preview:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .toggle-sidebar {
        display: block;
    }

    .search-bar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .search-bar {
        display: none;
    }

    .topbar {
        padding: 0 15px;
    }

    .content {
        padding: 20px 15px;
    }

    .user-profile span {
        display: none;
    }
}

/* Enhanced Code Blocks (Maldev Academy Style) */
.code-wrapper {
    position: relative;
    background: #0d1117;
    /* GitHub Dark dim */
    border-radius: 8px;
    /* Slightly more rounded */
    margin: 25px 0;
    max-width: 1100px;
    /* Increased by 20% */
    width: 100%;
    border: 1px solid #30363d;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    /* Deeper shadow */
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #8b949e;
    user-select: none;
}

.code-lang {
    font-weight: 700;
    text-transform: uppercase;
    color: #58a6ff;
    /* Blue accent */
    font-size: 11px;
    letter-spacing: 0.5px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-copy:hover {
    background: #21262d;
    border-color: #8b949e;
    color: #fff;
    transform: translateY(-1px);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy.copied {
    border-color: #2ea043;
    color: #2ea043;
    background: rgba(46, 160, 67, 0.1);
}

.btn-copy i {
    font-size: 11px;
}

.code-wrapper pre {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.code-wrapper code.hljs {
    font-family: 'Fira Code', 'Consolas', monospace;
    /* Modern font stack */
    font-size: 14px;
    line-height: 1.6;
    padding: 20px !important;
    background: transparent !important;
    /* Ensure wrapper bg shows */
    overflow-x: auto;
}

/* Scrollbar for code blocks */
.code-wrapper code.hljs::-webkit-scrollbar {
    height: 8px;
}

.code-wrapper code.hljs::-webkit-scrollbar-track {
    background: #0d1117;
}

.code-wrapper code.hljs::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.code-wrapper code.hljs::-webkit-scrollbar-thumb:hover {
    background: #58a6ff;
}

/* Quill Editor Syntax Match */
.ql-syntax {
    background-color: #0d1117 !important;
    color: #c9d1d9 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 15px !important;
    font-family: 'Consolas', 'Monaco', monospace !important;
    line-height: 1.6 !important;
    max-width: 1100px !important;
    width: 100%;
    margin: 10px 0 !important;
}