/* ==========================================
   🔥 MODERN CYBER QUIZ APP UI
   Production Ready Responsive CSS
========================================== */

/* ===== GOOGLE FONT ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {

  /* 🌈 HAPPY MODERN PALETTE */
  --bg: #f8fafc;
  --bg-secondary: #ffffff;

  --card: rgba(255,255,255,0.82);

  --border: rgba(255,255,255,0.65);

  --primary: #7c3aed;
  --primary-dark: #6d28d9;

  --secondary: #ff7a18;
  --secondary-light: #ffb347;

  --accent: #a855f7;

  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;

  --text: #111827;
  --muted: #6b7280;

  --shadow:
    0 10px 30px rgba(124,58,237,0.10);

  --radius: 22px;

  --transition: 0.25s ease;
}

/* ===== RESET ===== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;

  background:
    radial-gradient(circle at top left,
      rgba(168,85,247,0.18),
      transparent 28%),


    radial-gradient(circle at top right,
      rgba(255,122,24,0.20),
      transparent 30%),


    linear-gradient(
      180deg,
      #ffffff 0%,
      #faf5ff 35%,
      #fff7ed 100%
    );

  color: var(--text);

  min-height: 100vh;

  line-height: 1.6;

  overflow-x: hidden;
}

/* ===== CONTAINER ===== */

.container {
  width: min(1200px, 94%);
  margin: auto;
  padding: 24px 0 60px;
}
/* ==========================================
   NAVBAR (HORIZONTAL DESKTOP + MOBILE COLLAPSE)
========================================== */

nav {
  position: sticky;
  top: 14px;
  z-index: 999;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px 22px;

  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);

  border: 1px solid rgba(168,85,247,0.12);
  border-radius: 22px;

  box-shadow: 0 10px 30px rgba(124,58,237,0.08);
}

/* UL = INLINE ROW */
nav ul {
  display: flex;
  align-items: center;
  gap: 14px;

  list-style: none;
}

/* LINKS */
nav li a {
  text-decoration: none;
  color: #374151;
  font-weight: 600;

  padding: 10px 14px;
  border-radius: 12px;

  transition: 0.25s ease;
}

nav li a:hover {
  background: rgba(168,85,247,0.10);
  color: var(--primary);
}

/* INFO BUTTON (your button inside UL) */
.info-button {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;

  padding: 10px 14px;
  border-radius: 12px;

  font-weight: 700;
}

/* ==========================================
   HAMBURGER
========================================== */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger div {
  width: 28px;
  height: 3px;
  background: #374151;
  border-radius: 999px;
}

/* ===== HAMBURGER ===== */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger div {
  width: 28px;
  height: 3px;
  background: white;
  border-radius: 999px;
}

/* ==========================================
   HEADINGS
========================================== */

h1 {
  text-align: center;

  font-size: clamp(2.2rem, 5vw, 4rem);

  font-weight: 800;

  margin-bottom: 20px;

  background:
    linear-gradient(
      90deg,
      #7c3aed,
      #a855f7,
      #ff7a18
    );

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 18px;
}

h3 {
  margin-bottom: 10px;
}

/* ==========================================
   BUTTONS
========================================== */

button {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.98);
}

#startQuizBtn,
#submitBtn,
#generateCert,
#reviewResultsBtn,
#retakeQuizBtn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 20px rgba(79,140,255,0.35);
}

#nextBtn,
#prevBtn,
#printResultsBtn,
#closeResultsBtn,
#closeCert {
  background: white;

  color: var(--primary);

  border: 2px solid rgba(124,58,237,0.18);

  padding: 14px 24px;

  border-radius: 14px;

  font-weight: 700;

  box-shadow:
    0 6px 18px rgba(124,58,237,0.08);
}

#nextBtn:hover,
#prevBtn:hover,
#printResultsBtn:hover,
#closeResultsBtn:hover,
#closeCert:hover {

  background:
    linear-gradient(
      135deg,
      rgba(124,58,237,0.08),
      rgba(255,122,24,0.08)
    );

  border-color: rgba(124,58,237,0.25);

  color: var(--primary-dark);

  transform: translateY(-2px);
}

.info-button {
  background: linear-gradient(135deg, #9333ea, #4f46e5);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
}

/* ==========================================
   CERTIFICATE PREVIEW
========================================== */

.certificate-preview-section {
  margin-bottom: 40px;
  text-align: center;
}

.certificate-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;

  /* ✅ CENTER ITEMS */
  justify-items: center;
}

.cert-thumb {
  width: 50%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.cert-thumb:hover {
  transform: scale(1.02);
}

/* ==========================================
   QUIZ CARD STRUCTURE
========================================== */

#questionContainer {
  margin-top: 35px;
}

.question-block {
  background: rgba(255,255,255,0.88);

  border: 1px solid rgba(168,85,247,0.10);

  border-radius: 24px;

  padding: 30px;

  margin-bottom: 28px;

  box-shadow:
    0 10px 30px rgba(124,58,237,0.08);

  backdrop-filter: blur(20px);

  transition: var(--transition);
}

.question-block:hover {
  transform: translateY(-2px);

  box-shadow:
    0 16px 40px rgba(124,58,237,0.12);
}

/* Shared cards */

#result,
#quizResults,
.modal-content,
nav {
  background: rgba(255,255,255,0.82);

  backdrop-filter: blur(20px);

  border: 1px solid rgba(255,255,255,0.85);

  border-radius: 24px;

  box-shadow:
    0 10px 30px rgba(124,58,237,0.08);
}

/* ==========================================
   QUESTION TITLES
========================================== */

.question-block h2 {
  font-size: 1.25rem;

  line-height: 1.5;

  font-weight: 700;

  margin-bottom: 24px;

  color: #111827;
}

/* ==========================================
   ANSWER OPTIONS
========================================== */

.question-block label {
  display: flex;

  align-items: center;

  gap: 14px;

  padding: 18px 20px;

  margin-bottom: 16px;

  border-radius: 18px;

  background: rgba(255,255,255,0.95);

  border: 2px solid rgba(168,85,247,0.08);

  cursor: pointer;

  transition: all 0.25s ease;

  font-weight: 500;

  color: #1f2937;
}

.question-block label:hover {
  background: rgba(168,85,247,0.08);

  border-color: rgba(168,85,247,0.25);

  transform: translateX(4px);
}

.question-block input[type="radio"] {
  accent-color: var(--primary);

  transform: scale(1.3);

  min-width: 18px;
}
/* ==========================================
   PROGRESS
========================================== */

#progress {

  margin-top: 24px;

  text-align: center;

  font-weight: 700;

  font-size: 1rem;

  color: #4b5563;
}

#progress span {

  background: white;

  padding: 12px 18px;

  border-radius: 999px;

  border: 1px solid rgba(124,58,237,0.12);

  box-shadow:
    0 4px 14px rgba(124,58,237,0.06);
}

#current-question,
#total-questions {
  color: var(--primary);
}
/* ==========================================
   RESULT SECTION
========================================== */

#result,
#quizResults {
  margin-top: 40px;

  background: var(--card);
  backdrop-filter: blur(18px);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  padding: 32px;
  box-shadow: var(--shadow);
}

#resultText {
  font-size: 1.1rem;
  margin: 14px 0 20px;
}

/* ==========================================
   REVIEW QUESTIONS
========================================== */

.question-review {
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.06);
}

.question-review p {
  margin-bottom: 10px;
}

/* ==========================================
   INPUT
========================================== */



/* ==========================================
   MODALS
========================================== */

.modal,
.modal-preview {
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-content {
  width: min(850px, 100%);

  background: white;
  border-radius: 28px;

  padding: 36px;

  border: 1px solid rgba(255,255,255,0.08);

  max-height: 90vh;
  overflow-y: auto;
}

.close,
.close-preview {
  position: absolute;
  top: 20px;
  right: 30px;

  font-size: 2rem;
  color: #374151;
  cursor: pointer;
}

.modal-content-preview {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 18px;
}

/* ==========================================
   CAREER IMPACT BOX
========================================== */

.career-impact-box {
  margin-top: 30px;
  padding: 26px;

  border-radius: 22px;

  background:
    linear-gradient(
      135deg,
      rgba(79,140,255,0.16),
      rgba(0,210,255,0.08)
    );

  border: 1px solid rgba(79,140,255,0.2);
}

.career-impact-box ul {
  margin-top: 10px;
  padding-left: 22px;
}

/* ==========================================
   FOOTER
========================================== */

footer {
  background: transparent !important;

  color: #6b7280 !important;

  border-top: 1px solid rgba(124,58,237,0.08);
}

footer a {
  color: var(--primary) !important;
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 900px) {

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .question-block {
    padding: 22px;
  }

  .modal-content {
    padding: 24px;
  }
}

@media (max-width: 768px) {

  nav {
    padding: 16px;
  }

  .hamburger {
    display: flex;
    margin-bottom: 12px;
  }

  nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  nav ul.collapsed {
    display: none;
  }

  nav li a,
  .info-button {
    width: 100%;
    text-align: center;
  }

  .question-block label {
    align-items: flex-start;
  }

  #result,
  #quizResults {
    padding: 22px;
  }

  button {
    width: 100%;
    margin-bottom: 12px;
  }

  #progress {
    margin-top: 10px;
  }
}

@media (max-width: 500px) {

  .container {
    width: 95%;
  }

  h1 {
    margin-top: 10px;
  }

  .question-block {
    padding: 18px;
  }

  .question-block h2 {
    font-size: 1.05rem;
  }

  .modal-content {
    border-radius: 22px;
  }
}

.center-actions,
.quiz-navigation {
  text-align: center;
  margin-top: 24px;
}

.quiz-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.hidden {
  display: none !important;
}

#certificateActions input[type="text"] {
  width: min(420px, 100%);
  padding: 14px 16px;

  background: rgba(255,255,255,0.95);
  color: #111827;

  border: 2px solid rgba(124,58,237,0.18);
  border-radius: 14px;

  font-size: 1rem;
  font-weight: 500;

  outline: none;

  box-shadow:
    0 4px 12px rgba(124,58,237,0.08);

  transition: 0.25s ease;
}

#certificateActions input[type="text"]::placeholder {
  color: #6b7280;
}

#certificateActions input[type="text"]:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 4px rgba(124,58,237,0.12);
}

/* ==========================================
   CUSTOM ALERT MODAL
========================================== */

.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;

  background: rgba(15, 23, 42, 0.45);

  backdrop-filter: blur(8px);
}

.alert-box {
  width: min(420px, 100%);

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.96),
      rgba(250,245,255,0.98)
    );

  border-radius: 28px;

  padding: 34px 28px;

  text-align: center;

  border: 1px solid rgba(124,58,237,0.12);

  box-shadow:
    0 20px 60px rgba(124,58,237,0.18);

  animation: alertPop 0.25s ease;
}

.alert-icon {
  width: 74px;
  height: 74px;

  margin: 0 auto 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  font-size: 2rem;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--secondary)
    );

  color: white;

  box-shadow:
    0 10px 25px rgba(124,58,237,0.22);
}

#alertTitle {
  font-size: 1.45rem;
  margin-bottom: 12px;
  color: var(--text);
}

#alertMessage {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 26px;
}

#closeAlertBtn {
  width: 100%;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--secondary)
    );

  color: white;

  border: none;
  border-radius: 16px;

  padding: 15px;

  font-size: 1rem;
  font-weight: 700;

  cursor: pointer;

  transition: 0.25s ease;
}

#closeAlertBtn:hover {
  transform: translateY(-2px);
}

@keyframes alertPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* MOBILE */

@media (max-width: 600px) {

  .alert-box {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .alert-icon {
    width: 64px;
    height: 64px;
    font-size: 1.7rem;
  }

  #alertTitle {
    font-size: 1.2rem;
  }

  #alertMessage {
    font-size: 0.96rem;
  }
}
#exitQuizBtn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.25);
    letter-spacing: 0.3px;
}

/* Hover effect */
#exitQuizBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.35);
}

/* Click effect */
#exitQuizBtn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

/* Focus accessibility */
#exitQuizBtn:focus {
    outline: 2px solid #fca5a5;
    outline-offset: 3px;
}

#exitQuizBtn::before {
    content: "⏻ ";
    margin-right: 6px;
}

.practice-feedback {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.practice-feedback.correct {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.practice-feedback.incorrect {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.quiz-mode-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#practiceModeBtn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s ease;
}

#practiceModeBtn:hover {
    transform: translateY(-2px);
}

#practiceModeModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* modal box */
#practiceModeModal .modal-content {
    width: 90%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: popIn 0.2s ease-out;
}

/* title */
#practiceModeModal h2 {
    margin-bottom: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

/* text */
#practiceModeModal p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
}

/* input */
#practiceQuestionCount {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: 0.2s ease;
}

#practiceQuestionCount:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* buttons row */
#practiceModeModal .modal-content div {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

/* start button */
#startPracticeSession {
    flex: 1;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

#startPracticeSession:hover {
    transform: translateY(-2px);
}

/* cancel button */
#cancelPracticeSession {
    flex: 1;
    background: #e5e7eb;
    color: #111827;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

#cancelPracticeSession:hover {
    background: #d1d5db;
}

/* animation */
@keyframes popIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.quiz-btn{
  display:inline-block;
  padding:14px 24px;
  background:#2563eb;
  color:white;
  text-decoration:none;
  border-radius:8px;
  font-weight:600;
  margin:5px;
  transition:0.2s ease;
}

.quiz-btn:hover{
  background:#1d4ed8;
}