@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;600;700;800;900&family=Amiri:wght@400;700&display=swap');

:root {
  --bg-top: #87CEEB;
  --bg-bottom: #B0E0E6;
  --accent: #1E3A8A;
  --text-primary: #1E3A5F;
  --text-secondary: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.4);
  --transition-speed: 1s;
}

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

body {
  font-family: 'Prompt', sans-serif;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text-primary);
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
  overflow-x: hidden;
}

/* ===== OCEAN BACKGROUND LAYERS ===== */
#oceanBg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

#oceanBg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: center var(--bg-y, 0%);
  background-repeat: no-repeat;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* Waves */
.wave-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 1s ease;
}

.wave-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.wave1 {
  animation: waveMove 8s ease-in-out infinite;
}

.wave2 {
  animation: waveMove 6s ease-in-out infinite reverse;
  opacity: 0.5;
}

@keyframes waveMove {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-20px);
  }
}

/* Bubbles */
.bubble {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: bubbleRise linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes bubbleRise {
  0% {
    transform: translateY(100vh) scale(0.5);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Light Rays */
.light-rays {
  position: fixed;
  top: -50%;
  left: -10%;
  width: 120%;
  height: 100%;
  background: repeating-linear-gradient(105deg,
      transparent,
      transparent 40px,
      rgba(255, 255, 200, 0.03) 40px,
      rgba(255, 255, 200, 0.06) 80px);
  pointer-events: none;
  z-index: 1;
  animation: rayShimmer 10s ease-in-out infinite;
  transition: opacity 1s ease;
}

@keyframes rayShimmer {

  0%,
  100% {
    opacity: 0.6;
    transform: rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: rotate(1deg);
  }
}

/* Bioluminescence */
.bio-dot {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 200, 255, 0.8), transparent 70%);
  animation: bioPulse ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes bioPulse {

  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.8);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

/* ===== NAVIGATION ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 1s ease;
}

nav .inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

nav .logo-icon {
  width: 32px;
  height: 32px;
  color: #1E3A8A;
}

nav .logo-title {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1E3A8A;
}

nav .logo-sub {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #1E3A8A;
}

/* ===== MAIN CONTENT ===== */
main {
  position: relative;
  z-index: 10;
  max-width: 520px;
  margin: 0 auto;
  padding: 80px 1.5rem 6rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

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

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

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

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  }

  50% {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
  }
}

.anim-fade {
  animation: fadeIn 0.6s ease-out forwards;
}

.anim-slide {
  animation: slideUp 0.6s ease-out forwards;
}

.anim-zoom {
  animation: zoomIn 0.5s ease-out forwards;
}

/* ===== HOME PAGE ===== */
.home-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.home-hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.home-hero .concept {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  direction: rtl;
}

.home-hero .desc {
  font-size: 1rem;
  color: var(--text-primary);
  opacity: 0.7;
  max-width: 320px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

.start-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* ===== CONCEPT CARD ===== */
.concept-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  padding: 2rem;
  text-align: left;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  margin-top: 1.5rem;
  color: var(--text-primary);
}

.concept-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  text-align: center;
}

.concept-card p {
  font-size: 0.9rem;
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 1rem;
  text-indent: 1.5rem;
}

.concept-card p:last-child {
  margin-bottom: 0;
}

.btn-start {
  width: 100%;
  padding: 1.1rem;
  border: none;
  border-radius: 1rem;
  background: var(--accent);
  color: #fff;
  font-family: 'Prompt', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-start:hover {
  transform: scale(1.03);
}

.btn-start:active {
  transform: scale(0.97);
}

.mbti-ref {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.3;
  margin-top: 0.8rem;
}

/* ===== FORM ===== */
.form-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  padding: 2rem;
}

.form-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.8);
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  color: #333;
  transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== SECTION INTRO ===== */
.section-intro {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeIn 0.8s ease-out;
}

.section-intro .depth-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.section-intro .section-num {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

.section-intro h2 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.section-intro .section-desc {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.btn-continue {
  padding: 0.9rem 2.5rem;
  border: none;
  border-radius: 1rem;
  background: var(--accent);
  color: #fff;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-continue:hover {
  transform: scale(1.05);
}

/* ===== QUIZ ===== */
.quiz-header {
  margin-bottom: 1.5rem;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.8rem;
}

.quiz-meta .label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
}

.quiz-meta .topic {
  font-size: 0.85rem;
  font-weight: 800;
}

.quiz-meta .counter {
  font-size: 1.1rem;
  font-weight: 800;
}

.quiz-meta .counter span {
  opacity: 0.3;
}

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  padding: 2px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.5s ease-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.quiz-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  padding: 2rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.choice-btn {
  width: 100%;
  padding: 1.1rem 1rem;
  text-align: left;
  border-radius: 1.2rem;
  border: 2px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  transition: all 0.3s;
  position: relative;
}

.choice-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
}

.choice-btn.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.choice-btn .letter {
  width: 40px;
  height: 40px;
  border-radius: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.choice-btn.selected .letter {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.choice-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.8rem 0;
  color: rgba(0, 0, 0, 0.15);
}

.choice-divider span {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.choice-divider hr {
  flex: 1;
  border: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0 0.5rem;
}

.btn-nav {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 2rem;
  background: transparent;
  font-family: 'Prompt', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
  opacity: 0.6;
  transition: all 0.3s;
}

.btn-nav:hover {
  opacity: 1;
}

.btn-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.btn-result {
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 1rem;
  background: #10B981;
  color: #fff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-result:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-result:hover {
  transform: scale(1.05);
}

/* ===== DEPTH INDICATOR ===== */
.depth-indicator {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.depth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.5s;
}

.depth-dot.active {
  background: var(--accent);
  width: 10px;
  height: 10px;
  box-shadow: 0 0 10px var(--accent);
}

.depth-dot.done {
  background: rgba(255, 255, 255, 0.6);
}

/* ===== RESULT ===== */
.result-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 2.5rem;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
  animation: zoomIn 0.8s ease-out;
}

.result-header {
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.result-header .congrats {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.result-header h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
}

.result-header .subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.result-header .mbti-badge {
  display: inline-block;
  padding: 0.4rem 1.5rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-weight: 800;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-body {
  padding: 2rem;
}

.result-section {
  margin-bottom: 1.5rem;
}

.result-section .section-label {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #111;
  opacity: 1;
  margin-bottom: 0.5rem;
}

.result-section p,
.result-section li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
}

.result-section ul {
  list-style: none;
  padding: 0;
}

.result-section ul li::before {
  content: "• ";
  color: var(--accent);
  font-weight: 800;
}

.btn-retry {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.04);
  color: #888;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}

.btn-retry:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #555;
}

/* ===== GALLERY ===== */
.gallery-title {
  text-align: center;
  margin: 3rem 0 1.5rem;
}

.gallery-title h3 {
  font-size: 1.5rem;
  font-weight: 900;
}

.gallery-title p {
  font-size: 0.85rem;
  opacity: 0.5;
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.gallery-item {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 1.2rem;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.gallery-item:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.gallery-item .gi-badge {
  width: 44px;
  height: 44px;
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.gallery-item .gi-info {
  flex: 1;
  min-width: 0;
}

.gallery-item .gi-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.gallery-item .gi-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-overlay.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 40, 0.6);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 2rem 2rem 0 0;
  animation: slideUp 0.4s ease-out;
}

.modal-header {
  padding: 2rem;
  color: #fff;
  flex-shrink: 0;
}

.modal-header .mh-code {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.6;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 900;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

.modal-body .mb-section {
  margin-bottom: 1.5rem;
}

.modal-body .mb-label {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #111;
  opacity: 1;
  margin-bottom: 0.5rem;
}

.modal-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #555;
}

.modal-body ul {
  list-style: none;
  padding: 0;
}

.modal-body ul li {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #555;
}

.modal-body ul li::before {
  content: "• ";
  color: var(--accent);
  font-weight: 800;
}

.btn-modal-close {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 1rem;
  background: #f1f3f5;
  color: #666;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
}

/* ===== FOOTER ===== */
footer {
  position: fixed;
  bottom: 8px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  color: var(--text-primary);
  transition: color 1s ease;
}

footer .ft-brand {
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

footer .ft-copy {
  font-size: 0.45rem;
  font-weight: 600;
  opacity: 0.7;
  margin-top: 2px;
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 2rem;
    margin: 1rem;
  }

  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }
}