:root {
    --primary-color: #5e72e4;
    --secondary-color: #8392ab;
    --success-color: #2dce89;
    --info-color: #11cdef;
    --warning-color: #fb6340;
    --danger-color: #f5365c;
    --light-color: #f8f9fa;
    --dark-color: #172b4d;
    --background-light: #f8f9fe;
    --background-dark: #1e2533; /* Updated from #1a202c for better viewing */
    --text-light: #525f7f;
    --text-dark: #ffffff; /* Updated from #e5e7eb to pure white for better visibility */
    --card-light: #ffffff;
    --card-dark: #2a3142; /* Updated from #2d3748 for better contrast */
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-light);
    transition: var(--transition);
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-dark); /* This now uses pure white */
}

.navbar {
    background-color: var(--card-light);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

body.dark-mode .navbar {
    background-color: var(--card-dark);
}

/* Ensure navbar text is visible in dark mode */
body.dark-mode .navbar-nav .nav-link {
    color: white;
}

.main-content {
    min-height: calc(100vh - 70px);
    padding-top: 2rem;
}

.card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    background-color: var(--card-light);
    height: 100%;
}

body.dark-mode .card {
    background-color: var(--card-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    background-image: linear-gradient(to bottom, #2a3142, #242b3d);
}

.feature-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.btn-sm{
    padding: 0.55rem;
    /* color: #000; */
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary {
    color: #070202;
    border-color: var(--primary-color);
}

.form-control {
    border-radius: 7px;
    padding: 0.75rem 1rem;
}

body.dark-mode .form-control {
    background-color: #303950;
    border-color: #4a5568;
    color: white; /* Updated from var(--text-dark) to explicitly use white */
}

/* New CSS for dark mode enhancements on form elements */
body.dark-mode .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6); /* Lighter color for placeholders */
}

body.dark-mode select.form-select {
    background-color: #303950;
    border-color: #4a5568;
    color: white;
}

body.dark-mode select.form-select option {
    background-color: #303950;
    color: white;
}

body.dark-mode .btn-outline-danger {
    color: white;
}

body.dark-mode .form-upload button {
    color: white;
}

body.dark-mode .input-group .btn-outline-secondary {
    color: white;
    border-color: #0d1014;
}

body.dark-mode .input-group .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #clear-storage-btn {
    color: #f5365c;
}

.hero-section {
    padding: 5rem 0;

    color: rgb(0, 0, 0);
    margin-bottom: 3rem;
}
.hero-section .btn-outline-light {
    border-color: #030303; 
    color: rgba(0, 0, 0, 0.5); 
    transition: var(--transition);
}
.hero-section .btn-outline-light:hover {
    background-color: white;
    color: rgb(8, 6, 6);
    animation: buttonPulse 0.3s ease, buttonGlow 0.5s ease;
    box-shadow: 0 0 10px rgba(228, 229, 235, 0.5);
}
.feature-section {
    padding: 4rem 0;
}

.section-title {
    margin-bottom: 2.5rem;
}

.login-card {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-sidebar {
    position: fixed;
    height: 100%;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    width: 250px;
    transition: var(--transition);
    background-color: var(--card-light);
    padding-top: 2rem;
}

body.dark-mode .dashboard-sidebar {
    background-color: var(--card-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-main {
    margin-left: 250px;
    padding: 2rem;
    transition: var(--transition);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

/* Improve sidebar text visibility */
body.dark-mode .sidebar-link {
    color: white; /* Updated from var(--text-dark) to white */
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(94, 114, 228, 0.1);
    color: var(--primary-color);
}

.sidebar-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
}

.user-message {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-top-right-radius: 0.25rem;
}

.bot-message {
    align-self: flex-start;
    background-color: #f1f1f1;
    color: #333;
    border-top-left-radius: 0.25rem;
}

body.dark-mode .bot-message {
    background-color: #4a5568;
    color: white; /* Updated from #f8f9fe to white */
}

.chat-input {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

.flashcard {
    perspective: 1000px;
    height: 200px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 1rem;
}

.flashcard-front {
    background-color: #5e72e4;
    color: white;
}

.flashcard-back {
    background-color: #f8f9fa;
    color: #333;
    transform: rotateY(180deg);
}

body.dark-mode .flashcard-back {
    background-color: #4a5568;
    color: white; /* Updated from #f8f9fe to white */
}

.quiz-question {
    margin-bottom: 2rem;
}

.quiz-option {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background-color: rgba(94, 114, 228, 0.1);
}

.quiz-option.selected {
    background-color: var(--primary-color);
    color: white;
}

body.dark-mode .quiz-option {
    border-color: #4a5568;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

    .dashboard-sidebar.show {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }
}

.mobile-toggle {
    display: none;
}

@media (max-width: 992px) {
    .mobile-toggle {
        display: block;
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 1001;
        cursor: pointer;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.show {
    display: block;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(94, 114, 228, 0.25);
    border-right-color: var(--primary-color);
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.form-upload {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.form-upload:hover {
    border-color: var(--primary-color);
}

body.dark-mode .form-upload {
    border-color: #4a5568;
}

body.dark-mode .form-upload:hover {
    border-color: var(--primary-color);
}

.settings-toggle {
    width: 60px;
    height: 30px;
    background-color: #e9ecef;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.settings-toggle.active {
    background-color: var(--primary-color);
}

.toggle-handle {
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.settings-toggle.active .toggle-handle {
    left: 32px;
}

/* Dark Mode Enhancements */
body.dark-mode .card {
    background-color: var(--card-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    background-image: linear-gradient(to bottom, #2a3142, #242b3d);
}

body.dark-mode .sidebar-link:hover, 
body.dark-mode .sidebar-link.active {
    background-color: rgba(94, 114, 228, 0.2); /* More visible in dark mode */
    color: #8ab4f8; /* Brighter color for active links */
}

body.dark-mode .card {
    color: white;
}

body.dark-mode .feature-icon {
    color: var(--primary-color);
}

body.dark-mode .login-card a {
    color: #8ab4f8; /* Brighter blue for dark mode */
    text-decoration: none;
}

body.dark-mode .login-card a:hover {
    text-decoration: underline;
}

body.dark-mode .form-label {
    color: #e5e7eb;
}

.bi-sun-fill{
    color: white;
}
.bi-sun-fill:hover{
    color: #e5e7eb;
}

.navbar-nav .nav-link {
    position: relative;
    display: inline-block;
    overflow: hidden;
    padding-bottom: 4px;
    transition: color 0.3s ease;
  }
  
  .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
  }
  
  .navbar-nav .nav-link:hover::after {
    width: 100%;
  }