/* ========= GLOBAL & DEEP OCEAN THEME ========= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: radial-gradient(circle at 30% 20%, #0a3b3f, #06212e, #021018);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  padding: clamp(12px, 3vw, 40px);
  position: relative;
  overflow-x: hidden;
}

/* ========= BACKGROUND ORBS ========= */
.bg-orb {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: float 20s infinite alternate;
}

.orb-1 {
  top: 5%;
  left: -10%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2), transparent);
}

.orb-2 {
  bottom: 0%;
  right: -10%;
  background: radial-gradient(circle, rgba(0, 200, 255, 0.35), transparent);
  animation-duration: 25s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 50px) scale(1.2);
  }
}

/* ========= PORTAL CONTAINER ========= */
.portal-container {
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  opacity: 1;
}

/* Optional fade-in effect */
.portal-container.fade-in {
  animation: fadeIn 0.7s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========= HERO CARD ========= */
.hero-card {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  border-radius: clamp(16px, 5vw, 48px);
  padding: clamp(20px, 4vw, 48px);
  margin-bottom: clamp(24px, 5vw, 48px);
  text-align: center;
  border: 1px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 200, 180, 0.2);
  padding: 6px 18px;
  border-radius: 40px;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 215, 0, 0.6);
  color: #7fffd4;
}

.main-title {
  font-size: clamp(1.6rem, 8vw, 3.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #5eead4, #14b8a6);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.main-title .subtitle {
  font-size: 0.65em;
  background: linear-gradient(135deg, #facc15, #ffaa44);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.subhead {
  font-size: clamp(0.9rem, 3vw, 1.3rem);
  opacity: 0.9;
  color: #ccf4e6;
}

.divider {
  width: clamp(80px, 12vw, 160px);
  height: 4px;
  background: linear-gradient(to right, #ffdd00, #14b8a6);
  margin: 20px auto 0;
  border-radius: 4px;
}

/* ========= MENU BUTTON ========= */
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: linear-gradient(145deg, #0d9488, #0f766e);
  border: 2px solid #ffcc00;
  padding: 0.7rem 1.8rem;
  border-radius: 3rem;
  color: white;
  font-weight: bold;
  text-decoration: none;
  margin-top: 1.5rem;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
  transition: all 0.3s ease;
}

.menu-btn i {
  font-size: 1.2rem;
  color: #ffcc00;
}

.menu-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(20, 184, 166, 0.6);
  border-color: #ffaa00;
}

/* ========= SETS GRID ========= */
.sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.set-card {
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  border: 2px solid #ffcc00;
  border-radius: 2rem;
  padding: 1rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: clamp(0.85rem, 3vw, 1.1rem);
  color: white;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.5);
  isolation: isolate;
}

.set-card span {
  display: block;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.set-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 30px -8px #14b8a6;
  border-color: transparent;
}

.set-card:hover::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 2rem;
  padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), #ffdd00, #ffaa33, #ff6600, #ffdd00);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  animation: rotate-border 1.2s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-border {
  100% {
    --angle: 360deg;
  }
}

/* ========= INFO BANNER ========= */
.info-banner {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border-radius: clamp(12px, 3vw, 28px);
  padding: clamp(12px, 3vw, 24px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  margin: 30px 0 20px;
  border-left: 5px solid #ffcc00;
  flex-wrap: wrap;
  color: #d4faf0;
}

.info-banner i {
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  color: #ffcc00;
}

.banner-text {
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  flex: 1;
}

/* ========= FOOTER ========= */
.portal-footer {
  margin-top: clamp(30px, 6vw, 70px);
  text-align: center;
  font-size: clamp(0.65rem, 2vw, 0.85rem);
  border-top: 1px solid rgba(255, 204, 0, 0.3);
  padding-top: 20px;
  color: #bbefe5;
}

.portal-footer .footer-small {
  margin-top: 8px;
  font-size: 0.75rem;
}

/* ========= EXAM PAGE ========= */
.timer-section {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: white;
  margin: 1rem;
  padding: 0.8rem 1.2rem;
  border-radius: 3rem;
  gap: 0.5rem;
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.timer {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: bold;
  color: #ffdd00;
}

/* ========= QUESTION NAVIGATOR ========= */
.question-navigator {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2rem;
}

.nav-circle {
  width: clamp(30px, 6vw, 38px);
  height: clamp(30px, 6vw, 38px);
  border-radius: 50%;
  background-color: #e74c3c;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  transition: 0.1s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-circle.answered {
  background-color: #2ecc71;
}

.nav-circle.active-question {
  border: 3px solid #ffcc00;
  transform: scale(1.08);
}

.nav-circle:hover {
  outline: 2px solid #ffcc00;
  transform: scale(1.05);
}

/* ========= PASSAGE / ARTICLE ========= */
.passage-card {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 1.5rem;
  padding: 1.2rem;
  margin: 1rem;
  border-left: 5px solid #14b8a6;
}

.article-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.article-images img {
  max-width: 100%;
  border-radius: 1rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  background: #1a2a32;
}

@media (min-width: 768px) {
  .article-images img {
    max-width: calc(50% - 1rem);
    flex: 1 1 auto;
  }
}

.passage-text {
  line-height: 1.6;
  color: #f0f0f0;
  font-size: 1rem;
}

/* ========= QUESTION CONTAINER ========= */
.question-container {
  padding: 0.5rem 1rem;
}

.question {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 1.2rem;
  border-radius: 1.5rem;
  border-left: 5px solid #14b8a6;
}

.question-number {
  font-weight: bold;
  color: #7fffd4;
  margin-bottom: 0.8rem;
  font-size: clamp(1rem, 4vw, 1.3rem);
}

.question-text {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.8rem;
  border-radius: 0.8rem;
  margin-bottom: 1rem;
  color: white;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  line-height: 1.4;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}

.option {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 204, 0, 0.5);
  border-radius: 1rem;
  padding: 0.8rem;
  cursor: pointer;
  font-weight: bold;
  color: white;
  transition: 0.2s;
  touch-action: manipulation;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
}

.option.selected {
  background: #14b8a6;
  border-color: #ffcc00;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.6);
}

.option:hover {
  border-color: #ffcc00;
  background: rgba(20, 184, 166, 0.4);
}

/* ========= NAVIGATION BUTTONS ========= */
.navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.navigation button {
  padding: 0.7rem 1.5rem;
  border-radius: 2rem;
  border: none;
  font-weight: bold;
  background: linear-gradient(145deg, #0d9488, #0f766e);
  color: white;
  cursor: pointer;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  min-height: 48px;
  min-width: 120px;
  transition: all 0.2s;
}

.navigation button:disabled {
  background: #4a5568;
  opacity: 0.6;
  cursor: not-allowed;
}

.navigation button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(20, 184, 166, 0.4);
  border: 1px solid #ffcc00;
}

/* ========= PDF REPORT ========= */
.pdf-report {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 2rem;
  padding: 2rem;
  margin: 1rem;
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.pdf-header {
  border-bottom: 2px solid #ffcc00;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.pdf-header h1,
.pdf-header h2,
.pdf-header .timestamp,
#pdfTitle,
#pdfScore,
#pdfTotal,
.timestamp {
  color: #ffdd00 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#pdfContent {
  max-height: 70vh;
  overflow-y: auto;
  text-align: left;
  color: #e0e0e0;
}

#pdfContent div {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.pdf-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.set-btn {
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  border: none;
  border-radius: 2rem;
  padding: 0.6rem 1.5rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: 0.2s;
  min-height: 44px;
}

.set-btn:hover {
  transform: translateY(-2px);
  border: 1px solid #ffcc00;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

/* ========= REPORT ITEMS ========= */
.report-item {
  border-left: 6px solid;
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
}

.report-item.correct {
  border-left-color: #2ecc71;
}

.report-item.incorrect {
  border-left-color: #e74c3c;
}

.option-analysis {
  margin-top: 5px;
}

.opt-correct {
  color: #2ecc71;
  font-weight: bold;
}

.opt-incorrect {
  color: #e74c3c;
}

/* ========= UTILITY ========= */
.hidden {
  display: none !important;
}

/* ========= RESPONSIVE BREAKPOINTS ========= */
@media (max-width: 680px) {
  body {
    padding: 0.8rem;
  }

  .sets-grid {
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .set-card {
    padding: 0.6rem 0.2rem;
    font-size: 0.8rem;
  }

  .options {
    grid-template-columns: 1fr;
  }

  .navigation {
    flex-direction: column;
  }

  .navigation button {
    width: 100%;
    min-width: auto;
  }

  .info-banner {
    flex-direction: column;
    text-align: center;
    border-left: none;
    border-top: 5px solid #ffcc00;
  }

  .nav-circle {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .timer-section {
    justify-content: center;
    flex-wrap: wrap;
  }

  .timer {
    white-space: normal;
    text-align: center;
  }

  .pdf-buttons {
    flex-direction: column;
  }

  .set-btn {
    width: 100%;
  }
}

@media (min-width: 681px) and (max-width: 1024px) {
  .sets-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.2rem;
  }

  .set-card {
    padding: 0.8rem 0.3rem;
    font-size: 1rem;
  }

  .options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) and (max-width: 1919px) {
  .sets-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
  }

  .options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1920px) {
  .portal-container {
    max-width: 2000px;
  }

  .sets-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
  }

  .set-card {
    padding: 1.2rem 0.5rem;
    font-size: 1.3rem;
  }

  .main-title {
    font-size: 4rem;
  }

  .subhead {
    font-size: 1.5rem;
  }

  .timer {
    font-size: 2rem;
  }

  .nav-circle {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }

  .option {
    font-size: 1.2rem;
    padding: 1rem;
  }

  .question-text {
    font-size: 1.3rem;
  }

  .passage-text {
    font-size: 1.2rem;
  }

  .navigation button {
    padding: 1rem 2rem;
    font-size: 1.3rem;
    min-width: 160px;
  }

  .set-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
  }
}

@media (min-width: 3840px) {
  .portal-container {
    max-width: 3800px;
  }

  .sets-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
  }

  .set-card {
    padding: 1.5rem 0.8rem;
    font-size: 1.6rem;
  }

  .main-title {
    font-size: 6rem;
  }

  .subhead {
    font-size: 2rem;
  }

  .timer {
    font-size: 2.5rem;
  }

  .nav-circle {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }

  .option {
    font-size: 1.5rem;
    padding: 1.2rem;
  }

  .question-text {
    font-size: 1.6rem;
  }

  .passage-text {
    font-size: 1.5rem;
  }

  .navigation button {
    padding: 1.2rem 2.5rem;
    font-size: 1.6rem;
  }

  .set-btn {
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
  }
}

/* ========= PRINT STYLES ========= */
@media print {
  body {
    background: white;
    padding: 0;
    margin: 0;
  }

  .bg-orb,
  .hero-card .menu-btn,
  .divider,
  .header-badge,
  .pdf-buttons,
  .navigation,
  .timer-section,
  .question-navigator,
  .set-btn,
  .menu-btn,
  .hero-card,
  .portal-container > .hero-card {
    display: none !important;
  }

  .pdf-report {
    display: block !important;
    background: white;
    margin: 0;
    padding: 0.5in;
    border: none;
    box-shadow: none;
    position: static;
  }

  .pdf-report * {
    color: black !important;
    background: transparent !important;
    text-shadow: none !important;
  }

  .pdf-report h1,
  .pdf-report h2,
  .pdf-report .timestamp,
  .pdf-header h1,
  .pdf-header h2,
  .pdf-header .timestamp,
  #pdfTitle,
  #pdfScore,
  #pdfTotal,
  .timestamp {
    color: black !important;
  }

  #pdfContent {
    max-height: none !important;
    overflow: visible !important;
  }

  #pdfContent div {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc;
    background: #f9f9f9 !important;
    color: black !important;
  }

  .corrected-passage,
  .pdf-header {
    break-inside: avoid;
  }
}