@import url('chakra-tokens.css');

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

.temple-hallway {
  font-family: 'Cormorant Garamond', 'Playfair Display', serif;
  min-height: 100vh;
  color: #f4e4bc;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.temple-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.temple-background .bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.temple-background .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(10, 8, 25, 0.2) 0%,
    rgba(15, 11, 36, 0.3) 50%,
    rgba(10, 8, 25, 0.4) 100%
  );
  pointer-events: none;
}

.fireflies {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff8c4 0%, #ffd700 40%, transparent 70%);
  border-radius: 50%;
  animation: fireflyFloat 8s ease-in-out infinite, fireflyGlow 2s ease-in-out infinite alternate;
  box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.6), 0 0 20px 6px rgba(255, 200, 100, 0.3);
  will-change: transform, opacity;
}

@keyframes fireflyFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  25% { transform: translate(30px, -40px) scale(1.2); opacity: 1; }
  50% { transform: translate(-20px, -60px) scale(0.8); opacity: 0.6; }
  75% { transform: translate(40px, -30px) scale(1.1); opacity: 1; }
}

@keyframes fireflyGlow {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.light-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background-image: 
    radial-gradient(2px 2px at 10% 20%, rgba(255, 215, 0, 0.3), transparent),
    radial-gradient(2px 2px at 90% 30%, rgba(255, 215, 0, 0.2), transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(255, 215, 0, 0.3), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(255, 215, 0, 0.2), transparent),
    radial-gradient(3px 3px at 50% 10%, rgba(255, 255, 255, 0.4), transparent);
  animation: particlesDrift 20s ease-in-out infinite;
  will-change: transform;
}

@keyframes particlesDrift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.sound-toggle {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(244, 228, 188, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(212, 181, 106, 0.4);
  padding: 10px 18px;
  border-radius: 25px;
  color: #f4e4bc;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sound-toggle:hover {
  background: rgba(244, 228, 188, 0.25);
  border-color: rgba(212, 181, 106, 0.6);
}

.sound-toggle .sound-icon {
  width: 20px;
  height: 20px;
}

.sound-toggle .sound-waves {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.temple-content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.temple-header {
  text-align: center;
  padding: 30px 20px 20px;
}

.temple-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  color: #f4e4bc;
  text-shadow: 0 2px 20px rgba(212, 181, 106, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
  margin-bottom: 0.3em;
  animation: fadeInDown 1s ease-out;
}

.temple-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: rgba(244, 228, 188, 0.85);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  animation: fadeInDown 1s ease-out 0.2s both;
}

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

.hallway-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.doors-left,
.doors-right {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.central-altar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  min-width: 80px;
  position: relative;
}

.altar-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(255, 200, 100, 0.2) 40%, transparent 70%);
  border-radius: 50%;
  animation: altarPulse 4s ease-in-out infinite;
}

.altar-crystal {
  width: 60px;
  height: 80px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 215, 0, 0.6), rgba(255, 200, 150, 0.8));
  clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 200, 100, 0.4);
  animation: crystalGlow 3s ease-in-out infinite;
}

.altar-light-beam {
  position: absolute;
  top: -100%;
  width: 80px;
  height: 300%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 215, 0, 0.2) 50%, transparent);
  opacity: 0.4;
  animation: beamFlicker 5s ease-in-out infinite;
}

@keyframes altarPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 0.9; }
}

@keyframes crystalGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

@keyframes beamFlicker {
  0%, 100% { opacity: 0.3; }
  25% { opacity: 0.5; }
  50% { opacity: 0.35; }
  75% { opacity: 0.55; }
}

.chakra-door {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s ease;
  animation: doorFadeIn 0.8s ease-out both;
  width: 130px;
  min-width: 100px;
  flex-shrink: 1;
}

.chakra-door:nth-child(1) { animation-delay: 0.1s; }
.chakra-door:nth-child(2) { animation-delay: 0.2s; }
.chakra-door:nth-child(3) { animation-delay: 0.3s; }
.chakra-door:nth-child(4) { animation-delay: 0.4s; }

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

.door-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 160px;
  background: linear-gradient(180deg, 
    rgba(60, 40, 20, 0.9) 0%,
    rgba(80, 55, 30, 0.95) 50%,
    rgba(50, 35, 18, 0.9) 100%
  );
  border: 3px solid;
  border-image: linear-gradient(180deg, #c9a227, #8b6914, #c9a227) 1;
  border-radius: 50px 50px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 5px 20px rgba(0, 0, 0, 0.4);
}

.door-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  transition: opacity 0.4s ease;
}

.chakra-door:hover .door-glow {
  opacity: 0.7;
}

.door-root .door-glow { background: radial-gradient(circle at center, var(--chakra-root) 0%, transparent 70%); }
.door-sacral .door-glow { background: radial-gradient(circle at center, var(--chakra-sacral) 0%, transparent 70%); }
.door-solar .door-glow { background: radial-gradient(circle at center, var(--chakra-solar) 0%, transparent 70%); }
.door-heart .door-glow { background: radial-gradient(circle at center, var(--chakra-heart) 0%, transparent 70%); }
.door-throat .door-glow { background: radial-gradient(circle at center, var(--chakra-throat) 0%, transparent 70%); }
.door-third-eye .door-glow { background: radial-gradient(circle at center, var(--chakra-third-eye) 0%, transparent 70%); }
.door-crown .door-glow { background: radial-gradient(circle at center, var(--chakra-crown) 0%, transparent 70%); }

.rainbow-glow {
  background: radial-gradient(circle at center, 
    rgba(255, 100, 100, 0.5) 0%,
    rgba(255, 200, 100, 0.4) 20%,
    rgba(100, 255, 100, 0.4) 40%,
    rgba(100, 200, 255, 0.4) 60%,
    rgba(200, 100, 255, 0.5) 80%,
    transparent 100%
  ) !important;
  animation: rainbowPulse 3s ease-in-out infinite;
}

@keyframes rainbowPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.chakra-symbol {
  position: relative;
  z-index: 2;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px currentColor);
  transition: all 0.4s ease;
}

.symbol-svg {
  width: 100%;
  height: 100%;
}

.door-root .chakra-symbol { color: var(--chakra-root); }
.door-sacral .chakra-symbol { color: var(--chakra-sacral); }
.door-solar .chakra-symbol { color: var(--chakra-solar); }
.door-heart .chakra-symbol { color: var(--chakra-heart); }
.door-throat .chakra-symbol { color: var(--chakra-throat); }
.door-third-eye .chakra-symbol { color: var(--chakra-third-eye); }
.door-crown .chakra-symbol { color: var(--chakra-crown); }

.playroom-symbol {
  color: #ffd700;
  animation: playSymbolBounce 2s ease-in-out infinite;
}

@keyframes playSymbolBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.chakra-door:hover .chakra-symbol {
  transform: scale(1.15);
  filter: drop-shadow(0 0 20px currentColor);
}

.chakra-door:hover .door-frame {
  transform: scale(1.03);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 10px 30px rgba(0, 0, 0, 0.5);
}

.door-scroll {
  background: linear-gradient(135deg, #f4e4bc 0%, #e8d5a3 50%, #d4c28e 100%);
  border: 2px solid #8b6914;
  border-radius: 4px;
  padding: 10px 8px;
  margin-top: -8px;
  text-align: center;
  color: #3d2914;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(139, 105, 20, 0.1);
  position: relative;
  transition: all 0.3s ease;
  width: 100%;
}

.door-scroll::before,
.door-scroll::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: linear-gradient(90deg, #c9a227, #a08030, #c9a227);
  border-radius: 4px;
}

.door-scroll::before {
  top: -5px;
}

.door-scroll::after {
  bottom: -5px;
}

.door-scroll h3 {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: #2a1810;
  line-height: 1.2;
}

.door-scroll p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  font-style: italic;
  color: #5a4030;
  line-height: 1.2;
}

.playroom-scroll {
  background: linear-gradient(135deg, #fff8e8 0%, #ffe8d0 50%, #ffd8c0 100%);
}

.chakra-door:hover .door-scroll {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(139, 105, 20, 0.15);
}

.temple-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  color: rgba(244, 228, 188, 0.6);
  font-size: 0.85rem;
  background: linear-gradient(to top, rgba(10, 8, 25, 0.8), transparent);
}

@media (max-width: 1024px) {
  .hallway-container {
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .doors-left,
  .doors-right {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: none;
    justify-content: center;
    gap: 15px;
  }
  
  .chakra-door {
    width: calc(50% - 10px);
    max-width: 200px;
  }
  
  .central-altar {
    display: none;
  }
}

@media (max-width: 768px) {
  .temple-header {
    padding: 20px 15px 15px;
  }
  
  .temple-title {
    font-size: 1.8rem;
  }
  
  .temple-subtitle {
    font-size: 1rem;
  }
  
  .hallway-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 10px;
  }
  
  .doors-left,
  .doors-right {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .chakra-door {
    width: calc(50% - 8px);
    max-width: 180px;
  }
  
  .door-frame {
    max-height: 140px;
  }
  
  .chakra-symbol {
    width: 50px;
    height: 50px;
  }
  
  .door-scroll {
    padding: 10px 12px;
  }
  
  .door-scroll h3 {
    font-size: 0.9rem;
  }
  
  .door-scroll p {
    font-size: 0.8rem;
  }
  
  .sound-toggle {
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .temple-title {
    font-size: 1.5rem;
  }
  
  .temple-subtitle {
    font-size: 0.9rem;
  }
  
  .chakra-door {
    width: 100%;
    max-width: 200px;
  }
  
  .door-frame {
    max-height: 120px;
  }
  
  .chakra-symbol {
    width: 40px;
    height: 40px;
  }
  
  .door-scroll h3 {
    font-size: 0.85rem;
  }
  
  .door-scroll p {
    font-size: 0.75rem;
  }
  
  .sound-toggle .sound-label {
    display: none;
  }
}

.temple-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: linear-gradient(180deg, rgba(10, 8, 25, 0.9) 0%, rgba(10, 8, 25, 0.6) 70%, transparent 100%);
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 45px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.nav-logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 2px 8px rgba(200, 150, 62, 0.4));
}

.nav-menu-wrapper {
  position: relative;
}

.nav-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(200, 150, 62, 0.2);
  border: 1px solid rgba(200, 150, 62, 0.4);
  color: #f4e4bc;
  padding: 10px 18px;
  border-radius: 25px;
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-menu-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-menu-toggle:hover {
  background: rgba(200, 150, 62, 0.35);
  border-color: rgba(200, 150, 62, 0.6);
  box-shadow: 0 0 15px rgba(200, 150, 62, 0.3);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: rgba(25, 20, 45, 0.95);
  border: 1px solid rgba(200, 150, 62, 0.3);
  border-radius: 12px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
}

.nav-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 12px 20px;
  color: #f4e4bc;
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(200, 150, 62, 0.2);
  color: #C8963E;
  padding-left: 25px;
}

@media (max-width: 480px) {
  .temple-nav {
    padding: 10px 15px;
  }
  
  .nav-logo img {
    height: 35px;
  }
  
  .nav-menu-toggle {
    padding: 8px 14px;
    font-size: 0.9rem;
  }
  
  .nav-menu-toggle span {
    display: none;
  }
  
  .nav-dropdown {
    right: -10px;
    min-width: 180px;
  }
}
