:root {
    --bg-primary: #f4f4f4;
    --bg-secondary: #ffffff;
    --bg-navbar: #2c3e50;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #ffffff;
    --border-color: #ddd;
    --shadow: rgba(0,0,0,0.1);
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-navbar: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-light: #ffffff;
    --border-color: #404040;
    --shadow: rgba(0,0,0,0.3);
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

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

.navbar {
    background: var(--bg-navbar);
    color: var(--text-light);
    padding: 1rem 0;
    box-shadow: 0 2px 5px var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.3s;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

.nav-links a:hover {
    opacity: 0.8;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.course-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
    transition: transform 0.3s;
}

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

.course-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.course-content {
    padding: 1.5rem;
}

.course-content h3 {
    margin-bottom: 0.5rem;
}

.course-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.course-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.lessons-list {
    margin-top: 2rem;
}

.lesson-item {
    padding: 1rem;
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-item.completed {
    background: #d4edda;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: #27ae60;
    transition: width 0.3s;
}

.enrolled-courses {
    display: grid;
    gap: 2rem;
    padding: 2rem 0;
}

/* Home Page Styles */
.hero-home {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero-home h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-search {
    max-width: 600px;
    margin: 2rem auto;
    display: flex;
    gap: 0.5rem;
}

.hero-search input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat h3 {
    font-size: 2rem;
}

.features {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

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

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cta {
    background: #f8f9fa;
    padding: 4rem 0;
    text-align: center;
}

.cta h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.footer {
    background: var(--bg-navbar);
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
}

/* Search and Filters */
.filters-section {
    margin: 2rem 0;
}

.search-bar input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Enhanced Course Cards */
.course-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #3498db;
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.stars {
    color: #f39c12;
}

.course-instructor {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.course-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

/* Course Detail Page */
.course-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.course-stats {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-section {
    margin: 1.5rem 0;
}

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

.lesson-icon {
    font-size: 1.2rem;
}

.lesson-duration {
    color: #666;
    margin-left: 1rem;
}

.lock-icon {
    font-size: 1.2rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-login {
    background: white;
    color: #2c3e50;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
}

.course-description {
    font-size: 1.1rem;
    margin: 1rem 0;
}

/* Authentication Pages */
.auth-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px var(--shadow);
    max-width: 450px;
    width: 100%;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.link {
    color: #3498db;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #ddd;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    color: #666;
}

.btn-social {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.btn-social:hover {
    background: #f8f9fa;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

/* Subscription Page */
.subscription-container {
    min-height: calc(100vh - 80px);
    padding: 4rem 0;
    background: linear-gradient(to bottom, #f8f9fa, white);
}

.subscription-container h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.subscription-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

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

.pricing-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.pricing-card.featured {
    border-color: #3498db;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.2);
}

.pricing-card .badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.price .amount {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
}

.price .period {
    color: #666;
}

.savings {
    color: #27ae60;
    font-weight: bold;
    margin-top: 0.5rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.skip-link {
    text-align: center;
    margin-top: 2rem;
}

/* Payment Page */
.payment-container {
    min-height: calc(100vh - 80px);
    padding: 3rem 0;
    background: #f8f9fa;
}

.payment-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.payment-form-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.payment-secure {
    text-align: center;
    color: #27ae60;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.order-summary {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    height: fit-content;
}

.order-summary h3 {
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.summary-item.total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

.summary-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 1rem 0;
}

.payment-methods {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.payment-methods img {
    height: 25px;
    opacity: 0.6;
}

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

/* Course Payment Specific */
.course-summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.course-summary-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.course-summary-card h4 {
    margin: 0;
    font-size: 1.1rem;
}

.course-summary-card p {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

.access-info {
    background: #e8f5e9;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.access-info p {
    margin: 0.5rem 0;
    color: #27ae60;
    font-size: 0.9rem;
}

.access-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #27ae60;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.purchase-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.purchase-options p {
    color: #666;
}

/* Navigation Buttons */
.btn-nav-login {
    background: white;
    color: #2c3e50 !important;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    text-decoration: none !important;
    transition: background 0.3s;
    display: inline-block;
    font-weight: 500;
}

.btn-nav-login:hover {
    background: #ecf0f1;
    opacity: 1 !important;
}

.btn-nav-register {
    background: #27ae60;
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    text-decoration: none !important;
    transition: background 0.3s;
    display: inline-block;
    font-weight: 500;
}

.btn-nav-register:hover {
    background: #229954;
    opacity: 1 !important;
}

.btn-nav-logout {
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
}

.form-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

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

.stat-card h3 {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close:hover {
    color: var(--text-primary);
}

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

.course-form textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.badge-success {
    background: #27ae60 !important;
}

.badge-warning {
    background: #f39c12 !important;
}

/* Admin Section */
.admin-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 10px var(--shadow);
}

.approval-card {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
}

.approval-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.approval-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: white;
}

.role-student {
    background: #3498db;
}

.role-instructor {
    background: #9b59b6;
}

.role-admin {
    background: #e74c3c;
}

.instructor-courses {
    margin-top: 2rem;
}


/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-img {
    height: 80px;
    width: auto;
    transition: transform 0.3s;
}

.logo-img:hover {
    transform: scale(1.05);
}

.platform-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .logo-img {
        height: 60px;
    }
    
    .platform-name {
        font-size: 1.1rem;
    }
}

/* Footer Styles */
.footer {
    background: var(--bg-navbar);
    color: var(--text-light);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

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

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

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

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-light);
    transition: all 0.3s;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    opacity: 0.8;
}

/* AI Assistant Styles */
.ai-assistant-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Testimonials Section */
.testimonials {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.testimonials h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

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

.testimonial-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: transform 0.3s;
}

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

.testimonial-rating {
    color: #f39c12;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.testimonial-author strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.testimonial-author span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 5px var(--shadow);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.faq-question:hover {
    background: var(--bg-primary);
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.faq-icon {
    font-size: 1.5rem;
    color: #667eea;
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* AI Assistant Styles */
.ai-assistant-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.ai-assistant-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.ai-assistant-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
}

.ai-assistant-panel.open {
    display: flex;
}

.ai-assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-assistant-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.ai-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.ai-assistant-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    padding: 0.75rem;
    border-radius: 10px;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-user {
    background: #667eea;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.ai-message-assistant {
    background: var(--bg-primary);
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border-color);
}

.ai-message p {
    margin: 0.5rem 0;
}

.ai-message ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.ai-message li {
    margin: 0.25rem 0;
}

.ai-message a {
    color: #667eea;
    text-decoration: underline;
}

.ai-typing {
    opacity: 0.7;
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    animation: typingDot 1.4s infinite;
    opacity: 0;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
}

.ai-quick-questions {
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.ai-quick-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.ai-quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.ai-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
}

.ai-input-container textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ai-input-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

.ai-send-btn {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-send-btn:hover {
    transform: translateY(-2px);
}

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

@media (max-width: 768px) {
    .ai-assistant-panel {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        right: 20px;
    }
    
    .ai-assistant-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .ai-quick-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* ─── Advanced Features CSS ─────────────────────────────────────────── */

/* Notification bell */
.notif-bell-wrapper { position: relative; display: inline-block; }

/* Smooth page transitions */
body { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Enhanced course cards */
.course-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow);
}
.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(102,126,234,0.18);
}

/* Streak badge pulse */
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
#streak-badge > div { animation: pulse 2s infinite; }

/* Progress bar animated */
.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-bar {
    background: var(--border-color);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

/* Filter buttons */
.filter-btn {
    padding: 8px 18px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.filter-btn:hover { border-color: #667eea; color: #667eea; }
.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}

/* Search bar */
.search-bar { position: relative; }
.search-bar input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.search-bar input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* Stat cards */
.stat-card {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
    border-top: 4px solid #667eea;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dashboard stats grid */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Approval cards */
.approval-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1rem;
    border-left: 4px solid #f39c12;
    box-shadow: 0 2px 8px var(--shadow);
}
.approval-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}
.approval-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Btn sizes */
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* Access badge */
.access-badge {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Lesson items */
.lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}
.lesson-item:hover { background: rgba(102,126,234,0.05); }
.lesson-item.completed { border-left: 3px solid #27ae60; }
.lesson-info { display: flex; align-items: center; gap: 12px; }
.lesson-duration { font-size: 0.8rem; color: var(--text-secondary); margin-left: 8px; }

/* Users table */
.users-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.users-table th, .users-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.users-table th { background: rgba(102,126,234,0.08); font-weight: 600; color: var(--text-primary); }
.users-table tr:hover td { background: rgba(102,126,234,0.04); }

/* Role badges */
.role-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}
.role-admin { background: #fde8e8; color: #c0392b; }
.role-instructor { background: #e8f4fd; color: #2980b9; }
.role-student { background: #e8fdf0; color: #27ae60; }

/* Responsive */
@media (max-width: 768px) {
    .approval-header { flex-direction: column; }
    .approval-actions { width: 100%; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .users-table { font-size: 0.78rem; }
    .users-table th, .users-table td { padding: 8px 10px; }
}

/* ─── Premium / Free badges ─────────────────────────────────────────── */
.course-image { position: relative; font-size: 3.5rem; text-align: center; padding: 1.5rem 1rem; background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08)); }

.badge-free, .badge-premium, .badge-preview {
    position: absolute; top: 10px; right: 10px;
    padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-free    { background: #27ae60; color: white; }
.badge-premium { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; }
.badge-preview { background: #3498db; color: white; }

/* Purchase options box */
.purchase-options { display: flex; flex-direction: column; gap: 10px; margin-top: 1rem; }

/* Pricing cards enhanced */
.pricing-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border-color);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
}
.pricing-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(102,126,234,0.15); }
.pricing-card.featured { border-color: #667eea; box-shadow: 0 8px 30px rgba(102,126,234,0.2); }
.pricing-card .badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; padding: 4px 16px; border-radius: 20px; font-size: 0.78rem; font-weight: 700;
}
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.pricing-features { list-style: none; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 8px; }
.pricing-features li { font-size: 0.9rem; color: var(--text-secondary); }
.price .amount { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); }
.price .period { font-size: 0.9rem; color: var(--text-secondary); }
.savings { font-size: 0.82rem; color: #27ae60; font-weight: 600; margin-top: 4px; }

/* ─── Developer credit footer ───────────────────────────────────────── */
.dev-credit {
    text-align: center;
    padding: 16px;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.dev-credit strong { color: var(--text-primary); }

/* ─── Lesson Reader (Notes + PDF) ───────────────────────────────────── */
.reader-tabs {
    display: flex; gap: 4px;
    background: var(--bg-primary);
    border-radius: 12px; padding: 4px;
    margin-bottom: 1.2rem;
}
.reader-tab {
    flex: 1; padding: 9px 14px; border: none; border-radius: 9px;
    background: transparent; color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.reader-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow);
}

/* Notes reader */
.notes-reader {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem 1.8rem;
    font-size: 0.92rem;
    line-height: 1.9;
    color: var(--text-primary);
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}
.notes-reader h2 { font-size: 1.15rem; font-weight: 800; color: #667eea; margin: 0 0 12px; }
.notes-reader h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 18px 0 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.notes-reader p  { margin: 8px 0; }
.notes-reader ul { padding-left: 1.4rem; margin: 8px 0; }
.notes-reader li { margin: 5px 0; }
.notes-reader strong { color: var(--text-primary); }
.notes-reader blockquote {
    border-left: 4px solid #667eea;
    padding: 10px 16px;
    background: rgba(102,126,234,0.07);
    border-radius: 0 10px 10px 0;
    margin: 12px 0;
    font-style: italic;
    color: var(--text-secondary);
}
.notes-reader .highlight {
    background: rgba(255,235,59,0.35);
    padding: 1px 4px;
    border-radius: 3px;
}

/* PDF reader */
.pdf-reader {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #525659;
}
.pdf-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: #3d4043;
    gap: 10px; flex-wrap: wrap;
}
.pdf-toolbar span { color: #ccc; font-size: 0.82rem; }
.pdf-frame { width: 100%; height: 600px; border: none; display: block; }
.pdf-unavailable {
    padding: 3rem; text-align: center; background: var(--bg-primary);
    border-radius: 12px; border: 2px dashed var(--border-color);
}

/* Offline save badge */
.saved-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
    background: #e8f5e9; color: #27ae60;
}
.save-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 10px; border: none;
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: white; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: opacity 0.2s;
}
.save-btn:hover { opacity: 0.88; }
.save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Font size controls */
.font-controls { display: flex; align-items: center; gap: 6px; }
.font-btn {
    width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-color);
    background: var(--bg-secondary); color: var(--text-primary);
    font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.font-btn:hover { background: rgba(102,126,234,0.1); }


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE NAVIGATION — Hamburger Menu
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
    flex-shrink: 0;
}

.nav-hamburger:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* The 3 lines */
.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    transform-origin: center;
}

/* Animate to X when open */
.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    width: 0;
}
.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile breakpoint ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Show hamburger button on mobile */
    .nav-hamburger {
        display: flex !important;
    }

    /* Navbar container: allow dropdown to position relative to it */
    .navbar .container {
        position: relative;
    }

    /* Hide nav-links by default on mobile — !important overrides the base flex */
    .nav-links {
        display: none !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--bg-navbar) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
        padding: 0.4rem 0 0.8rem !important;
        z-index: 999 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 100% !important;
    }

    /* Show nav-links when open */
    .nav-links.nav-open {
        display: flex !important;
        animation: navSlideDown 0.22s ease;
    }

    /* Each nav item full-width */
    .nav-links li {
        width: 100% !important;
        margin: 0 !important;
    }

    /* All links/buttons inside nav — full width rows */
    .nav-links a,
    .nav-links .btn-nav-login,
    .nav-links .btn-nav-register,
    .nav-links .btn-nav-logout {
        display: block !important;
        padding: 0.8rem 1.4rem !important;
        border-radius: 0 !important;
        font-size: 0.93rem !important;
        color: var(--text-light) !important;
        background: transparent !important;
        text-decoration: none !important;
        transition: background 0.15s;
        width: 100% !important;
        box-sizing: border-box;
        opacity: 1 !important;
    }

    .nav-links a:hover,
    .nav-links .btn-nav-login:hover,
    .nav-links .btn-nav-register:hover,
    .nav-links .btn-nav-logout:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        opacity: 1 !important;
    }

    /* Login accent */
    .nav-links .btn-nav-login {
        border-left: 3px solid rgba(255, 255, 255, 0.35) !important;
    }

    /* Sign Up accent */
    .nav-links .btn-nav-register {
        border-left: 3px solid #27ae60 !important;
    }

    /* Logout accent */
    .nav-links .btn-nav-logout {
        border-left: 3px solid #e74c3c !important;
        color: #ff7675 !important;
    }

    /* Theme toggle button inside mobile nav */
    .nav-links li button.theme-toggle {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 0.8rem 1.4rem !important;
        background: transparent !important;
        border: none !important;
        color: var(--text-light) !important;
        font-size: 1.2rem !important;
        cursor: pointer;
    }

    /* Inline styled buttons (Install App, Get App) */
    .nav-links li a[href="download.html"],
    .nav-links li button[id="installAppBtn"] {
        margin: 0.4rem 1rem !important;
        width: calc(100% - 2rem) !important;
        border-radius: 8px !important;
        text-align: center !important;
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Divider before Login */
    .nav-links li:has(> .btn-nav-login) {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.3rem !important;
        padding-top: 0.3rem;
    }
}

/* ── Desktop: always show nav-links, never show hamburger ──────────────────── */
@media (min-width: 769px) {
    .nav-hamburger {
        display: none !important;
    }

    .nav-links {
        display: flex !important;
        flex-direction: row !important;
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-top: none !important;
        animation: none !important;
        width: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE IMPROVEMENTS — ሞባይል ላይ ጥሩ እይታ
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── General container padding ──
       IMPORTANT: navbar .container keeps position:relative for dropdown */
    .container { padding: 0 14px; }
    .navbar .container { position: relative; padding: 0 14px; }

    /* ── Hero section ── */
    .hero-home { padding: 2.5rem 0 2rem; }
    .hero-home h1 { font-size: 1.8rem; }
    .hero-search { flex-direction: column; gap: 0.6rem; margin: 1.2rem auto; }
    .hero-search input { font-size: 0.9rem; padding: 0.8rem; }
    .hero-stats { gap: 1.5rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
    .hero-stats .stat h3 { font-size: 1.5rem; }
    .hero-stats .stat p { font-size: 0.8rem; }

    /* ── Section headings ── */
    .features h2, .testimonials h2, .faq-section h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }
    .hero h2 { font-size: 1.6rem; }

    /* ── Courses grid: 1 column on small screens ── */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }

    /* ── Course cards ── */
    .course-image { height: 120px; font-size: 2.5rem; }
    .course-content { padding: 1rem; }
    .course-content h3 { font-size: 1rem; }
    .course-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
    .course-footer .btn { width: 100%; text-align: center; }

    /* ── Filters ── */
    .category-filters { gap: 6px; }
    .filter-btn { padding: 0.4rem 1rem; font-size: 0.8rem; }

    /* ── Dashboard stats: 2 columns ── */
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }
    .stat-card { padding: 1rem; }
    .stat-card h3 { font-size: 1.8rem; }

    /* ── Auth cards ── */
    .auth-container { padding: 1rem; }
    .auth-card { padding: 1.5rem; }
    .auth-card h2 { font-size: 1.4rem; }

    /* ── Payment checkout ── */
    .checkout-layout { grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0; }
    .checkout-form-box, .order-box { padding: 1.2rem; }
    .order-box { position: static !important; }
    .payment-methods { grid-template-columns: 1fr 1fr; gap: 8px; }
    .pay-method { padding: 10px 8px; }
    .pay-method p { font-size: 0.72rem; }

    /* ── Course detail page ── */
    .lesson-viewer { padding: 1rem; }
    .lesson-viewer h2 { font-size: 1.1rem; }
    .lesson-notes { padding: 1rem; font-size: 0.85rem; }
    .lesson-actions { flex-direction: column; gap: 8px; }
    .lesson-actions .btn { min-width: unset; width: 100%; }
    .chapter-header { padding: 12px 14px; }
    .chapter-info h4 { font-size: 0.88rem; }
    .lesson-row { padding: 10px 14px; gap: 10px; }

    /* ── Subscription page plan cards ── */
    .plan-card { padding: 1.5rem; }
    .plan-price { font-size: 2.2rem; }

    /* ── Admin dashboard table ── */
    .users-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-bar { gap: 6px; }
    .tab-btn { padding: 7px 12px; font-size: 0.78rem; }

    /* ── Instructor dashboard ── */
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

    /* ── FAQ ── */
    .faq-question h3 { font-size: 0.95rem; }

    /* ── Footer ── */
    .footer-content { grid-template-columns: 1fr; gap: 1.5rem; text-align: center; }
    .social-links { justify-content: center; }
    .footer { padding: 2rem 0 1rem; margin-top: 2rem; }

    /* ── Platform name in navbar (shorten on very small screens) ── */
    .platform-name { font-size: 1rem; }

    /* ── Modals ── */
    .modal-content { margin: 10% auto; padding: 1.2rem; width: 95%; }
    .modal-box { padding: 1.2rem; width: 95%; max-height: 85vh; }

    /* ── Study hub feature cards ── */
    .feature-card { padding: 1.2rem; }
    .feature-icon { font-size: 2rem; }
    .feature-card h3 { font-size: 1rem; }

    /* ── Lesson action buttons stack vertically ── */
    .lesson-actions { gap: 8px; }

    /* ── Home page CTA ── */
    .cta { padding: 2.5rem 0; }
    .cta h2 { font-size: 1.4rem; }
    .btn-large { padding: 0.8rem 1.5rem; font-size: 1rem; }

    /* ── Breadcrumb ── */
    .breadcrumb { font-size: 0.75rem; gap: 4px; }
}

/* Extra small screens (< 400px) */
@media (max-width: 400px) {
    .hero-home h1 { font-size: 1.5rem; }
    .platform-name { font-size: 0.9rem; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .stat-card h3 { font-size: 1.5rem; }
    .course-image { height: 100px; font-size: 2rem; }
    .btn-nav-login, .btn-nav-register { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
    .auth-card { padding: 1.2rem; }
}
