/* DMV School Main Styles with Fixes */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.hero-content {
    max-width: 1100px;
}

.badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.highlight {
    color: #ffd700;
}

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.cta-button {
    padding: 1.2rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 44px; /* Touch-friendly minimum */
    min-height: 44px;
}

.cta-primary {
    background: #ffd700;
    color: #1e3c72;
}

.cta-primary:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* FIX: Transparent button issue - create context-specific variants */
.cta-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* FIXED: Secondary button for light backgrounds */
.cta-secondary-dark {
    background: white;
    border: 2px solid #2a5298;
    color: #2a5298;
}

.cta-secondary-dark:hover {
    background: #f0f4f8;
    border-color: #1e3c72;
    color: #1e3c72;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.pricing-card {
    background: white;
    color: #2c3e50;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 3px solid transparent;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.pricing-card.featured {
    border-color: #ffd700;
    transform: scale(1.05);
}

.pricing-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: #ffd700;
    color: #1e3c72;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1e3c72;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 700;
    color: #2a5298;
    margin: 1rem 0;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.7rem 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

.pricing-features li:before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
    margin-right: 0.5rem;
}

.hidden { display: none !important; }

.course-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: #ffffff;
    min-height: 100vh;
}

.course-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #e0e0e0;
}

.course-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1e3c72;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    margin: 2rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a5298, #1e3c72);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.lesson-section {
    background: #f8f9fa;
    padding: 3rem;
    border-radius: 10px;
    margin-bottom: 2.5rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.lesson-section h2 {
    color: #1e3c72;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #ffd700;
}

.lesson-section h3 {
    color: #2a5298;
    margin: 2rem 0 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.lesson-section h4 {
    color: #34495e;
    margin: 1.5rem 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.lesson-section p, .lesson-section ul {
    line-height: 1.8;
    color: #2c3e50;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.lesson-section ul {
    padding-left: 2.5rem;
}

.lesson-section li {
    margin-bottom: 0.7rem;
}

.lesson-section strong {
    color: #1e3c72;
    font-weight: 600;
}

.quiz-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: #ffffff;
    min-height: 100vh;
}

.quiz-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #e0e0e0;
}

/* SECURITY FIX: Timer is now server-validated, but still display it */
.timer {
    font-size: 2rem;
    color: #e74c3c;
    font-weight: 700;
    margin: 1rem 0;
    background: #fff5f5;
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
}

.question-card {
    background: #f8f9fa;
    padding: 3rem;
    border-radius: 10px;
    margin-bottom: 2.5rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.question-number {
    color: #2a5298;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.7;
    color: #2c3e50;
    font-weight: 500;
}

.answer-option {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    border: 2px solid #d0d0d0;
    transition: all 0.3s;
    min-height: 44px; /* Touch-friendly */
}

.answer-option:hover {
    background: #f0f4f8;
    border-color: #2a5298;
}

.answer-option.selected {
    border-color: #1e3c72;
    background: #e8f4f8;
}

.answer-option input {
    margin-right: 1rem;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
}

.quiz-summary {
    background: #f8f9fa;
    padding: 4rem 3rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.score-display {
    font-size: 4.5rem;
    color: #1e3c72;
    font-weight: 700;
    margin: 2rem 0;
}

.certificate-preview {
    background: white;
    color: #2c3e50;
    padding: 3rem;
    border-radius: 10px;
    margin: 2rem 0;
    border: 3px solid #ffd700;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.info-box {
    background: #e8f4f8;
    border-left: 4px solid #2a5298;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 5px;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 5px;
}

.success-box {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 5px;
}

/* --- Modern Quiz UI --- */

.quiz-container-modern {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* When quiz is shown, add top margin to account for course page structure */
#coursePage:not(.hidden) .quiz-container-modern:not(.hidden) {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.quiz-header-modern {
  text-align: center;
  margin-bottom: 2rem;
}
.quiz-header-modern h2 {
  color: #1e3c72;
  font-size: 2rem;
}
.quiz-header-modern p {
  color: #666;
  font-size: 1.1rem;
}

.quiz-progress {
  width: 100%;
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 1rem;
}
.quiz-progress-bar {
  width: 0%;
  height: 100%;
  background-color: #27ae60;
  border-radius: 5px;
  transition: width 0.3s ease;
}

.quiz-question-counter {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
  color: #2a5298;
}

.quiz-question-view {
  display: none; /* Hidden by default, shown by JS */
}
.quiz-question-view.active {
  display: block;
}
.quiz-question-view h3 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  line-height: 1.5;
}

.quiz-answers-modern {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.quiz-answer-label {
  display: block;
  padding: 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s;
  position: relative;
}
.quiz-answer-label:hover {
  border-color: #2a5298;
}
.quiz-answer-label input {
  display: none;
}

/* Style for when an answer is selected */
.quiz-answer-label input:checked + span {
  font-weight: bold;
  color: #1e3c72;
}
.quiz-answer-label.selected {
  border-color: #2a5298;
  background-color: #e8f4f8;
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  border-top: 1px solid #eee;
  padding-top: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .course-container, .quiz-container { padding: 2rem 1rem; }
    .lesson-section { padding: 1.5rem; }
    .pricing-cards { grid-template-columns: 1fr; }
    
    .cta-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .nav-buttons {
        flex-direction: column;
    }
    
    .nav-buttons button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    .hero { padding: 1.5rem; }
    .course-title { font-size: 2rem; }
    .timer { font-size: 1.5rem; }
    .question-text { font-size: 1.1rem; }
}

/* Print styles for certificate */
@media print {
    .nav-buttons,
    .cta-button,
    .accessibility-toolbar,
    .accessibility-toggle {
        display: none !important;
    }
}

