/* === UI REFINEMENTS BASED ON improve_UI.md === */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body, html {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9fafb;
}

:root {
    --primary-blue: #004d9c;
    --accent-teal: #00c19a;
    --sidebar-green: #249c3a;
    --medium-gray: #e5e7eb;
    --light-gray: #f9fafb;
}

/* Subject Card Enhancements */
.subject-card {
    border-radius: 18px;
    border: 1px solid var(--medium-gray);
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.10);
}
.subject-card .icon-container {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--accent-teal);
    line-height: 1;
}
.subject-card .card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.subject-card .card-text {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1.25rem;
}
.subject-card .btn {
    background: var(--accent-teal);
    color: #fff;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    transition: background 0.2s, color 0.2s;
}
.subject-card .btn:hover {
    background: #009e7a;
    color: #fff;
}

/* Emoji icon support for subject cards */
.subject-card .emoji-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}

/* Sidebar Section Headers */
.sidebar-header {
    border-radius: 10px 10px 0 0;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}
.sidebar-header.stats {
    background: var(--primary-blue);
    color: #fff;
}
.sidebar-header.progress {
    background: var(--sidebar-green);
    color: #fff;
}

/* Sidebar Card */
.stats-card, .progress-card {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    background: #fff;
    margin-bottom: 1.5rem;
}

/* Progress Bar Container (always visible) */
.progress-bar-container {
    background: #e5e7eb;
    border-radius: 6px;
    height: 10px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    overflow: hidden;
}
.progress-bar {
    background: var(--primary-blue);
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s;
}

/* Open Chat Button */
#openChatBtn {
    background: var(--accent-teal);
    color: #fff;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: none;
    transition: background 0.2s, color 0.2s;
}
#openChatBtn:hover {
    background: #009e7a;
    color: #fff;
}
#openChatBtn i {
    margin-right: 0.5rem;
}

/* Typography Refinement */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
}

/* --- DARK MODE VARIANTS FOR NEW STYLES --- */
.dark-mode body, .dark-mode {
    background-color: #181c1f !important;
}
.dark-mode .subject-card {
    background: #23272b !important;
    border-color: #2d2d2d !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}
.dark-mode .subject-card .card-text {
    color: #b0b0b0 !important;
}
.dark-mode .subject-card .btn {
    background: #00c19a !important;
    color: #fff !important;
}
.dark-mode .subject-card .btn:hover {
    background: #009e7a !important;
}
.dark-mode .subject-card .icon-container, .dark-mode .subject-card .emoji-icon {
    color: #00c19a !important;
}
.dark-mode .stats-card, .dark-mode .progress-card {
    background: #23272b !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.18) !important;
}
.dark-mode .sidebar-header.stats {
    background: #004d9c !important;
    color: #fff !important;
}
.dark-mode .sidebar-header.progress {
    background: #249c3a !important;
    color: #fff !important;
}
.dark-mode .progress-bar-container {
    background: #2d2d2d !important;
}
.dark-mode .progress-bar {
    background: #00c19a !important;
}
.dark-mode #openChatBtn {
    background: #00c19a !important;
    color: #fff !important;
}
.dark-mode #openChatBtn:hover {
    background: #009e7a !important;
}

/* Maintain all previous dark mode styles below this line */
/* Custom styles for NexusLearn */

.hero-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 80px 0;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 20px;
}

.features-section {
    background-color: #f8f9fa;
}

.subject-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

.topic-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

.lesson-content, .explanation-content, .quiz-content {
    line-height: 1.8;
    font-size: 1.1rem;
    max-width: 100%;
    overflow-wrap: break-word;
}

.lesson-content p, .explanation-content p, .quiz-content p {
    margin-bottom: 15px;
    text-align: justify;
    hyphens: auto;
}

.lesson-content h1, .explanation-content h1, .quiz-content h1 {
    color: #495057;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.lesson-content h2, .explanation-content h2, .quiz-content h2 {
    color: #FF6B35;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.5rem;
}

.lesson-content h3, .explanation-content h3, .quiz-content h3 {
    color: #4A90E2;
    margin-top: 25px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.3rem;
}

.lesson-content p, .explanation-content p, .quiz-content p {
    margin-bottom: 15px;
}

.lesson-content ul, .explanation-content ul, .quiz-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
    list-style-type: disc;
}

.lesson-content ol, .explanation-content ol, .quiz-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
    list-style-type: decimal;
}

.lesson-content li, .explanation-content li, .quiz-content li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.lesson-content strong, .explanation-content strong, .quiz-content strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Enhanced content styling for better readability */
.lesson-content, .explanation-content, .quiz-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lesson-content h2, .explanation-content h2, .quiz-content h2 {
    border-bottom: 2px solid #FF6B35;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.lesson-content h3, .explanation-content h3, .quiz-content h3 {
    border-left: 3px solid #4A90E2;
    padding-left: 15px;
    margin-left: -15px;
}

/* Better list styling */
.lesson-content ul li, .explanation-content ul li, .quiz-content ul li {
    position: relative;
    padding-left: 5px;
}

.lesson-content ol li, .explanation-content ol li, .quiz-content ol li {
    position: relative;
    padding-left: 5px;
}

/* Enhanced paragraph spacing */
.lesson-content p, .explanation-content p, .quiz-content p {
    text-align: left;
    line-height: 1.7;
    margin-bottom: 18px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
}

.form-control:focus {
    border-color: #2c3e50;
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 2px solid #e9ecef;
    background-color: #f8f9fa;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

.badge {
    font-size: 0.8rem;
    padding: 6px 10px;
}

.alert {
    border-radius: 8px;
    border: none;
}

.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    border-radius: 10px 10px 0 0;
}

.list-group-item {
    border: none;
    border-radius: 0;
    padding: 12px 20px;
}

.list-group-item:first-child {
    border-radius: 8px 8px 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 8px 8px;
}

.list-group-item.active {
    background-color: #2c3e50;
    border-color: #2c3e50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 

.larger-subject-section {
    padding: 2.5rem 2rem 2.5rem 2rem;
    min-height: 420px;
}

.large-subject-card {
    min-height: 320px;
    padding: 2rem 1rem 1.5rem 1rem;
    border-radius: 18px;
}

.large-subject-card .fa-4x {
    font-size: 3.5rem !important;
    margin-bottom: 1.5rem !important;
}

.large-subject-card .card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.large-subject-card .card-text {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.large-subject-card .btn-lg {
    font-size: 1.1rem;
    padding: 10px 28px;
}

.large-subject-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stats-card {
    margin-bottom: 1.5rem;
    min-width: 270px;
}

@media (max-width: 991px) {
    .stats-card {
        min-width: 100%;
    }
}

/* Chat Interface Styles */
.chat-sidebar {
    min-height: 80vh;
    background: #eceff1;
    border-right: 1px solid #e0e0e0;
}
.chat-history-item {
    transition: background 0.2s, color 0.2s;
}
.chat-history-item.bg-primary {
    background: #0d6efd !important;
    color: #fff !important;
}
.chat-history-main {
    background: #f3f4f6;
    min-height: 60vh;
    max-height: 70vh;
    overflow-y: auto;
}
.chat-history-main .d-flex {
    align-items: flex-end;
}
.chat-history-main .p-3 {
    border-radius: 1.25rem;
    box-shadow: 0 2px 8px rgba(44,62,80,0.07);
    font-size: 1.08rem;
    line-height: 1.6;
}
.chat-history-main .justify-content-end .p-3 {
    background: #d1e7fd;
    color: #1a232f;
}
.chat-history-main .justify-content-start .p-3 {
    background: #fff;
    color: #222;
}
#chatForm .form-control {
    font-size: 1.1rem;
    padding: 12px 16px;
}
#chatForm .btn-primary {
    padding: 10px 22px;
    font-size: 1.1rem;
}
#chatForm .btn-link {
    color: #0d6efd;
}
#chatForm .btn-link:hover {
    color: #0a58ca;
}
#subjectDropdown, #gradeDropdown {
    min-width: 120px;
    font-size: 1rem;
}
@media (max-width: 991px) {
    .chat-sidebar {
        display: none !important;
    }
    .chat-history-main {
        max-height: 60vh;
    }
}

/* Smaller subject cards for dashboard */
.subject-card.large-subject-card {
    min-height: 220px;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.75rem 0.5rem;
}
.subject-card .fa-4x {
    font-size: 2.2rem !important;
    margin-bottom: 1rem !important;
}
.subject-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.subject-card .card-text {
    font-size: 0.95rem;
}
.subject-card .btn-lg {
    font-size: 1rem;
    padding: 0.4rem 1.2rem;
}

.scrollable-activities {
    max-height: 200px;
    overflow-y: auto;
}

/* Enhanced content styles */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 1rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.content-media-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #2c3e50;
}

.content-media-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.media-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.media-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.media-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.media-caption {
    padding: 0.75rem;
    background: white;
    border-top: 1px solid #e9ecef;
}

.media-caption h6 {
    margin-bottom: 0.25rem;
    color: #495057;
    font-weight: 600;
}

.media-caption p {
    margin-bottom: 0;
    color: #6c757d;
    font-size: 0.875rem;
}

/* AI-generated content enhancements */
.ai-heading {
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.subtopic-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.subtopic-content img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.subtopic-content .row {
    margin: 1.5rem 0;
}

.subtopic-content .col-md-4,
.subtopic-content .col-md-6 {
    margin-bottom: 1rem;
}

/* Loading animation for content generation */
.content-loading {
    text-align: center;
    padding: 2rem;
}

.content-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Highlight button for text selection */
.highlight-chat-btn {
    position: absolute;
    z-index: 9999;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Responsive media adjustments */
@media (max-width: 768px) {
    .video-container {
        padding-bottom: 56.25%;
    }
    
    .content-media-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .subtopic-content .col-md-4,
    .subtopic-content .col-md-6 {
        margin-bottom: 1.5rem;
    }
} 

/* ===== DARK MODE STYLES ===== */
.dark-mode {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

/* Dark mode body and general elements */
.dark-mode body {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

/* Dark mode navbar */
.dark-mode .navbar {
    background-color: #2d2d2d !important;
    border-bottom: 1px solid #404040 !important;
}

.dark-mode .navbar-brand {
    color: #ffffff !important;
}

.dark-mode .navbar-nav .nav-link {
    color: #e0e0e0 !important;
}

.dark-mode .navbar-nav .nav-link:hover {
    color: #ffffff !important;
}

.dark-mode .dropdown-menu {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
}

.dark-mode .dropdown-item {
    color: #e0e0e0 !important;
}

.dark-mode .dropdown-item:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

.dark-mode .dropdown-divider {
    border-color: #404040 !important;
}

/* Dark mode cards */
.dark-mode .card {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border: 1px solid #404040 !important;
}

.dark-mode .card-header {
    background-color: #404040 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #404040 !important;
}

.dark-mode .card-body {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

/* Dark mode buttons */
.dark-mode .btn-outline-secondary {
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

.dark-mode .btn-outline-secondary:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

.dark-mode .btn-outline-primary {
    color: #4dabf7 !important;
    border-color: #4dabf7 !important;
}

.dark-mode .btn-outline-primary:hover {
    background-color: #4dabf7 !important;
    color: #ffffff !important;
}

.dark-mode .btn-outline-success {
    color: #69db7c !important;
    border-color: #69db7c !important;
}

.dark-mode .btn-outline-success:hover {
    background-color: #69db7c !important;
    color: #ffffff !important;
}

.dark-mode .btn-outline-info {
    color: #74c0fc !important;
    border-color: #74c0fc !important;
}

.dark-mode .btn-outline-info:hover {
    background-color: #74c0fc !important;
    color: #ffffff !important;
}

.dark-mode .btn-outline-warning {
    color: #ffd43b !important;
    border-color: #ffd43b !important;
}

.dark-mode .btn-outline-warning:hover {
    background-color: #ffd43b !important;
    color: #000000 !important;
}

.dark-mode .btn-primary {
    background-color: #4dabf7 !important;
    border-color: #4dabf7 !important;
    color: #ffffff !important;
}

.dark-mode .btn-primary:hover {
    background-color: #339af0 !important;
    border-color: #339af0 !important;
}

.dark-mode .btn-success {
    background-color: #69db7c !important;
    border-color: #69db7c !important;
    color: #ffffff !important;
}

.dark-mode .btn-success:hover {
    background-color: #51cf66 !important;
    border-color: #51cf66 !important;
}

/* Dark mode forms */
.dark-mode .form-control {
    background-color: #404040 !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

.dark-mode .form-control:focus {
    background-color: #404040 !important;
    border-color: #4dabf7 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(77, 171, 247, 0.25) !important;
}

.dark-mode .form-control::placeholder {
    color: #a0a0a0 !important;
}

.dark-mode .input-group-text {
    background-color: #404040 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Dark mode text colors */
.dark-mode .text-muted {
    color: #b0b0b0 !important;
}

.dark-mode .text-primary {
    color: #4dabf7 !important;
}

.dark-mode .text-success {
    color: #69db7c !important;
}

.dark-mode .text-info {
    color: #74c0fc !important;
}

.dark-mode .text-warning {
    color: #ffd43b !important;
}

.dark-mode .text-danger {
    color: #ff6b6b !important;
}

/* Dark mode backgrounds */
.dark-mode .bg-light {
    background-color: #404040 !important;
}

.dark-mode .bg-white {
    background-color: #2d2d2d !important;
}

/* Dark mode modals */
.dark-mode .modal-content {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border: 1px solid #404040 !important;
}

.dark-mode .modal-header {
    background-color: #404040 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #404040 !important;
}

.dark-mode .modal-footer {
    background-color: #404040 !important;
    border-top: 1px solid #404040 !important;
}

.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dark mode alerts */
.dark-mode .alert-info {
    background-color: #1e3a5f !important;
    border-color: #2d5a8b !important;
    color: #b3d9ff !important;
}

.dark-mode .alert-success {
    background-color: #1e4d2e !important;
    border-color: #2d6a4f !important;
    color: #b3e6cc !important;
}

.dark-mode .alert-warning {
    background-color: #4d3e1e !important;
    border-color: #6b5a2d !important;
    color: #ffe6b3 !important;
}

.dark-mode .alert-danger {
    background-color: #4d1e1e !important;
    border-color: #6b2d2d !important;
    color: #ffb3b3 !important;
}

/* Dark mode progress bars */
.dark-mode .progress {
    background-color: #404040 !important;
}

.dark-mode .progress-bar {
    background-color: #4dabf7 !important;
}

/* Dark mode badges */
.dark-mode .badge.bg-primary {
    background-color: #4dabf7 !important;
    color: #ffffff !important;
}

.dark-mode .badge.bg-success {
    background-color: #69db7c !important;
    color: #ffffff !important;
}

.dark-mode .badge.bg-warning {
    background-color: #ffd43b !important;
    color: #000000 !important;
}

.dark-mode .badge.bg-danger {
    background-color: #ff6b6b !important;
    color: #ffffff !important;
}

.dark-mode .badge.bg-info {
    background-color: #74c0fc !important;
    color: #ffffff !important;
}

.dark-mode .badge.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

/* Dark mode list groups */
.dark-mode .list-group-item {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

.dark-mode .list-group-item:hover {
    background-color: #404040 !important;
}

.dark-mode .list-group-item.active {
    background-color: #4dabf7 !important;
    border-color: #4dabf7 !important;
    color: #ffffff !important;
}

/* Dark mode breadcrumbs */
.dark-mode .breadcrumb {
    background-color: transparent !important;
}

.dark-mode .breadcrumb-item {
    color: #e0e0e0 !important;
}

.dark-mode .breadcrumb-item.active {
    color: #ffffff !important;
}

.dark-mode .breadcrumb-item + .breadcrumb-item::before {
    color: #a0a0a0 !important;
}

/* Dark mode tables */
.dark-mode .table {
    color: #ffffff !important;
}

.dark-mode .table th {
    background-color: #404040 !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

.dark-mode .table td {
    border-color: #404040 !important;
}

.dark-mode .table-hover tbody tr:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

/* Dark mode pagination */
.dark-mode .pagination .page-link {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.dark-mode .pagination .page-link:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

.dark-mode .pagination .page-item.active .page-link {
    background-color: #4dabf7 !important;
    border-color: #4dabf7 !important;
    color: #ffffff !important;
}

.dark-mode .pagination .page-item.disabled .page-link {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #6c757d !important;
}

/* Dark mode specific content areas */
.dark-mode .lesson-content h1,
.dark-mode .explanation-content h1,
.dark-mode .quiz-content h1 {
    color: #ffffff !important;
    border-bottom-color: #4dabf7 !important;
}

.dark-mode .lesson-content h2,
.dark-mode .explanation-content h2,
.dark-mode .quiz-content h2 {
    color: #e0e0e0 !important;
}

.dark-mode .lesson-content h3,
.dark-mode .explanation-content h3,
.dark-mode .quiz-content h3 {
    color: #ffffff !important;
}

/* Dark mode chat interface */
.dark-mode .chat-sidebar {
    background-color: #2d2d2d !important;
    border-right-color: #404040 !important;
}

.dark-mode .chat-history-main {
    background-color: #1a1a1a !important;
}

.dark-mode .chat-history-main .justify-content-end .p-3 {
    background-color: #4dabf7 !important;
    color: #ffffff !important;
}

.dark-mode .chat-history-main .justify-content-start .p-3 {
    background-color: #404040 !important;
    color: #ffffff !important;
}

/* Dark mode scrollbars */
.dark-mode ::-webkit-scrollbar {
    width: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #2d2d2d !important;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #404040 !important;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d !important;
}

/* Dark mode gradients */
.dark-mode .bg-gradient-primary {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%) !important;
}

.dark-mode .bg-gradient-success {
    background: linear-gradient(135deg, #69db7c 0%, #51cf66 100%) !important;
}

.dark-mode .bg-gradient-info {
    background: linear-gradient(135deg, #74c0fc 0%, #4dabf7 100%) !important;
}

/* Dark mode content media sections */
.dark-mode .content-media-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%) !important;
    border-left-color: #4dabf7 !important;
}

.dark-mode .content-media-section h4 {
    color: #ffffff !important;
}

.dark-mode .media-item {
    background-color: #2d2d2d !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

.dark-mode .media-caption {
    background-color: #2d2d2d !important;
    border-top-color: #404040 !important;
}

.dark-mode .media-caption h6 {
    color: #ffffff !important;
}

.dark-mode .media-caption p {
    color: #b0b0b0 !important;
}

/* Dark mode AI headings */
.dark-mode .ai-heading {
    color: #ffffff !important;
    border-left-color: #4dabf7 !important;
}

/* Dark mode subject cards hover effect */
.dark-mode .subject-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.4) !important;
}

.dark-mode .topic-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
}

/* Dark mode dropdowns */
.dark-mode .dropdown-toggle::after {
    border-top-color: #e0e0e0 !important;
}

/* Dark mode tooltips */
.dark-mode .tooltip-inner {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

.dark-mode .tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #2d2d2d !important;
}

.dark-mode .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #2d2d2d !important;
}

.dark-mode .tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #2d2d2d !important;
}

.dark-mode .tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #2d2d2d !important;
}

/* Dark mode popovers */
.dark-mode .popover {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

.dark-mode .popover-header {
    background-color: #404040 !important;
    border-bottom-color: #404040 !important;
    color: #ffffff !important;
}

.dark-mode .popover-body {
    color: #ffffff !important;
}

.dark-mode .popover .arrow::before {
    border-color: #404040 !important;
}

/* Dark mode code blocks */
.dark-mode pre {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

.dark-mode code {
    background-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Dark mode blockquotes */
.dark-mode blockquote {
    border-left-color: #4dabf7 !important;
    background-color: #2d2d2d !important;
}

/* Dark mode links */
.dark-mode a {
    color: #4dabf7 !important;
}

.dark-mode a:hover {
    color: #339af0 !important;
}

/* Dark mode selection */
.dark-mode ::selection {
    background-color: #4dabf7 !important;
    color: #ffffff !important;
}

.dark-mode ::-moz-selection {
    background-color: #4dabf7 !important;
    color: #ffffff !important;
} 

/* === FILTER BUTTONS (DARK MODE CLARITY IMPROVED) === */
.filter-btn {
    background: #fff;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    color: #888;
    font-weight: 600;
    padding: 10px 28px;
    margin-right: 16px;
    margin-bottom: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    min-width: 100px;
}
.filter-btn:last-child { margin-right: 0; }
/* Remove category-specific border/text colors for inactive state */
/* Active state: filled with accent, white text, no border */
.filter-btn.active, .filter-btn:active {
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 193, 154, 0.10);
}
.filter-btn.all.active, .filter-btn.stem.active {
    background: #00c19a;
}
.filter-btn.arts.active {
    background: #00bfff;
}
.filter-btn.languages.active {
    background: #ffc300;
}
.filter-btn.other.active {
    background: #adb5bd;
}
.filter-btn:hover, .filter-btn:focus {
    background: #f6f8fa;
    color: #888;
    box-shadow: none;
    border-color: #e5e7eb;
}

/* === SUBJECT CARDS === */
.subject-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--medium-gray);
    box-shadow: var(--box-shadow, 0 4px 15px rgba(0,0,0,0.05));
    padding: 30px 30px 24px 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 340px;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 0;
}
.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.10);
}
.subject-card .emoji-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-teal);
    line-height: 1;
}
.subject-card .card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.5rem;
}
.subject-card .card-text {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}
.card-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}
.start-learning-btn, .sparkle-overview-btn {
    background: var(--accent-teal);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}
.start-learning-btn:hover, .sparkle-overview-btn:hover {
    background: #009973;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 193, 154, 0.18);
}
.start-learning-btn svg, .sparkle-overview-btn svg {
    margin-left: 10px;
    fill: white;
}
.sparkle-overview-btn {
    background: #fff;
    color: var(--accent-teal);
    border: 2px solid var(--accent-teal);
    margin-top: 0;
}
.sparkle-overview-btn:hover {
    background: var(--accent-teal);
    color: #fff;
}

/* === PAGINATION (IMPROVED) === */
.pagination-nav-btn {
    background: #fff;
    border-radius: 999px !important;
    border: 2px solid #e5e7eb;
    color: #888;
    font-weight: 600;
    margin: 0 0.15rem;
    padding: 10px 18px;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s, border 0.15s;
    min-width: 48px;
    min-height: 44px;
    box-shadow: none;
}
.pagination-nav-btn:disabled, .pagination-nav-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.pagination-nav-btn:hover, .pagination-nav-btn:focus {
    background: #f1f3f4;
    color: #444;
    border-color: #e5e7eb;
}

.pagination-page-btn {
    background: #fff;
    border-radius: 999px !important;
    border: 2px solid var(--accent-teal);
    color: var(--accent-teal);
    font-weight: 600;
    margin: 0 0.15rem;
    padding: 10px 18px;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s, border 0.15s;
    min-width: 48px;
    min-height: 44px;
    box-shadow: none;
}
.pagination-page-btn.active, .pagination-page-btn:active {
    background: var(--accent-teal);
    color: #fff;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 193, 154, 0.15);
}
.pagination-page-btn:hover, .pagination-page-btn:focus {
    background: #f1f3f4;
    color: var(--accent-teal);
    border-color: var(--accent-teal);
}

/* Dark mode */
.dark-mode .pagination-nav-btn {
    background: #23272b;
    color: #e0e0e0;
    border-color: rgba(255,255,255,0.15);
}
.dark-mode .pagination-nav-btn:hover, .dark-mode .pagination-nav-btn:focus {
    background: #31363b;
    color: #fff;
    border-color: rgba(255,255,255,0.18);
}
.dark-mode .pagination-page-btn {
    background: #23272b;
    color: #00c19a;
    border-color: #00c19a;
}
.dark-mode .pagination-page-btn.active, .dark-mode .pagination-page-btn:active {
    background: #00c19a;
    color: #fff;
    border: none;
}
.dark-mode .pagination-page-btn:hover, .dark-mode .pagination-page-btn:focus {
    background: #31363b;
    color: #00c19a;
    border-color: #00c19a;
} 

/* Custom styles for Nexus Learning Platform */

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Utility classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Research interface specific styles */
.research-input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.research-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.analysis-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.topic-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.topic-card:hover {
    border-left-color: #3b82f6;
    transform: translateX(5px);
}

.relevance-badge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Progress indicators */
.progress-circle {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    stroke: #e5e7eb;
    stroke-width: 4;
    fill: none;
}

.progress-circle-fill {
    stroke: #3b82f6;
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s ease;
}

/* Loading states */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Floating elements */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Card hover effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: white;
    color: #3b82f6;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #3b82f6;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Enhanced Mobile Responsive Utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-text-center {
        text-align: center;
    }
    
    /* Mobile navigation improvements */
    .mobile-nav-item {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-nav-item:last-child {
        border-bottom: none;
    }
    
    /* Mobile card improvements */
    .subject-card {
        margin-bottom: 1rem;
        min-height: auto;
        padding: 1.5rem 1rem;
    }
    
    .subject-card .icon-container {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .subject-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .subject-card .card-text {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile grid improvements */
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    /* Mobile form improvements */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Mobile button improvements */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* Mobile modal improvements */
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    /* Mobile table improvements */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile text improvements */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
    h3 { font-size: 1.125rem !important; }
    h4 { font-size: 1rem !important; }
    
    /* Mobile spacing improvements */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile hero section improvements */
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    /* Mobile quick actions improvements */
    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Mobile content improvements */
    .content-section {
        padding: 1rem 0;
    }
    
    /* Mobile sidebar improvements */
    .sidebar-content {
        order: 2;
        margin-top: 1rem;
    }
    
    .main-content {
        order: 1;
    }
    
    /* Mobile chat improvements */
    .chat-container {
        flex-direction: column;
        height: calc(100vh - 200px);
    }
    
    .chat-sidebar {
        width: 100%;
        height: 40%;
        min-height: 200px;
    }
    
    .chat-main {
        width: 100%;
        height: 60%;
    }
    
    /* Mobile search improvements */
    .search-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input {
        width: 100%;
    }
    
    /* Mobile filter improvements */
    .filter-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Tablet responsive improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .subject-card {
        min-height: 280px;
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Large screen improvements */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode-auto .bg-white {
        background-color: #374151;
    }
    
    .dark-mode-auto .text-gray-900 {
        color: #f9fafb;
    }
    
    .dark-mode-auto .text-gray-600 {
        color: #d1d5db;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
} 

/* Line clamp utilities for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Refresh button animation */
#refreshVideosBtn:hover i {
    animation: spin 1s linear infinite;
}

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

/* Notification animations */
.notification-enter {
    transform: translateX(100%);
    opacity: 0;
}

.notification-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.notification-exit {
    transform: translateX(0);
    opacity: 1;
}

.notification-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
} 