/* ==========================================
   1. QUIZ CONTAINER & LAYOUT (COLORFUL BASE)
   ========================================== */
:root {
  --sdev-primary: #4f46e5;
}

/* ==========================================
   2. START SCREEN / INTRO (THEME-PROOF & CLEAN)
   ========================================== */
body #sdev-qz-intro-screen.quiz-start-screen {
  background: #ffffff;
  max-width: 750px;
  width: 100%;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  border-top: 6px solid var(--sdev-primary);
  box-sizing: border-box;
}

body #sdev-qz-intro-screen h1.quiz-title {
  font-size: 25px;
  font-weight: 900;
  margin: 0 0 15px 0;
  padding: 0;
  color: var(--sdev-primary);
  line-height: 1.2;
  text-transform: none;
  background: transparent;
  border: none;
}

body #sdev-qz-intro-screen p.quiz-desc {
  font-size: 16px;
  color: #555555;
  margin: 0 0 25px 0;
  line-height: 1.6;
}

body #sdev-qz-intro-screen .quiz-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

body #sdev-qz-intro-screen .quiz-meta .meta-item {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--sdev-primary);
  border: 1px solid #e2e8f0;
  margin: 0;
}

body #sdev-qz-intro-screen .instructions {
  text-align: left;
  font-size: 14px;
  color: #444444;
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  margin: 0 0 25px 0;
  border-left: 4px solid var(--sdev-primary);
}

body #sdev-qz-intro-screen .instructions strong {
  font-size: 18px;
  display: block;
  margin-bottom: 10px;
  color: var(--sdev-primary);
}

body #sdev-qz-intro-screen .instructions ul {
  padding-left: 20px;
  margin: 0;
  line-height: 1.6;
}

body #sdev-qz-intro-screen button.start-btn {
  background: var(--sdev-primary);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 16px 30px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: inline-block;
  margin: 0 auto;
}

body #sdev-qz-intro-screen button.start-btn:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

/* ==========================================
   3. MAIN QUIZ CONTAINER
   ========================================== */
.sdev-qz-container {
  max-width: 850px;
  margin: 0px auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 15px 35px rgba(50, 50, 93, 0.1),
    0 5px 15px rgba(0, 0, 0, 0.07);
  padding: 40px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  border-top: 8px solid var(--sdev-primary);
  position: relative;
  overflow: hidden;
}

.sdev-qz-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px dashed #e2e8f0;
}

.sdev-qz-header h2 {
  font-size: 34px;
  color: var(--sdev-primary);
  margin: 0 0 15px 0;
  font-weight: 800;
  text-transform: uppercase;
}

.sdev-qz-meta {
  font-size: 16px;
  color: #4a5568;
  font-weight: 600;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ==========================================
   4. QUESTION STYLES 
   ========================================== */
.sdev-qz-question {
  background: #f8faff;
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  position: relative;
}

.sdev-qz-question:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.sdev-qz-qtext {
  font-size: 24px;
  color: #1a202c;
  margin-bottom: 25px;
  font-weight: 700;
  line-height: 1.4;
  display: flex;
  gap: 15px;
}

.question-number {
  background: var(--sdev-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  height: fit-content;
  white-space: nowrap;
}

.q-image {
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 25px;
  border: 4px solid #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   5. ANSWER OPTIONS 
   ========================================== */
.sdev-qz-options-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sdev-qz-option-wrapper {
  position: relative;
  margin-bottom: 5px;
}

.sdev-qz-option-wrapper input[type="radio"],
.sdev-qz-option-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.sdev-qz-option-wrapper label {
  display: flex;
  align-items: center;
  padding: 18px 25px;
  background: #ffffff;
  border: 2px solid #edf2f7;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  color: #4a5568;
  font-weight: 500;
  min-height: 48px;
}

.sdev-qz-option-wrapper label:hover {
  background: #f8faff;
  border-color: var(--sdev-primary);
  transform: translateX(5px);
}

.sdev-qz-option-wrapper label::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  margin-right: 20px;
  display: inline-block;
  background: white;
  flex-shrink: 0;
  transition: all 0.2s;
}

.sdev-qz-option-wrapper input[type="checkbox"] + label::before {
  border-radius: 6px;
}

.sdev-qz-option-wrapper input:checked + label,
.sdev-qz-option-wrapper.selected label {
  background: var(--sdev-primary);
  border-color: var(--sdev-primary);
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.sdev-qz-option-wrapper input:checked + label::before,
.sdev-qz-option-wrapper.selected label::before {
  background: white;
  border-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333333' width='18px' height='18px'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

/* ==========================================
   6. MATCHING
   ========================================== */
.sdev-qz-matching {
  background: #f8fafc;
  padding: 25px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}
.matching-container {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}
.matching-left-column {
  flex: 1;
  order: 1;
  min-width: 300px;
}
.matching-right-column {
  flex: 1;
  order: 2;
  min-width: 250px;
}
.drop-zone-label {
  font-weight: 800;
  margin-bottom: 15px;
  color: #4a5568;
  text-transform: uppercase;
  font-size: 14px;
}
.matching-drop-zone {
  margin-bottom: 15px;
  background: white;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #edf2f7;
}
.draggable-item {
  background: #ffffff;
  padding: 12px 20px;
  border: 1px solid #e2e8f0;
  border-left: 6px solid var(--sdev-primary);
  border-radius: 10px;
  cursor: grab;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
  display: block;
}
.draggable-item.used {
  display: none !important;
}
.drop-zone-target {
  min-height: 55px;
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
.drop-zone-target.filled {
  border-style: solid;
  border-color: #48bb78;
  background: #f0fff4;
  color: #065f46;
}
.dropped-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}
.remove-btn {
  background: #fff;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   7. PROGRESS & TIMER
   ========================================== */
.sdev-qz-progress-container {
  margin-bottom: 30px;
}
.quiz-progress-bar {
  height: 12px;
  background: #edf2f7;
  border-radius: 20px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--sdev-primary);
  width: 0%;
  transition: width 0.4s ease;
}
.progress-text {
  font-size: 14px;
  color: #4a5568;
  margin-top: 8px;
  text-align: right;
  font-weight: 700;
}
.sdev-qz-timer-container {
  margin-top: 15px;
  display: flex;
  justify-content: center;
}
.timer-display {
  background: #2d3748;
  color: white;
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 700;
  font-family: monospace;
  font-size: 24px;
}

/* ==========================================
   8. BUTTONS & INPUTS
   ========================================== */
.sdev-qz-submit,
.step-btn {
  padding: 16px 30px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  font-size: 18px;
  border: none;
  background: var(--sdev-primary);
  color: white;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}
.sdev-qz-submit {
  width: 100%;
  margin-top: 30px;
  text-transform: uppercase;
}
.sdev-qz-text-input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.sdev-qz-text-input:focus {
  border-color: var(--sdev-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ==========================================
   9. NEW POPUP (MODAL) CLASSES
   ========================================== */
.sdev-qz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}
.sdev-qz-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.sdev-qz-modal {
  background: #ffffff;
  width: 90%;
  max-width: 450px;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 30px;
  border-top: 8px solid var(--sdev-primary);
  position: relative;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}
.sdev-qz-modal-overlay.active .sdev-qz-modal {
  transform: scale(1);
}
.sdev-qz-close-modal {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 100%;
  margin-top: 15px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: color 0.2s;
}
.sdev-qz-close-modal:hover {
  color: #694747;
  text-decoration: underline;
}

/* ==========================================
   10. RESULTS & REVIEW
   ========================================== */
.sdev-qz-guest-error {
  border: 2px solid #ef4444;
  background: #fee2e2;
  padding: 20px;
  text-align: center;
  color: #b91c1c;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: bold;
}
.sdev-inline-error {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #b91c1c;
  padding: 10px 15px;
  margin-top: 15px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.result-emoji-large {
  font-size: 60px;
  margin-bottom: 5px;
}
.result-msg-large {
  font-size: 40px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.1;
}
.result-perc-container {
  font-size: 28px;
  font-weight: 700;
  opacity: 0.95;
  margin-bottom: 20px;
}
.result-perc-strong {
  font-size: 40px;
  border-bottom: 3px solid rgba(255, 255, 255, 0.5);
}
.result-score-box-custom {
  background: rgba(255, 255, 255, 0.25);
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 22px;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.review-main-heading {
  text-align: center;
  margin-bottom: 40px;
  font-size: 28px;
  color: #2d3748;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.share-section-wrapper {
  margin-top: 20px;
  background: linear-gradient(90deg, #ff8a00, #e52e71);
  background-size: 200% 100%;
  animation: shimmer 3s infinite linear;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 5px 5px 5px 5px rgba(5, 0, 0, 0.541);
}
.share-title-text {
  color: yellow;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
}
.sdev-qz-certificate-section {
  background: linear-gradient(90deg, #ff8a00, #e52e71);
  background-size: 200% 100%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 25px;
  border-radius: 10px;
  margin-top: 30px;
  text-align: center;
  backdrop-filter: blur(15px);
  box-shadow: 5px 5px 5px 5px rgba(5, 0, 0, 0.541);
  animation: shimmer 2s infinite linear;
}
.sdev-qz-certificate-section h3 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 10px;
}

.cert-download-btn {
  padding: 10px 15px;
  color: #d7fda5;
  font-size: 20px;
  display: inline-block;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0%;
  }
  100% {
    background-position: -100% 0%;
  }
}

.sdev-qz-result {
  text-align: center;
  padding: 50px;
  border-radius: 10px;
  color: white;
  margin-bottom: 30px;
  box-shadow: 5px 5px 5px 1px rgba(5, 0, 0, 0.541);
}
.sdev-qz-result.excellent,
.sdev-qz-result.good {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.sdev-qz-result.needs-improvement {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.review-question {
  background: white;
  border: 1px solid #cacaca;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 5px;
  font-size: 14px;
  box-shadow: 5px 5px 5px 1px rgba(5, 0, 0, 0.541);
}
.review-question.correct {
  border-left: 6px solid #10b981;
}
.review-question.incorrect {
  border-left: 6px solid #ef4444;
}

.sdev-share-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.share-btn {
  padding: 12px 25px;
  border-radius: 50px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.share-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}
.share-facebook {
  background: linear-gradient(135deg, #1877f2 0%, #0e5a9e 100%);
}
.share-twitter {
  background: black;
}

.sdev-qz-retake {
  text-align: center;
  margin-top: 0px;
  padding-top: 1px;
}

/* ==========================================
   11. MOBILE BASE (THEME-PROOF & COMPACT)
   ========================================== */
@media (max-width: 768px) {
  .sdev-qz-container,
  body #sdev-qz-intro-screen.quiz-start-screen {
    padding: 15px;
    margin: 0;
    border-radius: 10px;
    width: 100%;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }
  .sdev-qz-header h2 {
    font-size: 22px;
  }
  .sdev-qz-meta {
    font-size: 13px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .sdev-qz-question {
    padding: 15px;
  }
  .sdev-qz-qtext {
    font-size: 18px;
    flex-direction: column;
    gap: 10px;
  }
  .sdev-qz-option-wrapper label {
    padding: 14px 15px;
    font-size: 16px;
    min-height: 50px;
  }
  .sdev-qz-submit,
  .step-btn,
  body #sdev-qz-intro-screen button.start-btn {
    width: 100%;
    max-width: none;
    padding: 16px;
    font-size: 16px;
  }

  .matching-container {
    flex-direction: column;
  }
  .matching-right-column {
    order: 1;
    width: 100%;
    background: #f8faff;
    border: 2px dashed var(--sdev-primary);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
  }
  .matching-left-column {
    order: 2;
    width: 100%;
  }

  /* Mobile Modal Fixes */
  .sdev-qz-modal {
    padding: 20px;
  }

  /* 🔥 MOBILE RESULT COMPACT FIXES 🔥 */
  .sdev-qz-result {
    padding: 25px 15px;
    margin-bottom: 20px;
  }
  .result-emoji-large {
    font-size: 35px;
    margin-bottom: 0;
  }
  .result-msg-large {
    font-size: 26px;
    margin-bottom: 5px;
  }
  .result-perc-container {
    font-size: 18px;
    margin-bottom: 15px;
  }
  .result-perc-strong {
    font-size: 26px;
  }
  .result-score-box-custom {
    font-size: 16px;
    padding: 8px 15px;
  }
  .review-main-heading {
    font-size: 22px;
  }

  /* Certificate Compact */
  .sdev-qz-certificate-section {
    padding: 15px;
    margin-top: 15px;
  }
  .sdev-qz-certificate-section div[style*="font-size:40px"] {
    font-size: 30px !important;
    margin-bottom: 5px !important;
  }
  .sdev-qz-certificate-section h3 {
    font-size: 18px;
    margin-bottom: 5px;
    line-height: 1.3;
  }
  .sdev-qz-certificate-section p {
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.3;
  }
  .cert-download-btn {
    padding: 10px 15px;
    color: #d7fda5;
    font-size: 18px;
    display: inline-block;
  }

  /* Share Section Compact */
  .share-section-wrapper {
    padding: 15px;
    margin-top: 15px;
  }
  .share-title-text {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .sdev-share-buttons {
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }
  .share-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 15px;
    font-size: 14px;
  }
}
