/* ========= 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);
}

.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;
}

.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;
  cursor: pointer;
}

.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;
}

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

/* ========= 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);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.set-card span {
  position: relative;
  z-index: 2;
}

.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;
}

.set-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
  background: linear-gradient(145deg, #6b7280, #4b5563);
}

.set-card.coming-soon:hover::after {
  display: none;
}

.set-card.coming-soon:hover {
  transform: none;
}

@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;
}

.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;
  color: #d4faf0;
}

.error-banner {
  background: rgba(255, 80, 80, 0.2);
  border-left-color: #e74c3c;
}

/* ========= FOOTER ========= */
.portal-footer {
  margin-top: clamp(30px, 6vw, 70px);
  text-align: center;
  font-size: clamp(0.65rem, 2vw, 0.85rem);
  opacity: 0.8;
  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.5rem;
  border-radius: 3rem;
  border: 1px solid rgba(255, 204, 0, 0.3);
  flex-wrap: wrap;
}

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

/* ========= PASSAGE ========= */
.passage {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 25px;
  border-radius: 1.5rem;
  margin: 1rem;
  line-height: 1.8;
  border: 1px solid rgba(255, 215, 0, 0.3);
  max-height: 500px;
  overflow-y: auto;
  font-size: 1rem;
  color: #fef7e0;
}

.passage p {
  margin-bottom: 1.2em;
  text-align: justify;
}

.error-word {
  display: inline;
  border-bottom: 2px solid #ffb347;
  margin: 0 2px;
  background-color: rgba(0, 13, 255, 0.416);
  padding: 0 2px;
  border-radius: 6px;
}

.error-number {
  font-size: 0.85em;
  color: #ffcc88;
  font-weight: bold;
  margin-right: 3px;
}

/* ========= CORRECTION SECTION ========= */
.correction-section {
  margin-top: 20px;
  padding: 20px;
  background: rgba(20, 184, 166, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.correction-section h3 {
  color: #ffdd99;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.correction-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 1rem;
  overflow: hidden;
}

.correction-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 12px 4px;
}

.correction-item label {
  font-weight: bold;
  color: #ffdd88;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.correction-item input {
  width: 100%;
  max-width: 130px;
  padding: 8px;
  border-radius: 2rem;
  border: 1px solid #ffcc00;
  background: #1e2a3a;
  color: #ffffff;
  text-align: center;
  font-size: 0.9rem;
  transition: 0.1s;
}

.correction-item input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 6px #14b8a6;
}

/* ========= NAVIGATION ========= */
.navigation {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.submit-btn {
  background: linear-gradient(145deg, #2ecc71, #27ae60);
  border: 2px solid #ffcc00;
  padding: 0.8rem 2rem;
  border-radius: 3rem;
  font-weight: bold;
  font-size: 1rem;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.submit-btn:disabled {
  background: #6c757d;
  border-color: #aaa;
  cursor: not-allowed;
  opacity: 0.6;
}

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

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

.pdf-header h1 {
  color: #ffdd88;
  font-size: 1.8rem;
}

.pdf-header h2 {
  color: #ffcc66;
  margin-top: 0.5rem;
}

.timestamp {
  color: #bbefe5;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.pdf-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  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;
}

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

/* ========= REPORT ITEMS ========= */
.answer-result {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 5px solid #14b8a6;
  color: #f0f0f0;
}

.answer-result.correct {
  border-left-color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
}

.answer-result.incorrect {
  border-left-color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
}

.answer-result.no-answer {
  border-left-color: #f39c12;
  background: rgba(243, 156, 18, 0.15);
}

.status-icon {
  font-weight: bold;
}

.explanation {
  font-size: 0.9em;
  color: #e0e8f0;
  margin-top: 8px;
  padding-left: 8px;
  border-left: 2px solid #ffcc00;
}

.corrected-passage {
  background: rgba(46, 204, 113, 0.1);
  padding: 20px;
  border-radius: 1rem;
  margin-top: 20px;
  border: 1px solid #2ecc71;
  color: #e0ffe0;
}

.corrected-passage h4 {
  color: #ffdd88;
}

.correct-highlight {
  background-color: #2e7d32;
  font-weight: bold;
  padding: 0 6px;
  border-radius: 12px;
  color: white;
  display: inline-block;
  margin: 2px 2px;
}

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

/* ========= RESPONSIVE BREAKPOINTS ========= */
@media (max-width: 768px) {
  .correction-boxes {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

  .timer-section {
    flex-direction: column;
    gap: 8px;
  }

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

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

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

@media (max-width: 400px) {
  .correction-item input {
    max-width: 90px;
    font-size: 0.8rem;
  }
}

@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;
  }
}

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

@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;
  }

  .timer {
    font-size: 2rem;
  }

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

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

  .bg-orb,
  .hero-card,
  .timer-section,
  .navigation,
  .correction-section,
  .pdf-buttons,
  .menu-btn,
  .info-banner,
  .portal-footer {
    display: none !important;
  }

  .pdf-report {
    display: block !important;
    background: white;
    margin: 0;
    padding: 1rem;
    border: none;
    color: black;
  }

  .pdf-report * {
    color: black !important;
  }

  .answer-result {
    background: #f5f5f5;
    border-left: 3px solid #333;
  }

  .corrected-passage {
    background: #eaf7ea;
  }

  .correct-highlight {
    background: #c8e6c9;
    color: black;
  }
}