/* Navbar Button Styling */
.live-test-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-test-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

/* Modal Overlay */
.test-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* Modal Content Box */
.test-modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  padding: 30px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: width 0.3s ease;
}

body.dark-mode .test-modal-content {
  background: #1e1e1e;
  color: #f1f1f1;
}

.close-test-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #555;
}

body.dark-mode .close-test-btn {
  color: #ccc;
}

/* Step Logic */
.test-step {
  display: none;
  animation: fadeIn 0.3s ease;
}
.test-step.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Forms & Inputs */
.test-modal-content h2 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #10b981;
  padding-bottom: 10px;
  display: inline-block;
}
body.dark-mode .test-modal-content h2 {
  color: #fff;
}
.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}
body.dark-mode .form-group input,
body.dark-mode .form-group select {
  background: #333;
  color: white;
  border-color: #555;
}

/* Buttons */
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}
.next-btn,
.start-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  flex: 1;
}
.back-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}
body.dark-mode .back-btn {
  background: #333;
  color: #ccc;
  border-color: #555;
}
.start-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* Instructions */
.instructions-box {
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #10b981;
  margin-bottom: 20px;
  text-align: left;
}
body.dark-mode .instructions-box {
  background: #2d3748;
}
.instructions-box ul {
  list-style: none;
  padding: 0;
  line-height: 1.8;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

/* Test Interface Grid */
.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}
.timer {
  font-size: 18px;
  font-weight: bold;
  color: #dc2626;
}
.submit-test-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.test-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  text-align: left;
}
@media (max-width: 768px) {
  .test-layout {
    grid-template-columns: 1fr;
  }
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 30px;
}
.option-btn {
  padding: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}
body.dark-mode .option-btn {
  background: #333;
  border-color: #555;
  color: white;
}
.option-btn:hover {
  background: #f1f5f9;
}
body.dark-mode .option-btn:hover {
  background: #444;
}
.option-btn.selected {
  background: #d1fae5;
  border-color: #10b981;
}
body.dark-mode .option-btn.selected {
  background: #064e3b;
}

.test-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.nav-btn,
.mark-btn {
  padding: 10px 15px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}
.nav-btn {
  background: #e2e8f0;
  color: #334155;
}
.mark-btn {
  background: #fef08a;
  color: #854d0e;
}

/* Palette */
.palette-area {
  border-left: 1px solid #eee;
  padding-left: 20px;
}
body.dark-mode .palette-area {
  border-color: #444;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  margin-top: 15px;
}
.palette-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.dark-mode .palette-btn {
  background: #333;
  color: white;
  border-color: #555;
}
.palette-btn.attempted {
  background: #10b981;
  color: white;
  border-color: #10b981;
}
.palette-btn.review {
  background: #eab308;
  color: white;
  border-color: #eab308;
}
.palette-btn.active {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Report */
.report-card {
  text-align: center;
}
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid #10b981;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  font-size: 32px;
  font-weight: bold;
}
.score-circle small {
  font-size: 14px;
  font-weight: normal;
  color: #666;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}
.stat-box {
  padding: 15px;
  border-radius: 8px;
  font-weight: bold;
}
.stat-box.correct {
  background: #d1fae5;
  color: #065f46;
}
.stat-box.incorrect {
  background: #fee2e2;
  color: #991b1b;
}
.stat-box.unattempted {
  background: #f1f5f9;
  color: #334155;
}
.stat-box.accuracy {
  background: #e0e7ff;
  color: #3730a3;
}

/* --- Enhanced Mobile Live Test Button --- */
.mobile-live-test {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  padding: 12px 20px !important;
  border-radius: 25px !important;
  margin: 10px 20px 15px 20px !important; /* Spacing so it doesn't touch the sides */
  display: flex !important;
  justify-content: center !important; /* Centers the text and icon */
  align-items: center !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Ensure the icon is white and aligned */
.mobile-live-test i {
  color: white !important;
  margin-right: 8px !important;
}

/* Add the hover click effect */
.mobile-live-test:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

/* Hide the top navbar Live Test button on mobile screens */
@media (max-width: 768px) {
  #liveTestBtn {
    display: none !important;
  }
}
