/* Sikho.ai Course Page Styles */
:root {
    --primary-color: #0066ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 320px;
    --header-height: 60px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #212529;
    overflow-x: hidden;
}

/* Layout Container */
.course-container {
    display: flex !important;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid #e9ecef;
    height: calc(100vh - 60px);
    position: fixed;
    z-index: 100;
    left: 0;
    top: 60px;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.course-progress {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-text {
    font-size: 0.875rem;
    color: #6c757d;
    min-width: 45px;
}

/* Course Modules */
.course-modules {
    padding: 10px;
}

.module {
    margin-bottom: 10px;
}

.module-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.module-header:hover {
    background: #e9ecef;
}

.module.active .module-header {
    background: #e7f1ff;
    color: var(--primary-color);
}

.module-title {
    font-size: 0.95rem;
    font-weight: 500;
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.module-lessons {
    margin-top: 5px;
    padding-left: 10px;
}

.lesson {
    padding: 10px 15px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #495057;
}

.lesson:hover {
    background: #f8f9fa;
    color: #212529;
}

.lesson.active {
    background: var(--primary-color);
    color: white !important;
}

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

.lesson-icon {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: white;
    min-height: 100vh;
}

.content-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.content-actions {
    display: flex !important;
    gap: 10px;
    align-items: center;
}

.content-body {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none !important;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #0056d3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-success {
    background: var(--success-color);
    color: white !important;
}

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

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white !important;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #212529;
}

.content-section h3 {
    font-size: 1.25rem;
    margin: 20px 0 15px;
    color: #495057;
}

.content-section p {
    line-height: 1.8;
    color: #495057;
    margin-bottom: 15px;
}

/* Resources */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.resource-card {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
    background: white;
}

.resource-card:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.resource-card .resource-title {
    color: #2c3e50;
}

.resource-card .resource-description {
    color: #64748b;
}

.resource-card .resource-type {
    color: #667eea;
}

.resource-icon {
    width: 40px;
    height: 40px;
    background: #e7f1ff;
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

/* Dark Mode */
[data-theme="dark"] {
    background: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .sidebar {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .main-content {
    background: #0f172a;
}

[data-theme="dark"] .content-header {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .content-section {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .module-header {
    background: #334155;
}

[data-theme="dark"] .module-header:hover {
    background: #475569;
}

[data-theme="dark"] .lesson:hover {
    background: #334155;
}

[data-theme="dark"] .resource-card {
    border-color: #475569 !important;
    background: #1e293b !important;
}

[data-theme="dark"] .resource-card:hover {
    background: #334155 !important;
    border-color: #667eea !important;
}

[data-theme="dark"] .resource-card .resource-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .resource-card .resource-description {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .resource-card .resource-type {
    color: #8b5cf6 !important;
}

[data-theme="dark"] .course-title,
[data-theme="dark"] .module-title,
[data-theme="dark"] .content-title {
    color: #f1f5f9;
}

[data-theme="dark"] .lesson {
    color: #cbd5e1;
}

/* Mobile Responsive */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .content-body {
        padding: 20px;
    }
}

/* Loading States */
.loading {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6c757d;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enrollment Banner */
.enrollment-banner {
    background: linear-gradient(135deg, var(--primary-color), #0056d3);
    color: white !important;
    padding: 15px 20px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-radius: 10px;
}

.preview-banner {
    background: var(--warning-color);
    color: #333;
    padding: 10px;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Notifications */
.enrollment-success,
.enrollment-error {
    padding: 15px;
    position: fixed;
    top: 80px;
    right: 20px;
    border-radius: 5px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Enhanced Tools Dropdown */
.tools-section {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.tools-section:last-child {
    border-bottom: none;
}

.tools-section-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
}

.tool-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    padding: 12px 16px;
    text-align: center;
}

/* Collapsible Sidebar */

.sidebar-toggle:not(.divider-toggle) {
    position: absolute;
    right: 10px;
    top: 15px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border: none !important;
    border-radius: 8px;
    color: white !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}
}
.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar.collapsed .course-nav h3,
.sidebar.collapsed .module-title,
.sidebar.collapsed .lesson-title,
.sidebar.collapsed .resources-section {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    right: 10px;
    border-radius: 8px;
}

.main-content.expanded {
    margin-left: 80px;
}

/* AI Tutor Modal */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tool-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex !important;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.close-btn {
    background: none;
    border: none !important;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
}

/* AI Chat Styles */
.ai-tutor-container {
    height: 500px;
    display: flex !important;
    flex-direction: column;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ai-message {
    display: flex !important;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

.ai-message-user {
    justify-content: flex-end;
}

.ai-message-bot {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

.ai-message-user .message-avatar {
    background: var(--primary-color);
    color: white !important;
    order: 2;
}

.ai-message-bot .message-avatar {
    background: #e5e7eb;
    color: #6b7280;
    order: 0;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-message-user .message-content {
    background: var(--primary-color);
    color: white !important;
}

.typing-indicator {
    display: flex !important;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.ai-chat-input {
    display: flex !important;
    gap: 10px;
}

.ai-chat-input textarea {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    resize: none;
}

/* Notes Styles */
.notes-container {
    min-height: 400px;
}

.notes-header {
    margin-bottom: 16px;
}

.note-meta {
    display: flex !important;
    gap: 20px;
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
}

.notes-list {
    max-height: 300px;
    overflow-y: auto;
}

.note-item {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.note-header {
    display: flex !important;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Bookmarks Styles */
.bookmark-current {
    margin-bottom: 24px;
    text-align: center;
}

.btn.bookmarked {
    background: #fbbf24;
    color: white !important;
}

/* Discussion Styles */
.discussion-container {
    min-height: 400px;
}

.discussion-header {
    display: flex !important;
    gap: 10px;
    margin-bottom: 20px;
}

.discussion-threads {
    max-height: 400px;
    overflow-y: auto;
}

.discussion-thread {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.thread-header {
    display: flex !important;
    justify-content: space-between;
    margin-bottom: 8px;
}

.thread-actions {
    display: flex !important;
    gap: 10px;
    margin-top: 12px;
}

/* Enrollment Prompt */
.enrollment-prompt {
    text-align: center;
    padding: 60px 20px;
}

.prompt-icon {
    margin-bottom: 24px;
    color: #9ca3af;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex !important;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10001;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-warning {
    border-left: 4px solid #f59e0b;
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

/* Dark theme support */
[data-theme="dark"] .tool-modal .modal-content {
    background: #1e293b;
    color: #f1f5f9;
}

[data-theme="dark"] .ai-chat-messages {
    background: #0f172a;
}

[data-theme="dark"] .message-content {
    background: #1e293b;
}

[data-theme="dark"] .ai-message-user .message-content {
    background: var(--primary-color);
}

/* Toolbar Buttons - Notes and Discussions */
.toolbar-btn {
    background: #4A90E2;
    color: white !important;
    border: none !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.toolbar-btn:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.toolbar-btn i {
    font-size: 16px;
}

.notes-btn {
    background: #FF6B6B;
}

.notes-btn:hover {
    background: #E55555;
}

.discussions-btn {
    background: #4ECDC4;
}

.discussions-btn:hover {
    background: #38A8A0;
}

/* Floating Notes Button (for popup) */
.floating-notes-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #FF6B6B;
    color: white !important;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-notes-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.floating-notes-btn.active {
    background: #E55555;
}

.floating-notes-btn i {
    font-size: 24px;
}

.floating-notes-btn .tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #333;
    color: white !important;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.floating-notes-btn:hover .tooltip {
    opacity: 1;
}

/* Notes Popup Modal */
.notes-popup-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 10000;
}

.notes-popup-modal.minimized {
    height: 50px;
    overflow: hidden;
}

.notes-popup-modal.minimized .notes-popup-body {
    display: none;
}

.notes-popup-header {
    background: linear-gradient(135deg, #FF6B6B 0%, #E55555 100%);
    color: white !important;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
}

.notes-popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.notes-popup-actions {
    display: flex !important;
    gap: 10px;
}

.notes-popup-actions button {
    background: transparent;
    border: none !important;
    color: white !important;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.notes-popup-actions button:hover {
    opacity: 0.8;
}

.notes-popup-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.notes-input-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

#new-note-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
}

.btn-add-note {
    margin-top: 10px;
    background: #FF6B6B;
    color: white !important;
    border: none !important;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-add-note:hover {
    background: #E55555;
}

.notes-list {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
}

.note-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #FF6B6B;
}

.note-header {
    display: flex !important;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.note-lesson {
    background: #FFE5E5;
    padding: 2px 8px;
    border-radius: 4px;
    color: #FF6B6B;
}

.note-content {
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 10px;
    min-height: 50px;
}

.note-content:focus {
    outline: 2px solid #FF6B6B;
}

.note-actions {
    display: flex !important;
    gap: 10px;
}

.note-actions button {
    padding: 5px 10px;
    border: none !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-save {
    background: #4ECDC4;
    color: white !important;
}

.btn-delete {
    background: #dc3545;
    color: white !important;
}

.no-notes {
    text-align: center;
    color: #999;
    padding: 40px;
}

@media (max-width: 768px) {
    .toolbar-btn span {
        display: none;
    }
    
    .notes-popup-modal {
        width: 95%;
    }
    
    .floating-notes-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Notes and Discussion Toolbar Buttons */
.toolbar-btn {
    background: var(--primary-color);
    color: white !important;
    border: none !important;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.notes-btn {
    background: #4CAF50;
}

.notes-btn:hover {
    background: #45a049;
}

.discussion-btn {
    background: #2196F3;
}

.discussion-btn:hover {
    background: #1976D2;
}

.toolbar-btn i {
    font-size: 16px;
}

.toolbar-btn span {
    font-weight: 500;
}

@media (max-width: 768px) {
    .toolbar-btn span {
        display: none;
    }
}

/* Dark Theme Fixes for Dynamic Content */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    color: #e0e0e0;
}

[data-theme="dark"] .hero-title {
    color: #ffffff;
}

[data-theme="dark"] .hero-subtitle {
    color: #b0b0b0;
}

[data-theme="dark"] .content-container {
    background: #1a1a2e;
    color: #e0e0e0;
}

[data-theme="dark"] .section-title {
    color: #ffffff;
    border-bottom-color: #3a3a4e;
}

[data-theme="dark"] .content-section {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .content-section p,
[data-theme="dark"] .content-section li {
    color: #d0d0d0;
}

[data-theme="dark"] .content-section pre {
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
}

[data-theme="dark"] .content-section code {
    background: #1a1a2e;
    color: #66d9ef;
}

[data-theme="dark"] select {
    background: #2a2a3e;
    color: #e0e0e0;
    border-color: #3a3a4e;
}

[data-theme="dark"] select option {
    background: #2a2a3e;
    color: #e0e0e0;
}

/* Resources tab dark theme */
[data-theme="dark"] .tab-content {
    background: #2a2a3e;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #b0b0b0;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background: #2a2a3e;
    color: #ffffff;
    border-color: #3a3a4e;
}

/* Smooth theme transition */
body, .sidebar, .main-content, .content-section, .hero, .content-container {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark Theme Fixes for Code Examples and Resources */
[data-theme="dark"] pre {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    border: 1px solid #3a3a4e;
}

[data-theme="dark"] pre code {
    background: transparent !important;
    color: #d4d4d4 !important;
}

[data-theme="dark"] .code-example {
    background: #2a2a3e;
    border: 1px solid #3a3a4e;
}

[data-theme="dark"] .code-example h4 {
    color: #ffffff;
}

[data-theme="dark"] .code-example p {
    color: #b0b0b0;
}

/* Resources Section Dark Theme */
[data-theme="dark"] .lesson-resources {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

[data-theme="dark"] .lesson-resources h3 {
    color: #ffffff;
}

[data-theme="dark"] .resource-item {
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .resource-item:hover {
    background: #252538;
    border-color: #4a4a5e;
}

[data-theme="dark"] .resource-item a {
    color: #66d9ef !important;
}

[data-theme="dark"] .resource-item h4 {
    color: #ffffff;
}

[data-theme="dark"] .resource-item p {
    color: #b0b0b0;
}

[data-theme="dark"] .resource-card {
    background: #1a1a2e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .resource-card:hover {
    background: #252538;
    transform: translateY(-2px);
}

[data-theme="dark"] .resource-card h4 {
    color: #ffffff;
}

[data-theme="dark"] .resource-card .resource-type {
    color: #66d9ef;
}

[data-theme="dark"] .resource-link {
    color: #66d9ef !important;
}

/* Sidebar Resources Tab */
[data-theme="dark"] #lesson-resources {
    background: #2a2a3e;
    color: #e0e0e0;
}

[data-theme="dark"] #lesson-resources .resource-item {
    background: #1a1a2e;
    border-color: #3a3a4e;
}

[data-theme="dark"] #lesson-resources a {
    color: #66d9ef !important;
}

/* Code syntax highlighting in dark mode */
[data-theme="dark"] .language-javascript,
[data-theme="dark"] .language-html,
[data-theme="dark"] .language-css {
    color: #d4d4d4 !important;
}

/* Ensure text is visible in all code blocks */
[data-theme="dark"] code {
    color: #66d9ef !important;
    background: #1e1e1e;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Inline code in paragraphs */
[data-theme="dark"] p code,
[data-theme="dark"] li code {
    background: #1e1e1e;
    color: #66d9ef !important;
    padding: 2px 6px;
}

/* Additional visibility fixes for dark theme */
[data-theme="dark"] .content-section pre {
    background: #1e1e1e !important;
    border: 1px solid #3a3a4e;
    color: #d4d4d4 !important;
}

[data-theme="dark"] .content-section code {
    color: #d4d4d4 !important;
}

/* Fix for exercise and practice sections */
[data-theme="dark"] .exercise-item {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .exercise-item h4 {
    color: #66d9ef;
}

[data-theme="dark"] details summary {
    color: #66d9ef;
    cursor: pointer;
}

[data-theme="dark"] details[open] {
    background: #1a1a2e;
    padding: 10px;
    border-radius: 5px;
}

/* Fix video selector in dark mode */
[data-theme="dark"] .video-selector select {
    background: #2a2a3e !important;
    color: #e0e0e0 !important;
    border: 1px solid #3a3a4e !important;
}

[data-theme="dark"] .video-selector select option {
    background: #2a2a3e !important;
    color: #e0e0e0 !important;
}

/* Ensure all text in content sections is visible */
[data-theme="dark"] .content-section * {
    color: #d0d0d0;
}

[data-theme="dark"] .content-section h1,
[data-theme="dark"] .content-section h2,
[data-theme="dark"] .content-section h3,
[data-theme="dark"] .content-section h4 {
    color: #ffffff !important;
}

/* Important: Override any inline styles */
[data-theme="dark"] .content-section div[style*="background"] {
    background: #2a2a3e !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .content-section div[style*="color: #666"] {
    color: #b0b0b0 !important;
}

/* Lesson resources in sidebar */
[data-theme="dark"] .sidebar .lesson-resources {
    background: #1a1a2e;
}

[data-theme="dark"] .sidebar .resource-item {
    background: #2a2a3e;
    border: 1px solid #3a3a4e;
    transition: all 0.3s ease;
}

[data-theme="dark"] .sidebar .resource-item:hover {
    background: #353548;
    transform: translateX(5px);
}

/* Code block styles with proper theme support */
.code-block {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid #e0e0e0;
}

[data-theme="dark"] .code-block {
    background: #1e1e1e !important;
    border: 1px solid #3a3a4e !important;
}

[data-theme="dark"] .code-block code {
    color: #d4d4d4 !important;
    background: transparent !important;
}

/* Ensure resources are visible in dark mode */
[data-theme="dark"] .resource-item span {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .resource-item i {
    color: #66d9ef !important;
}

/* Text muted for secondary text */
.text-muted {
    color: #666;
}

[data-theme="dark"] .text-muted {
    color: #b0b0b0 !important;
}

/* Fix lesson resources sidebar in dark theme */
[data-theme="dark"] #resourcesSection {
    background: transparent !important;
}

[data-theme="dark"] #resourcesSection .resources-title {
    color: #e0e0e0 !important;
}

[data-theme="dark"] #lessonResources .resource-item {
    background: #2a2a3e !important;
    border: 1px solid #3a3a4e !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] #lessonResources .resource-item:hover {
    background: #353548 !important;
    border-color: #667eea !important;
}

[data-theme="dark"] #lessonResources .resource-item span {
    color: #e0e0e0 !important;
}

[data-theme="dark"] #lessonResources .resource-item i {
    color: #66d9ef !important;
}

/* Base styles for resource items */
.resource-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.resource-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.resource-item i {
    font-size: 18px;
    color: #667eea;
}

.resource-item span {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Fix Lesson Resources visibility in dark theme - stronger specificity */
[data-theme="dark"] .sidebar #resourcesSection {
    background: transparent !important;
}

[data-theme="dark"] .sidebar #resourcesSection .resources-title {
    color: #e0e0e0 !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .sidebar #lessonResources {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .sidebar #lessonResources .resource-item {
    background: rgba(102, 126, 234, 0.1) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #e0e0e0 !important;
    padding: 12px 16px !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
}

[data-theme="dark"] .sidebar #lessonResources .resource-item:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: #667eea !important;
    transform: translateX(4px) !important;
}

[data-theme="dark"] .sidebar #lessonResources .resource-item i {
    color: #66d9ef !important;
    font-size: 18px !important;
}

[data-theme="dark"] .sidebar #lessonResources .resource-item span {
    color: #e0e0e0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Ensure the resources title is visible */
[data-theme="dark"] .resources-title {
    color: #e0e0e0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
}

/* Resources title styling for both themes */
.resources-title {
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
}

[data-theme="dark"] .resources-title {
    color: #e0e0e0 !important;
}

/* Ensure resource items are styled properly */
.sidebar .resource-item {
    display: flex !important;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
    font-size: 14px;
    background: #f1f5f9;
}

.sidebar .resource-item:hover {
    background: #e2e8f0;
}

.sidebar .resource-item i {
    margin-right: 8px;
    width: 16px;
    color: #667eea;
}

.sidebar .resource-item span {
    color: #333;
}

/* Dark theme overrides for resource items */
[data-theme="dark"] .sidebar .resource-item {
    background: rgba(102, 126, 234, 0.15) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

[data-theme="dark"] .sidebar .resource-item:hover {
    background: rgba(102, 126, 234, 0.25) !important;
}

[data-theme="dark"] .sidebar .resource-item i {
    color: #66d9ef !important;
}

[data-theme="dark"] .sidebar .resource-item span {
    color: #e0e0e0 !important;
}

    background: rgba(102, 215, 239, 0.1);
}


/* Divider Toggle Button */
.sidebar-toggle.divider-toggle {
    position: fixed !important;
    left: 319px !important;  /* Right at edge of 320px sidebar */
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 60px !important;
    background: #667eea !important;
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    color: white !important;
    cursor: pointer !important;
    z-index: 999999 !important;  /* Very high z-index */
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: left 0.3s ease, background 0.3s ease !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2) !important;
}

.sidebar-toggle.divider-toggle:hover {
    background: #5a67d8;
    width: 28px;
}

/* Adjust position when sidebar is collapsed */
.sidebar-toggle.divider-toggle {
    position: fixed !important;
    left: 319px !important;  /* Right at edge of 320px sidebar */
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 60px !important;
    background: #667eea !important;
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    color: white !important;
    cursor: pointer !important;
    z-index: 999999 !important;  /* Very high z-index */
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: left 0.3s ease, background 0.3s ease !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2) !important;
}

/* Rotate arrow when collapsed */
/* Move button to left edge when sidebar is collapsed */
.sidebar.collapsed ~ .sidebar-toggle.divider-toggle {
    left: 0 !important;
    border-radius: 0 8px 8px 0 !important;
}

.sidebar.collapsed ~ .sidebar-toggle #toggleIcon {
    transform: rotate(180deg) !important;
}

/* Dark mode styles */
.sidebar-toggle.divider-toggle {
    position: fixed !important;
    left: 319px !important;  /* Right at edge of 320px sidebar */
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 60px !important;
    background: #667eea !important;
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    color: white !important;
    cursor: pointer !important;
    z-index: 999999 !important;  /* Very high z-index */
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: left 0.3s ease, background 0.3s ease !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2) !important;
}

[data-theme="dark"] .sidebar-toggle.divider-toggle:hover {
    background: #2d3748;
}
