/* ===================================
   CDL Practice Test - Stylesheet
   ================================= */

/* Main layout for desktop with left and right sidebars */
.page-layout {
  max-width: 1800px;
  margin: 0 auto;
  display: grid;
  /*grid-template-columns: 300px 1fr 300px;*/
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 0 5px;
}

.test-container {
  min-width: 0; /* Prevents grid overflow */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 25px;
  min-height: 600px;
}

/* ===================================
   Sidebar Ad Sections
   ================================= */
.sidebar-ad {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.sidebar-left {
  grid-column: 1;
}

.sidebar-right {
  grid-column: 3;
}

.ad-sidebar {
  width: 100%;
  height: 250px;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 20px;
}

/* ===================================
   Test Header Section
   ================================= */
.test-header {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: white;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  text-align: center;
}

.test-header h1 {
  margin-bottom: 10px;
  font-size: 1.8rem;
}

/* Progress Bar Styling */
.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 4px;
  margin: 15px 0;
  overflow: hidden;
}

.progress-fill {
  background: white;
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ===================================
   Question Card Section
   ================================= */
.question-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.question-number {
  color: #1976d2;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.question-text {
  font-size: 1.3rem;
  line-height: 1.7;
  margin-bottom: 32px;
  color: #2c2c2c;
  font-weight: 500;
  padding: 0 4px;
}

/* ===================================
   Answer Options Section
   ================================= */
.answers-container {
  margin-bottom: 28px;
}

.answer-option {
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Answer Option States */
.answer-option:hover {
  background: #f3f8ff;
  border-color: #1976d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.15);
}

.answer-option.selected {
  background: #f3f8ff;
  border-color: #1976d2;
  color: #1976d2;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.2);
  transform: translateY(-2px);
}

.answer-option.correct {
  background: #f1f8e9;
  border-color: #4caf50;
  color: #2e7d32;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.answer-option.incorrect {
  background: #fff3f3;
  border-color: #f44336;
  color: #c62828;
  box-shadow: 0 4px 16px rgba(244, 67, 54, 0.2);
}

/* Answer Components */
.answer-indicator {
  font-size: 1.8rem;
  margin-left: auto;
  opacity: 0;
  transition: all 0.4s ease;
  transform: scale(0.8);
}

.answer-indicator.show {
  opacity: 1;
  transform: scale(1);
}

.answer-letter {
  background: #1976d2;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.answer-option.correct .answer-letter {
  background: #4caf50;
}

.answer-option.incorrect .answer-letter {
  background: #f44336;
}

.answer-text {
  flex: 1;
  line-height: 1.6;
  font-size: 1.05rem;
  color: #333;
  font-weight: 500;
}

/* ===================================
   Explanation Section
   ================================= */
.explanation {
  background: linear-gradient(135deg, #f8fafe 0%, #f0f7ff 100%);
  border: 2px solid #e3f2fd;
  border-left: 6px solid #1976d2;
  padding: 24px;
  margin-top: 24px;
  border-radius: 12px;
  display: none;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.08);
}

.explanation.show {
  display: block;
  animation: slideDown 0.4s ease;
}

/* Slide Down Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.explanation h4 {
  color: #1976d2;
  margin-bottom: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explanation h4::before {
  content: "💡";
  font-size: 1.1rem;
}

.explanation p {
  color: #444;
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

/* ===================================
   Button Section
   ================================= */
.button-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Base Button Styles */
.btn {
  padding: 12px 30px;
  margin-top: 15px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* Primary Button (Next, Finish) */
.btn-primary {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(25, 118, 210, 0.4);
}

/* Secondary Button (Previous) */
.btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e9ecef;
}

.btn-secondary:hover {
  background: #e9ecef;
}

/* Disabled Button State */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===================================
   Results Section
   ================================= */
.results-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: none;
}

.results-card.show {
  display: block;
}

/* Score Circle */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
}

.score-pass {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

.score-fail {
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

/* ===================================
   Loading Section
   ================================= */
.loading {
  text-align: center;
  padding: 50px;
  color: #666;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1976d2;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* Spinner Animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===================================
   Disclaimer Section
   ================================= */
.disclaimer {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.disclaimer-desktop {
  display: block;
}

.disclaimer-mobile {
  display: none;
}

/* ===================================
   Responsive Design - Tablet
   ================================= */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
  }

  .sidebar-ad,
  .sidebar-left,
  .sidebar-right {
    display: none;
  }

  .test-container {
    margin: 0 auto;
    max-width: 100%;
  }
}

/* ===================================
   Responsive Design - Mobile
   ================================= */
@media (max-width: 768px) {
  .page-layout {
    padding: 15px;
  }

  .test-container {
    padding: 0;
  }

  .question-card {
    padding: 20px;
  }

  .button-container {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  /* Mobile disclaimer */
  .disclaimer-desktop {
    display: none;
  }

  .disclaimer-mobile {
    display: block;
  }

  .disclaimer {
    margin-top: 30px;
    padding: 15px;
    font-size: 0.7rem;
  }
}
