/* ===== Core Layout ===== */
.quizpro-container {
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-height: 80vh;
}

/* ===== Main Question Area (Left) ===== */
.quizpro-question-area {
  flex: 0 0 70%;
  padding: 30px 40px;
  border-right: 1px solid #eaeaea;
}

/* ===== Sidebar (Right) ===== */
.quizpro-sidebar {
  flex: 0 0 30%;
  padding: 30px 25px;
  background: #eef4fa;
  display: flex;
  flex-direction: column;
  border: 1px solid #B8D4BE;
  border-radius: 14px;
}

/* ===== Header Section ===== */
.quizpro-question-header {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 18px;
  color: #2c3e50;
  letter-spacing: -0.5px;
}

.marking-info {
  display: flex;
  gap: 30px;
  margin-bottom: 22px;
  font-size: 12px;
  color: #555;
  justify-content: right;
  font-weight: 600;
}

.mark-right {
  color: #27ae60;
  font-weight: 600;
}

.mark-negative {
  color: #e74c3c;
  font-weight: 600;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 25px 0;
  border: none;
}

/* ===== Question Content ===== */
.question-block {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.question-block.active {
  display: block;
}

.quizpro-question-text {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 25px;
  line-height: 1.5;
  color: #333;
  text-align: justify;
}

.quizpro-options {
  margin-bottom: 30px;
}

.quizpro-options label {
  display: block;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.quizpro-options label:hover {
  background: #f5f7fa;
  border-color: #bdc3c7;
  transform: translateY(-1px);
}

.quizpro-options input[type="radio"] {
  margin-right: 14px;
  transform: scale(1.15);
  accent-color: #3498db;
}

/* ===== Sidebar Components ===== */
.quizpro-timer-container {
  margin-bottom: 30px;
}

.quizpro-timer {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  color: #2c3e50;
}

/* ===== Enhanced Question Palette ===== */
.quizpro-palette {
  margin-bottom: 30px;
}

.quizpro-palette h4 {
  font-size: 17px;
  margin-bottom: 18px;
  color: #34495e;
  font-weight: 600;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}


/* ===== Modified Palette Button Styles ===== */
.quizpro-palette button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: sans-serif;
}

/* Status Colors - Now with !important to lock them */
.not-visited { 
  background: #e0e0e0 !important; 
  color: #141414 !important; 
}
.answered { 
  background: #2ecc71 !important; 
  color: white !important; 
}
.not-answered { 
  background: #ff5252 !important; 
  color: white !important; 
}
.review { 
  background: #ab47bc !important; 
  color: white !important; 
}

/* Hover effects only apply to transform/shadow - not colors */
.quizpro-palette button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Current question styling remains */
.current { 
  box-shadow: 0 0 0 3px #3498db, 0 2px 6px rgba(0,0,0,0.1) !important;
  transform: scale(1.05);
}

/* Remove the default hover color override */
.quizpro-container .quizpro-palette button.not-visited:hover {
  background: #e0e0e0 !important; /* Maintains original color on hover */
  color: #141414 !important;
}

.quizpro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 25px;
  font-size: 14px;
}

.quizpro-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quizpro-legend-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== Navigation & Pagination ===== */
.quizpro-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 35px;
  gap: 15px;
}

.quizpro-navigation button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  flex: 1;
}

.quizpro-navigation button:nth-child(1) {
  background: #e74c3c;
  color: white;
}

.quizpro-navigation button:nth-child(2) {
  background: #f39c12;
  color: white;
}

.quizpro-navigation button:nth-child(3) {
  background: #3498db;
  color: white;
}

.quizpro-navigation button:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.quizpro-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.quizpro-pagination button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
}

.quizpro-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.quizpro-pagination-prev {
  background: #95a5a6;
  color: white;
}

.quizpro-pagination-next {
  background: #3498db;
  color: white;
}

.quizpro-pagination-info {
  font-size: 15px;
  color: #7f8c8d;
  font-weight: 500;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.current {
  animation: pulse 2s infinite;
}

/* Reset any review styling on question blocks and options */
.question-block.review,
.quizpro-options .review,
.nav-buttons .review {
  background-color: inherit !important;
  border-color: inherit !important;
  color: inherit !important;
}

/* Style only the palette button for reviewed questions */
.palette-grid button.review {
  background-color: #9b59b6 !important; /* Purple color */
  color: white !important;
  position: relative;
}

/* Optional: Add checkmark indicator */
.palette-grid button.review::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
}

/* Style for Mark for Review button */
#mark-review {
  background-color: #9b59b6;
  color: white;
  transition: all 0.2s;
}

#mark-review:hover {
  background-color: #8e44ad;
}



/* ===== Two-Column Status Legend ===== */
.status-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; /* Increased gap between items */ margin-top: 20px; font-size: 15px; /* Slightly larger text */ color: #333; font-weight: 500; /* Medium weight for better readability */ } .status-item { display: flex; align-items: center; gap: 10px; /* Increased gap between color and text */ } .status-color { width: 20px; /* Increased from 16px */ height: 20px; /* Increased from 16px */ border-radius: 5px; /* Slightly more rounded */ box-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Subtle shadow for depth */ }

/* Color Coding - More vibrant version */
.not-visited-color { 
  background-color: #e0e0e0;  /* Lighter gray */
  border: 1px solid #c0c0c0;
}
.answered-color { 
  background-color: #2ecc71;  /* Brighter green */
  border: 1px solid #27ae60;
}
.not-answered-color { 
  background-color: #ff5252;  /* Vibrant red */
  border: 1px solid #e53935;
}
.marked-review-color { 
  background-color: #ab47bc;  /* Softer purple */
  border: 1px solid #8e24aa;
}



/* Mobile optimization */
@media (max-width: 768px) {
  .question-palette-container {
    max-height: 200px; /* Smaller scroll area on mobile */
  }
  
  .palette-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columns on mobile */
  }
}

/* Desktop optimization */
@media (min-width: 1024px) {
  .question-palette-container {
    max-height: 400px; /* Larger scroll area on desktop */
  }
  
  .palette-grid {
    grid-template-columns: repeat(5, 1fr); /* 4 columns on desktop */
  }
}

@media (min-width: 768px) and (max-width: 1023px){
    .question-palette-container {
    max-height: 400px; /* Larger scroll area on desktop */
  }
  .palette-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns on desktop */
  }
}

/* Make sure buttons don't shrink */
.quizpro-palette button {
  min-width: 44px;
  min-height: 44px;
}


/* ===========================
   Responsive / App-like UI
   (Vertical palette + auto-fit sidebar height + smaller quiz title)
   =========================== */

/* ---------- Tablet / small desktop adjustments ---------- */
@media (max-width: 1024px) {
  .quizpro-container {
    max-width: 980px;
    margin: 14px auto;
    min-height: calc(100vh - 28px);
    padding: 12px;
  }

  .quizpro-question-area {
    padding: 20px;
    border-right: none;
  }

  .quizpro-sidebar {
    width: 100%;
    padding: 18px;
    margin-top: 12px;
    border: none;
    border-radius: 14px;
    background: rgba(238,244,250,0.95);
    /* Auto height for tablet */
    max-height: calc(100vh - 250px);
    overflow-y: auto;
  }

  .quizpro-palette h4 { font-size: 16px; }
}

/* ---------- Mobile (tablet -> phone) ---------- */
@media (max-width: 768px) {
  .quizpro-container {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .quizpro-question-area {
    order: 1;
    flex: 1 1 auto;
    padding: 18px;
    border-right: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Sidebar below question area, vertical palette with auto height */
  .quizpro-sidebar {
    order: 2;
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    border-radius: 12px;
    background: #f7fbfd;
    border: 1px solid rgba(184,212,190,0.35);
    max-height: calc(100vh - 220px); /* Auto-fit based on viewport */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .palette-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
  }

  /* Quiz title smaller on mobile */
  .quizpro-question-header {
    font-size: 14px !important;
    margin-bottom: 10px;
  }

  /* Keep all nav buttons visible - compact two per row */
  .quizpro-navigation {
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    justify-content: space-between;
  }

  .quizpro-navigation button {
    flex: 1 1 calc(50% - 6px);
    padding: 10px 8px;
    font-size: 14px;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
  }

  /* Prevent anything from overflowing horizontally */
  .quizpro-container {
    overflow-x: hidden;
  }
}

/* ---------- Very small phones ---------- */
@media (max-width: 480px) {
  .quizpro-question-area { padding: 14px; }
  .quizpro-sidebar {
    padding: 12px;
    max-height: calc(100vh - 200px);
  }

  .quizpro-navigation {
    gap: 4px;
  }

  .quizpro-navigation button {
    padding: 8px 6px;
    font-size: 13px;
  }

  .quizpro-question-header {
    font-size: 18px !important;
  }

  .palette-grid button {
    width: 40px !important;
    height: 40px !important;
    font-size: 13px;
  }
}

/* Scrollbar styling for sidebar */
.quizpro-sidebar::-webkit-scrollbar {
  width: 6px;
}
.quizpro-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.quizpro-sidebar::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}
.quizpro-sidebar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===== Modern Light Background Design ===== */

/* Page background — lighter gradient */
body {
  background: linear-gradient(135deg, #f8fafc, #e9eff7) fixed;
  background-attachment: fixed;
}

/* Faint geometric pattern overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Quiz container — clean bright card */
.quizpro-container {
  position: relative;
  background: #fffffffa; /* brighter white */
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
  z-index: 1;
}

/* Subtle inner light overlay */
.quizpro-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(to bottom right, rgba(255,255,255,0.4), rgba(255,255,255,0.05));
  pointer-events: none;
  z-index: -1;
}


/* ===== Uniform but Visible Stylish Divider ===== */
.quizpro-title-divider {
  border: 0;
  height: 0.7px;
  margin: 20px 0 45px;
  background: linear-gradient(to right, #666, #666); /* uniform color */
  opacity: 0.7; /* keep visible but soft */
}

.quizpro-title-divider-2 {
  border: 0;
  height: 0.5px;
  margin: 20px 0 45px;
  background: linear-gradient(to right, #DBD3D3, #DBD3D3); /* uniform color */
  opacity: 0.7; /* keep visible but soft */
}




/* Default (desktop) – thin + transparent scrollbar */
.quizpro-sidebar {
  max-height: 714px;   /* adjust height as needed */
  overflow-y: auto;
  overflow-x: hidden;
}

.quizpro-sidebar::-webkit-scrollbar {
  width: 1px;
}
.quizpro-sidebar::-webkit-scrollbar-track {
  background: transparent !important;
}
.quizpro-sidebar::-webkit-scrollbar-thumb {
  background: transparent !important;
  border-radius: 4px;
}
.quizpro-sidebar::-webkit-scrollbar-thumb:hover {
  background: transparent !important;
}

/* Mobile override – show colored scrollbar */
@media (max-width: 768px) {
  .quizpro-sidebar::-webkit-scrollbar {
    width: 6px; /* bigger for touch */
  }
  .quizpro-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
  }
  .quizpro-sidebar::-webkit-scrollbar-thumb {
    background: #888 !important;
  }
  .quizpro-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555 !important;
  }
}

@media (max-width: 768px) {
  .quizpro-question-text {
    font-weight: 400;  /* normal text */
  }
}
