/* Variables */
:root {
  --gradient-start: #2c3e50;
  --gradient-end: #3498db;
  --primary-color: #007bff;
  --chat-bg: #f8f9fa;
  --card-bg: #ffffff; /* Changed from dark to light for default */
  --text-color: #212529; /* Changed from light to dark for default */
  --bg-color: #f8f9fa;
}

/* Dark Mode Styles */
html.dark-mode,
html.dark-mode body {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

html.dark-mode .hero-section {
  background: linear-gradient(135deg, #121212, #333333) !important;
}

html.dark-mode .card {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

html.dark-mode footer {
  background-color: #1e1e1e !important;
}

html.dark-mode .btn-outline-light {
  color: #e0e0e0 !important;
  border-color: #e0e0e0 !important;
}

html.dark-mode .btn-outline-light:hover {
  background-color: #e0e0e0 !important;
  color: #121212 !important;
}

html.dark-mode .navbar {
  background-color: #1e1e1e !important;
}

html.dark-mode .alert {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #333 !important;
}

/* Page pre-loader style */
#dark-mode-init {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #121212;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

html.dark-mode-initializing #dark-mode-init {
  opacity: 1;
  visibility: visible;
}

/* Global Styles */
body {
  background-color: #f8f9fa; /* Change background to light color for light mode */
  min-height: 100vh;
  position: relative;
}

body.dark-mode {
  background-color: #121212; /* Change background to dark color for dark mode */
  color: #e0e0e0;
}

body.dark-mode .card {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode .btn {
  background-color: #333333;
  color: #e0e0e0;
}

body.dark-mode .btn-outline-primary {
  border-color: #e0e0e0;
  color: #e0e0e0;
}

body.dark-mode .btn-outline-primary:hover {
  background-color: #e0e0e0;
  color: #333333;
}

body.dark-mode .progress-bar {
  background-color: #e0e0e0;
}

body.dark-mode .chat-sidebar {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode .chat-header {
  background-color: #444444; /* Change header color in dark mode */
}

body.dark-mode .chat-input {
  background-color: #333333; /* Match the background color in dark mode */
  padding: 0.75rem; /* Adjust padding to match light mode */
}

body.dark-mode .chat-input .btn-primary {
  background-color: #e0e0e0;
  color: #333333;
}

body.dark-mode .category-header {
  color: #e0e0e0;
}

body.dark-mode .category-header h2,
body.dark-mode .category-header p {
  color: #e0e0e0;
}

body.dark-mode .progress-container h4 {
  color: #e0e0e0;
}

body.dark-mode .card-title {
  color: #e0e0e0;
}

body.dark-mode .score-text {
  color: #e0e0e0;
}

body.dark-mode footer {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode footer a {
  color: #e0e0e0;
}

/* Blur effect for background when specific modals are open */
.modal-open.blur-background .quiz-container:not(.no-blur) {
  filter: blur(5px);
}

/* Never apply blur to mobile chat modal */
body.modal-open:has(#mobileChatModal.show) .quiz-container {
  filter: none !important; /* Use !important to override all other blur effects */
}

body.dark-mode .explanation-modal {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

/* Ensure chat box appears closed when blur effect is applied */
.modal-open.blur-background .chat-sidebar {
  right: -400px;
  display: none; /* Ensure chat box is hidden */
}

/* Hero Section - Enhanced with Image */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  padding: 60px 0;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

/* Hero container layout */
.hero-section .container {
  position: relative;
  z-index: 2;
}

/* Hero text styles */
.hero-section .hero-text {
  text-align: left;
  padding-right: 20px;
}

/* Hero image container - Enhanced */
.hero-section .hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
  position: relative;
}

.hero-section .hero-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.hero-section .hero-image:hover::after {
  opacity: 1;
}

.hero-section .hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  object-fit: cover;
  max-height: 350px;
}

.hero-section h1,
.hero-section .display-4 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.hero-section p,
.hero-section .lead {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Dark Mode - Hero Section */
body.dark-mode .hero-section {
  background: linear-gradient(135deg, #121212, #333333);
}

body.dark-mode .hero-section h1,
body.dark-mode .hero-section p,
body.dark-mode .hero-section .display-4,
body.dark-mode .hero-section .lead {
  color: var(--text-color);
}

body.dark-mode .hero-section .btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 40px 0;
  }

  .hero-section .display-4 {
    font-size: 2rem;
  }

  .hero-section .lead {
    font-size: 1.1rem;
  }

  .hero-text {
    margin-bottom: 30px;
    text-align: center;
  }
}

body.dark-mode:root {
  --gradient-start: #121212;
  --gradient-end: #333333;
  --primary-color: #0d6efd;
}

/* Make sure hero text is visible in dark mode */
body.dark-mode .hero-section h1,
body.dark-mode .hero-section p {
  color: var(--text-color);
}

/* Additional styling for the hero elements in dark mode */
body.dark-mode .hero-section .btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

/* Dark mode for category cards */
body.dark-mode .category-card {
  background-color: #1e1e1e;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .category-card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

/* Fix category card content colors in dark mode */
body.dark-mode .category-card .card-body {
  background-color: #1e1e1e;
}

body.dark-mode .category-card .category-icon {
  background-color: #333333 !important;
  color: var(--text-color) !important;
}

body.dark-mode .category-card i.fas,
body.dark-mode .category-card i.fa,
body.dark-mode .category-card i.fab {
  color: var(--text-color) !important;
}

/* Fix text colors in category cards */
body.dark-mode .category-card h1,
body.dark-mode .category-card h2,
body.dark-mode .category-card h3,
body.dark-mode .category-card h4,
body.dark-mode .category-card h5,
body.dark-mode .category-card h6,
body.dark-mode .category-card p,
body.dark-mode .category-card span,
body.dark-mode .category-card div,
body.dark-mode .category-card a {
  color: var(--text-color) !important;
}

/* Fix any blue text elements */
body.dark-mode .category-card .text-primary,
body.dark-mode .category-card .text-info,
body.dark-mode .category-card .text-blue {
  color: #a0c4ff !important; /* Light blue for dark mode */
}

/* Fix any dark/black text */
body.dark-mode .category-card .text-dark,
body.dark-mode .category-card .text-black,
body.dark-mode .category-card .text-body {
  color: var(--text-color) !important;
}

body.dark-mode .category-card .btn-primary,
body.dark-mode .category-card .bg-primary {
  background-color: #444444 !important;
  border-color: #444444 !important;
}

/* Category Cards */
.category-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--text-color);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Quiz Container */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.quiz-card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.category-icon-large {
  width: 140px;
  height: 120px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background-color: white; /* Ensure the subject image is white in normal mode */
  color: white; /* Ensure the icon color is black in light mode */

  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

body.dark-mode .category-icon-large {
  background-color: #333333;
  color: white; /* Ensure the icon color is white in dark mode */
}

.option-btn {
  transition: all 0.3s ease;
  border-radius: 10px;
  font-size: 1.1rem;
  padding: 15px;
}

.option-btn:hover:not(.disabled) {
  transform: translateX(10px);
}

.option-btn.correct {
  background-color: #28a745 !important;
  color: white !important;
  border-color: #28a745 !important;
}

.option-btn.incorrect {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

.option-btn.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Explanation Modal */
.explanation-modal {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 400px;
  width: 90%;
  animation: slideIn 0.3s ease;
  color: var(--text-color);
}

body.dark-mode .explanation-modal {
  background-color: var(--card-bg);
  color: var(--text-color);
}

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

.explanation-content {
  margin-bottom: 15px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Updated Explanation Styles */
.explanation-section {
  margin-top: 1.5rem;
  transition: all 0.3s ease;
}

.explanation-toggle {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.explanation-toggle:hover {
  background-color: var(--primary-color);
  color: white;
}

.explanation-content {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

body.dark-mode .explanation-content {
  background-color: var(--card-bg);
  color: var(--text-color);
  border-color: #444 !important;
}

body.dark-mode .explanation-toggle {
  border-color: #444;
  color: var(--text-color);
}

body.dark-mode .explanation-toggle:hover {
  background-color: #444;
  color: #fff;
}

/* Progress Modal */
.progress-modal {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  color: var(--text-color);
}

.progress-modal h3 {
  margin-bottom: 20px;
  color: var(--gradient-start);
}

.progress-options {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* Chat Assistant */
.chat-widget {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.chat-button:hover {
  transform: scale(1.1);
}

/* Mobile Chat Sidebar - FIXED */
.chat-sidebar {
  position: fixed;
  right: -100%;
  top: 0;
  width: 100%;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  cursor: default;
  overflow: hidden;
  color: var(--text-color);
}

/* Desktop Chat Sidebar */
@media (min-width: 768px) {
  .chat-sidebar {
    right: -400px;
    width: 400px;
    min-width: 300px;
    max-width: 90vw;
  }
}

.chat-sidebar.resizing {
  transition: none;
}

.resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
  cursor: ew-resize;
  background-color: transparent;
  display: none;
}

/* Show resize handle only on desktop */
@media (min-width: 768px) {
  .resize-handle {
    display: block;
  }
}

body.dark-mode .chat-sidebar {
  background-color: var(--card-bg);
  color: var(--text-color);
}

.chat-sidebar.open {
  right: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary-color);
  padding: 1rem;
  color: white;
}

body.dark-mode .chat-header {
  background-color: #444444;
}

.chat-header .btn-close {
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: 4px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header .btn-close:hover {
  opacity: 1;
}

.chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
}

.message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 10px;
  max-width: 80%;
}

.message .message-content {
  word-wrap: break-word;
}

.message .message-time {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.5);
  text-align: right;
  margin-top: 5px;
}

.user-message {
  background: var(--primary-color);
  color: white;
  margin-left: auto;
}

.user-message .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.ai-message {
  background: var(--chat-bg);
  color: #333;
  margin-right: auto;
}

/* Styling for the thinking indicator */
.ai-message.loading {
  background: rgba(200, 200, 200, 0.3);
  color: #555;
}

body.dark-mode .ai-message.loading {
  background: rgba(60, 60, 60, 0.3);
  color: #bbb;
}

.chat-input {
  background: var(--card-bg);
  padding: 1rem;
  border-top: 1px solid #dee2e6;
}

body.dark-mode .chat-input {
  background-color: var(--card-bg);
  border-top-color: #444;
}

body.dark-mode .chat-input .btn-primary {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* Mobile Chat Widget */
.chat-widget-mobile {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.chat-widget-mobile .chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.chat-widget-mobile .chat-button:hover {
  transform: scale(1.1);
}

/* Mobile Chat Modal Styles */
.mobile-chat-messages {
  background: var(--chat-bg);
  padding: 1rem;
  height: calc(100vh - 170px) !important; /* Adjust height for better display */
  overflow-y: auto;
}

body.dark-mode .mobile-chat-messages {
  background-color: #2a2a2a;
}

.mobile-chat-messages .message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
}

.mobile-chat-messages .message .message-time {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.5);
  text-align: right;
  margin-top: 5px;
}

.mobile-chat-messages .user-message {
  background: var(--primary-color);
  color: white;
  margin-left: auto;
  text-align: right;
}

.mobile-chat-messages .user-message .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.mobile-chat-messages .ai-message {
  background: #e9ecef;
  color: #333;
  margin-right: auto;
}

/* Styling for the thinking indicator in mobile */
.mobile-chat-messages .ai-message.loading {
  background: rgba(200, 200, 200, 0.3);
  color: #555;
}

body.dark-mode .mobile-chat-messages {
  background-color: #2a2a2a;
}

body.dark-mode .mobile-chat-messages .ai-message {
  background-color: #444;
  color: #e0e0e0;
}

/* Quit Quiz Modal Styles */
.modal-header {
  border-bottom: 1px solid #dee2e6;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
}

/* Mobile Chat Modal Styles */
#mobileChatModal .modal-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}

#mobileChatModal .modal-body {
  background-color: var(--chat-bg);
  flex: none !important; /* Override Bootstrap's flex: 1 1 auto */
  padding: 0 !important; /* Remove padding to eliminate white space */
}

#mobileChatModal .modal-header.bg-primary {
  background-color: var(--primary-color) !important;
}

body.dark-mode #mobileChatModal .modal-header.bg-primary {
  background-color: #444444 !important;
}

body.dark-mode .modal-content {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

/* Premium Alert Styles */
.alert.position-fixed {
  animation: slideInRight 0.3s ease;
}

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

/* Chat Input */
.chat-input .form-control {
  transition: none;
  box-shadow: none;
}

.chat-input .form-control:hover,
.chat-input .form-control:focus,
.chat-input .form-control:active {
  box-shadow: none;
  border-color: #ced4da;
  outline: none;
  transition: none;
  transform: none;
}

.chat-input .form-control:focus {
  border-color: var(--primary-color);
}

body.dark-mode .chat-input .form-control {
  background-color: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .chat-input .form-control:hover,
body.dark-mode .chat-input .form-control:focus,
body.dark-mode .chat-input .form-control:active {
  border-color: #444;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: #333333;
  margin-top: auto;
  padding: 1.5rem 0; /* Add more padding */
  border-top: 1px solid #dee2e6; /* Add a border to separate it from content */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); /* Add subtle shadow for depth */
}

footer a {
  color: #333333;
  transition: opacity 0.3s ease;
}

footer a:hover {
  color: var(
    --primary-color
  ); /* Change color on hover for better interaction */
  opacity: 1;
}

body.dark-mode footer {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-top-color: #444; /* Darker border for dark mode */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); /* Adjusted shadow for dark mode */
}

/* Animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .quiz-container {
    margin: 1rem;
  }

  .hero-section {
    padding: 40px 0;
  }

  .explanation-modal {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .category-icon-large {
    width: 100px;
    height: 100px;
  }

  .option-btn {
    font-size: 1rem;
    padding: 10px;
  }

  .chat-input .form-control {
    font-size: 0.9rem;
  }

  .chat-input .btn-primary {
    font-size: 0.9rem;
  }

  .score-text {
    font-size: 1.2rem;
  }

  .progress-container h4 {
    font-size: 1.2rem;
  }

  .category-header h2 {
    font-size: 1.5rem;
  }

  .navbar .dropdown .btn-outline-light.dropdown-toggle {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.4rem 0.75rem;
    display: block;
    text-align: center;
  }

  /* Make sure dropdown container takes full width */
  .navbar .dropdown {
    width: 100%;
    display: block;
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
  .quiz-container {
    margin: 0.5rem;
    padding: 10px;
  }

  .hero-section {
    padding: 30px 0;
  }

  .explanation-modal {
    top: 5px;
    right: 5px;
    left: 5px;
    width: auto;
  }

  .category-icon-large {
    width: 60px;
    height: 60px;
  }

  .category-icon-large i {
    font-size: 1.5rem !important;
  }

  .option-btn {
    font-size: 0.9rem;
    padding: 8px;
  }

  .chat-input .form-control {
    font-size: 0.8rem;
  }

  .chat-input .btn-primary {
    font-size: 0.8rem;
  }

  .score-text {
    font-size: 1.1rem;
  }

  .progress-container h4 {
    font-size: 1.1rem;
  }

  .category-header h2 {
    font-size: 1.3rem;
  }

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

  .stats-container {
    padding: 10px;
  }

  /* Navbar improvements for mobile */
  .navbar-collapse {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.5rem;
  }

  .navbar-nav .nav-link,
  .navbar .btn {
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
  }

  .dropdown-menu {
    width: 100%;
    text-align: center;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .quiz-container {
    margin: 1rem;
    padding: 15px;
  }

  .hero-section {
    padding: 40px 0;
  }

  .explanation-modal {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .category-icon-large {
    width: 100px;
    height: 100px;
  }

  .option-btn {
    font-size: 1rem;
    padding: 10px;
  }

  .chat-input .form-control {
    font-size: 0.9rem;
  }

  .chat-input .btn-primary {
    font-size: 0.9rem;
  }

  .score-text {
    font-size: 1.2rem;
  }

  .progress-container h4 {
    font-size: 1.2rem;
  }

  .category-header h2 {
    font-size: 1.5rem;
  }

  .navbar .dropdown .btn-outline-light.dropdown-toggle {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.4rem 0.75rem;
    display: block;
    text-align: center;
  }

  /* Make sure dropdown container takes full width */
  .navbar .dropdown {
    width: 100%;
    display: block;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .quiz-container {
    margin: 1rem;
    padding: 20px;
  }

  .hero-section {
    padding: 50px 0;
  }

  .explanation-modal {
    top: 15px;
    right: 15px;
    left: auto;
    width: auto;
  }

  .category-icon-large {
    width: 120px;
    height: 120px;
  }

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

  .chat-input .form-control {
    font-size: 1rem;
  }

  .chat-input .btn-primary {
    font-size: 1rem;
  }

  .score-text {
    font-size: 1.3rem;
  }

  .progress-container h4 {
    font-size: 1.3rem;
  }

  .category-header h2 {
    font-size: 1.7rem;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .quiz-container {
    margin: 2rem;
    padding: 25px;
  }

  .hero-section {
    padding: 60px 0;
  }

  .explanation-modal {
    top: 20px;
    right: 20px;
    left: auto;
    width: auto;
  }

  .option-btn {
    font-size: 1.1rem;
    padding: 15px;
  }

  .chat-input .form-control {
    font-size: 1.1rem;
  }

  .chat-input .btn-primary {
    font-size: 1.1rem;
  }

  .score-text {
    font-size: 1.4rem;
  }

  .progress-container h4 {
    font-size: 1.4rem;
  }

  .category-header h2 {
    font-size: 1.8rem;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .quiz-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 30px;
  }

  .hero-section {
    padding: 80px 0;
  }

  .explanation-modal {
    top: 20px;
    right: 20px;
    left: auto;
    width: auto;
  }

  .option-btn {
    font-size: 1.2rem;
    padding: 15px;
  }

  .chat-input .form-control {
    font-size: 1.2rem;
  }

  .chat-input .btn-primary {
    font-size: 1.2rem;
  }

  .score-text {
    font-size: 1.5rem;
  }

  .progress-container h4 {
    font-size: 1.5rem;
  }

  .category-header h2 {
    font-size: 2rem;
  }
}

/* Enhanced Responsive Design */
/* Base mobile-first styles */
.quiz-container {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  margin: 0;
}

.category-icon-large {
  width: 80px;
  height: 80px;
}

.option-btn {
  font-size: 0.9rem;
  padding: 12px;
  margin-bottom: 8px;
}

.chat-button {
  width: 50px;
  height: 50px;
}

/* Small devices (landscape phones) */
@media (min-width: 576px) {
  .quiz-container {
    padding: 15px;
    max-width: 540px;
    margin: 0 auto;
  }

  .category-icon-large {
    width: 100px;
    height: 100px;
  }

  .option-btn {
    font-size: 1rem;
    padding: 12px 15px;
  }
}

/* Medium devices (tablets) */
@media (min-width: 768px) {
  .quiz-container {
    max-width: 720px;
    padding: 20px;
  }

  .category-icon-large {
    width: 120px;
    height: 120px;
  }

  .option-btn {
    font-size: 1.1rem;
    padding: 15px 20px;
  }
}

/* Large devices (desktops) */
@media (min-width: 992px) {
  .quiz-container {
    max-width: 960px;
    padding: 30px;
  }

  .category-icon-large {
    width: 140px;
    height: 140px;
  }
}

/* Extra large devices */
@media (min-width: 1200px) {
  .quiz-container {
    max-width: 1140px;
  }
}

/* Responsive font sizes */
@media (max-width: 576px) {
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }
  h4 {
    font-size: 1.1rem;
  }
  .stat-number {
    font-size: 1.75rem;
  }
}

/* Responsive spacing */
@media (max-width: 576px) {
  .mt-5 {
    margin-top: 2rem !important;
  }
  .mb-4 {
    margin-bottom: 1.5rem !important;
  }
  .p-3 {
    padding: 0.75rem !important;
  }
}

/* Touch-friendly elements for mobile */
@media (hover: none) {
  .option-btn:hover:not(.disabled) {
    transform: none;
  }

  .option-btn:active:not(.disabled) {
    transform: scale(0.98);
  }
}

/* Fix for small height screens */
@media (max-height: 600px) {
  .category-icon-large {
    width: 60px;
    height: 60px;
  }

  .quiz-container {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

body.dark-mode .card {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode .btn {
  background-color: #333333;
  color: #e0e0e0;
}

body.dark-mode .btn-outline-primary {
  border-color: #e0e0e0;
  color: #e0e0e0;
}

body.dark-mode .btn-outline-primary:hover {
  background-color: #e0e0e0;
  color: #333333;
}

body.dark-mode .progress-bar {
  background-color: #e0e0e0;
}

body.dark-mode .category-header h2,
body.dark-mode .category-header p {
  color: #e0e0e0;
}

body.dark-mode .progress-container h4 {
  color: #e0e0e0;
}

body.dark-mode .card-title {
  color: #e0e0e0;
}

body.dark-mode .score-text {
  color: #e0e0e0;
}

body.dark-mode footer {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode footer a {
  color: #e0e0e0;
}

/* Blur effect for specific modals only, excluding the quit and chat modals */
.modal-open .quiz-container:not(.no-blur) {
  filter: blur(5px);
}

/* Disable blur effect for quit confirmation modal and mobile chat modal */
.modal-backdrop + .modal-open .quiz-container,
body.modal-open:has(#mobileChatModal.show) .quiz-container {
  filter: none;
}

body.dark-mode .category-header {
  color: #e0e0e0;
}

/* Navbar Styles */
.navbar {
  background-color: var(--primary-color);
  padding: 1rem;
}

body.dark-mode .navbar {
  background-color: #333333;
  color: var(--text-color);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.4rem;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link.active {
  color: white;
  font-weight: 600;
}

/* Dropdown styles for user menu */
.dropdown-menu {
  border-radius: 10px;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
}

body.dark-mode .dropdown-menu {
  background-color: #2a2a2a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
  padding: 0.75rem 1rem;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

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

body.dark-mode .dropdown-item:hover {
  background-color: #3a3a3a;
  color: #fff;
}

/* Remove blue outline on button focus */
button:focus,
button:active {
  outline: none;
  box-shadow: none;
}

body.dark-mode .btn:focus,
body.dark-mode .btn:active {
  outline: none;
  box-shadow: none;
}

.d-grid.gap-2.d-md-block {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.d-grid.gap-2.d-md-block .btn {
  margin: 0.5rem;
  min-width: 140px;
}

/* Stats Styles */
.stats-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.stat-card {
  transition: transform 0.3s ease;
  margin-bottom: 1rem;
  height: 100%;
}

.stat-card .card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

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

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0;
}

body.dark-mode .stat-number {
  color: var(--text-color);
}

.progress-history .list-group-item {
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.125);
  margin-bottom: 0.5rem;
}

body.dark-mode .progress-history .list-group-item {
  background-color: var(--card-bg);
  border-color: #333;
  color: var(--text-color) !important; /* Ensure text is white in dark mode */
}

.progress-history .list-group-item:hover {
  transform: translateX(10px);
}

.modal {
  background-color: rgba(0, 0, 0, 0.5);
}

body.dark-mode .modal-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}

body.dark-mode .modal-header {
  border-bottom-color: #333;
}

body.dark-mode .modal-footer {
  border-top-color: #333;
}

/* Custom Quiz Section Styles */
.custom-quiz-section {
  background-color: #f0f7ff;
  border-radius: 15px;
  margin: 2rem 0;
  padding: 2rem 0;
}

body.dark-mode .custom-quiz-section {
  background-color: #1a2430;
}

.custom-quiz-section .category-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.custom-quiz-section .category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.custom-quiz-section .category-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.dark-mode .custom-quiz-section .category-card {
  background-color: #1e1e1e;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .custom-quiz-section .category-card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .custom-quiz-section .category-card .card-title,
body.dark-mode .custom-quiz-section .category-card .card-text {
  color: var(--text-color);
}

body.dark-mode .custom-quiz-section h2,
body.dark-mode .custom-quiz-section .lead {
  color: var(--text-color);
}

/* Featured Quizzes Section */
.bg-light {
  background-color: #f8f9fa;
  padding: 2rem 0;
  border-radius: 0;
}

body.dark-mode .bg-light {
  background-color: #1a2430;
}

/* Navbar Responsive Styles */
.navbar {
  background-color: var(--primary-color);
  padding: 0.75rem 1rem;
  transition: padding 0.3s ease;
}

.navbar-brand {
  font-weight: 600;
  font-size: clamp(1.2rem, 4vw, 1.4rem); /* Responsive font size */
}

.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.1rem rgba(255, 255, 255, 0.25);
}

/* Footer Styles */
footer {
  background-color: #f0f2f5; /* Light background for light mode */
  color: #333333;
  margin-top: auto;
  padding: clamp(1rem, 3vw, 1.5rem) 0; /* Responsive padding */
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
}

footer p {
  margin-bottom: 0.5rem;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

footer .social-icons {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  margin-top: 0.5rem;
}

footer a {
  color: #333333;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

footer a:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

body.dark-mode footer {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-top-color: #444;
}

/* Responsive Typography */
html {
  font-size: 16px; /* Base font size */
}

@media (max-width: 576px) {
  html {
    font-size: 15px;
  }

  h1,
  .h1 {
    font-size: 1.75rem; /* ~28px on mobile */
  }

  h2,
  .h2 {
    font-size: 1.5rem; /* ~24px on mobile */
  }

  h3,
  .h3 {
    font-size: 1.25rem; /* ~20px on mobile */
  }

  .display-4 {
    font-size: 2rem !important;
    font-weight: 600;
  }

  .lead {
    font-size: 1.05rem !important;
    line-height: 1.5;
  }

  .hero-section {
    padding: 2rem 0 !important;
    text-align: center;
  }

  .navbar .btn {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.4rem 0.75rem;
  }

  /* Footer adjustments for very small screens */
  footer .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Adjust container padding on various screen sizes */
@media (max-width: 768px) {
  .container {
    padding-left: clamp(0.75rem, 4vw, 1.5rem);
    padding-right: clamp(0.75rem, 4vw, 1.5rem);
  }

  /* Make buttons easier to tap on mobile */
  .btn {
    padding: 0.5rem 0.75rem;
    min-height: 44px; /* Minimum recommended touch target size */
  }

  /* Category cards layout for mobile */
  .card {
    margin-bottom: 1rem;
  }

  /* Better button layout on mobile */
  .d-grid.gap-2.d-md-block .btn {
    margin: 0.25rem;
  }

  .navbar .dropdown .btn-outline-light.dropdown-toggle {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.4rem 0.75rem;
    display: block;
    text-align: center;
  }

  /* Make sure dropdown container takes full width */
  .navbar .dropdown {
    width: 100%;
    display: block;
  }
}

/* Touch-friendly improvements */
@media (hover: none) {
  /* Larger tap targets for touch devices */
  .btn,
  a.btn,
  button,
  .navbar-toggler,
  .category-card a,
  footer a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Disable hover effects that don't work well on touch */
  .category-card:hover {
    transform: none;
  }

  .option-btn:hover:not(.disabled) {
    transform: none;
  }

  /* Add active/pressed state instead */
  .category-card:active {
    transform: scale(0.98);
  }

  .option-btn:active:not(.disabled) {
    transform: translateX(5px);
  }
}

/* Fix color contrast and visibility issues */
.text-white {
  color: #ffffff !important;
}

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

/* Ensure footer text is readable in both modes */
footer.text-white {
  color: #212529 !important; /* Dark text on light background */
}

body.dark-mode footer.text-white {
  color: #e0e0e0 !important; /* Light text on dark background */
}

footer a.text-white {
  color: #333 !important;
}

body.dark-mode footer a.text-white {
  color: #e0e0e0 !important;
}
.stats-heading .dark-mode {
  color: #e0e0e0 !important;
}

/* Mobile-first responsive improvements */
@media (max-width: 480px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .quiz-container {
    padding: 0.5rem;
    margin: 0.25rem;
  }

  .card {
    border-radius: 10px;
  }

  .option-btn {
    font-size: 0.85rem;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
  }

  .category-icon-large {
    width: 60px;
    height: 60px;
  }

  .auth-card {
    margin: 0.25rem;
    padding: 1rem;
  }

  .navbar-collapse {
    margin-top: 0.25rem;
    padding: 0.75rem;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: 1rem 0;
  }

  .quiz-container {
    padding: 0.5rem;
  }

  .category-icon-large {
    width: 50px;
    height: 50px;
  }

  .auth-card {
    padding: 0.75rem;
  }

  .auth-logo {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }

  .card {
    border-width: 2px;
  }

  .option-btn {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .option-btn:hover:not(.disabled) {
    transform: none;
  }

  .category-card:hover {
    transform: none;
  }
}

/* Subscription Modal Styles */
.subscription-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.subscription-content {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  color: var(--text-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.subscription-content h3 {
  color: #007bff;
  margin-bottom: 1rem;
}

.subscription-features {
  text-align: left;
  margin: 1.5rem 0;
}

.subscription-features li {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.subscription-features i {
  color: #28a745;
  margin-right: 0.5rem;
}

.payment-options {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: center;
}

.payment-btn {
  flex: 1;
  padding: 1rem;
  border: 2px solid #007bff;
  border-radius: 10px;
  background: transparent;
  color: #007bff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-btn:hover {
  background: #007bff;
  color: white;
}

.payment-btn.selected {
  background: #007bff;
  color: white;
}

body.dark-mode .subscription-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}

body.dark-mode .payment-btn {
  border-color: #0d6efd;
  color: #0d6efd;
}

body.dark-mode .payment-btn:hover,
body.dark-mode .payment-btn.selected {
  background: #0d6efd;
  color: white;
}

/* Quiz Limit Warning */
.quiz-limit-warning {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  text-align: center;
}

.quiz-limit-warning h5 {
  margin-bottom: 0.5rem;
}

.quiz-limit-warning p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Premium Badge */
.premium-badge {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #333;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-block;
  margin-left: 0.5rem;
}

/* Disabled Quiz Card */
.quiz-disabled {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.quiz-disabled::after {
  content: "🔒 Premium Only";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  z-index: 10;
}

/* Quit Quiz Modal */
.quit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.quit-content {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  color: var(--text-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.quit-content h4 {
  color: #dc3545;
  margin-bottom: 1rem;
}

.quit-content p {
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.quit-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

body.dark-mode .quit-content {
  background-color: var(--card-bg);
  color: var(--text-color);
}

/* Mobile responsiveness for modals */
@media (max-width: 576px) {
  .subscription-content,
  .quit-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .payment-options {
    flex-direction: column;
  }

  .quit-buttons {
    flex-direction: column;
  }

  .quit-buttons .btn {
    width: 100%;
  }
}

/* Fix for mobile chat modal to avoid white blocks */
#mobileChatModal .modal-dialog {
  margin: 0;
  max-width: 100%;
  height: 100%;
}

#mobileChatModal .modal-dialog.modal-fullscreen-sm-down {
  width: 100%;
}

@media (max-width: 576px) {
  #mobileChatModal .modal-dialog {
    height: 100vh;
  }

  #mobileChatModal .modal-content {
    height: 100vh;
    border-radius: 0;
    border: none;
  }
}

/* Copy button styles for AI chat */
.message-content {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  visibility: hidden; /* Hide by default, show on hover */
}

.message-content:hover .copy-button {
  visibility: visible;
}

.copy-button:hover {
  opacity: 1;
}

.copy-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  top: -25px;
  right: 0;
  white-space: nowrap;
}

/* Dark mode styling for copy button */
html.dark-mode .copy-button {
  color: #adb5bd;
}

/* Make sure AI messages have padding for the button */
.ai-message .message-content {
  padding-right: 2rem;
}

/* For mobile, adjust the button size and position */
@media (max-width: 576px) {
  .copy-button {
    font-size: 0.7rem;
    top: 0.3rem;
    right: 0.3rem;
  }
}

/* Loading overlay for async operations */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

.loading-message {
  color: #fff;
  font-size: 18px;
  margin-top: 15px;
  text-align: center;
}

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

/* Dark mode for loading overlay */
html.dark-mode .loading-overlay {
  background-color: rgba(0, 0, 0, 0.8);
}

html.dark-mode .loading-message {
  color: #e0e0e0;
}

/* Go to Question Styles */
.go-to-question-container {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out 0.3s forwards;
}

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

.go-to-question-container .card {
  border-radius: 15px;
  transition: all 0.3s ease;
}

.go-to-question-container .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15) !important;
}

.go-to-question-container .input-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.go-to-question-container .input-group-text {
  border: none;
  font-weight: 600;
  padding: 12px 15px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.go-to-question-container .form-control {
  border: none;
  padding: 12px 15px;
  font-size: 16px;
  font-weight: 500;
  background-color: #ffffff;
  transition: all 0.3s ease;
}

.go-to-question-container .form-control:focus {
  outline: none;
  box-shadow: none;
  background-color: #f8f9fa;
}

.go-to-question-container .form-control::placeholder {
  color: #6c757d;
  font-weight: 400;
}

.go-to-question-container .btn {
  border: none;
  padding: 12px 20px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  transition: all 0.3s ease;
}

.go-to-question-container .btn:hover {
  background: linear-gradient(135deg, #0056b3 0%, var(--primary-color) 100%);
  transform: scale(1.05);
}

.go-to-question-container .btn:active {
  transform: scale(0.98);
}

.go-to-question-container small {
  font-size: 0.85rem;
  font-weight: 500;
  background: none !important;
  margin: 0 !important;
}

/* Default light mode - transparent background */
html .go-to-question-container small {
  background-color: transparent !important;
}

/* Dark mode specific styling */
html.dark-mode .go-to-question-container small {
  background-color: #121212 !important;
}




/* Dark mode for Go to Question */
html.dark-mode .go-to-question-container .card {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  border-color: #404040;
}

html.dark-mode .go-to-question-container .form-control {
  background-color: #2d2d2d;
  color: #e0e0e0;
  border-color: #404040;
}

html.dark-mode .go-to-question-container .form-control:focus {
  background-color: #333333;
  color: #e0e0e0;
}

html.dark-mode .go-to-question-container .form-control::placeholder {
  color: #888;
}

html.dark-mode .go-to-question-container small {
  color: #aaa;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
  .go-to-question-container .col-12 {
    padding: 0 15px;
  }

  .go-to-question-container .card-body {
    padding: 20px 15px;
  }

  .go-to-question-container .input-group-text,
  .go-to-question-container .form-control,
  .go-to-question-container .btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  .go-to-question-container .btn {
    padding: 10px 15px;
  }
}

@media (max-width: 768px) {
  .go-to-question-container {
    margin-bottom: 20px;
  }
}

/* Go to Question Error States */
.go-to-question-container .form-control.is-invalid {
  border-color: #dc3545;
  background-color: #fff5f5;
  animation: shake 0.5s ease-in-out;
}

html.dark-mode .go-to-question-container .form-control.is-invalid {
  border-color: #dc3545;
  background-color: #2d1b1b;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.error-message {
  animation: slideDown 0.3s ease-out;
}

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

/* Enhanced hover effects */
.go-to-question-container .form-control:hover {
  background-color: #f1f3f4;
}

html.dark-mode .go-to-question-container .form-control:hover {
  background-color: #353535;
}

/* Input focus ring */
.go-to-question-container .input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
  border-radius: 12px;
}

/* Success state for form control */
.go-to-question-container .form-control.is-valid {
  border-color: #28a745;
  background-color: #f5fff5;
}

html.dark-mode .go-to-question-container .form-control.is-valid {
  border-color: #28a745;
  background-color: #1b2d1b;
}

.goTo {
  padding: 0 !important ;
}
