/* ===== SACRED GEOMETRY & MYSTICAL PATTERNS ===== */

/* Sacred Geometric Backgrounds */
.sacred-geometry-bg {
  position: relative;
  overflow: hidden;
}

.sacred-geometry-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    /* Flower of Life Pattern */
    radial-gradient(circle at 50% 50%, transparent 19px, rgba(107, 70, 193, 0.1) 20px, rgba(107, 70, 193, 0.1) 21px, transparent 22px),
    radial-gradient(circle at 25% 25%, transparent 14px, rgba(212, 175, 55, 0.05) 15px, rgba(212, 175, 55, 0.05) 16px, transparent 17px),
    radial-gradient(circle at 75% 75%, transparent 14px, rgba(139, 21, 56, 0.08) 15px, rgba(139, 21, 56, 0.08) 16px, transparent 17px);
  background-size: 80px 80px, 60px 60px, 60px 60px;
  background-position: 0 0, 40px 40px, -20px -20px;
  opacity: 0.3;
  z-index: -1;
}

/* Trinity Symbol */
.trinity-symbol {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.trinity-symbol::before,
.trinity-symbol::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--sacred-gold);
  border-radius: 50%;
}

.trinity-symbol::before {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.trinity-symbol::after {
  bottom: 0;
  left: 0;
}

.trinity-symbol .third-circle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--sacred-gold);
  border-radius: 50%;
}

/* Merkaba Pattern */
.merkaba-pattern {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.merkaba-triangle {
  position: absolute;
  width: 0;
  height: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.merkaba-triangle.up {
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 52px solid rgba(107, 70, 193, 0.3);
  animation: merkabaSpin 8s linear infinite;
}

.merkaba-triangle.down {
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-top: 52px solid rgba(212, 175, 55, 0.3);
  animation: merkabaSpin 8s linear infinite reverse;
}

/* Sacred Spiral */
.sacred-spiral {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.spiral-path {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border: 2px solid var(--sacred-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
}

.spiral-path:nth-child(1) { 
  animation: spiralRotate 12s linear infinite;
}

.spiral-path:nth-child(2) { 
  width: 60px;
  height: 60px;
  border-color: var(--sacred-gold);
  animation: spiralRotate 8s linear infinite reverse;
}

.spiral-path:nth-child(3) { 
  width: 40px;
  height: 40px;
  border-color: var(--sacred-red);
  animation: spiralRotate 6s linear infinite;
}

/* Hexagram (Star of David) */
.hexagram {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.hexagram-triangle {
  position: absolute;
  width: 0;
  height: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hexagram-triangle.up {
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 60px solid rgba(107, 70, 193, 0.4);
}

.hexagram-triangle.down {
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-top: 60px solid rgba(212, 175, 55, 0.4);
}

/* Vesica Piscis */
.vesica-piscis {
  position: relative;
  width: 100px;
  height: 60px;
  margin: 0 auto;
}

.vesica-circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid var(--sacred-accent);
  border-radius: 50%;
  top: 0;
}

.vesica-circle.left {
  left: 0;
  animation: vesicaPulse 4s ease-in-out infinite;
}

.vesica-circle.right {
  right: 0;
  animation: vesicaPulse 4s ease-in-out infinite 2s;
}

/* Sacred Grid Overlay */
.sacred-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(107, 70, 193, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 70, 193, 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}

/* Fibonacci Spiral */
.fibonacci-spiral {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.fib-segment {
  position: absolute;
  border: 2px solid var(--sacred-gold);
  border-radius: 0 0 0 100%;
  opacity: 0.6;
}

.fib-segment:nth-child(1) {
  width: 20px;
  height: 20px;
  top: 60px;
  left: 60px;
  animation: fibGlow 6s ease-in-out infinite;
}

.fib-segment:nth-child(2) {
  width: 40px;
  height: 40px;
  top: 40px;
  left: 60px;
  animation: fibGlow 6s ease-in-out infinite 1s;
}

.fib-segment:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 40px;
  left: 20px;
  animation: fibGlow 6s ease-in-out infinite 2s;
}

/* Platonic Solids Representations */
.platonic-tetrahedron {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.tetrahedron-face {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  opacity: 0.7;
}

.face-1 {
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 52px solid rgba(107, 70, 193, 0.3);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: tetrahedronRotate 10s linear infinite;
}

/* Sacred Proportions - Golden Ratio */
.golden-rectangle {
  position: relative;
  width: 100px;
  height: 62px; /* Golden ratio: 100 / 1.618 */
  border: 2px solid var(--sacred-gold);
  margin: 0 auto;
}

.golden-rectangle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 62px;
  height: 62px;
  border: 2px solid var(--sacred-accent);
  opacity: 0.6;
}

/* Mandala Patterns */
.sacred-mandala {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.mandala-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid var(--sacred-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.4;
}

.mandala-ring:nth-child(1) {
  width: 120px;
  height: 120px;
  animation: mandalaRotate 20s linear infinite;
}

.mandala-ring:nth-child(2) {
  width: 90px;
  height: 90px;
  border-color: var(--sacred-gold);
  animation: mandalaRotate 15s linear infinite reverse;
}

.mandala-ring:nth-child(3) {
  width: 60px;
  height: 60px;
  border-color: var(--sacred-red);
  animation: mandalaRotate 10s linear infinite;
}

.mandala-ring:nth-child(4) {
  width: 30px;
  height: 30px;
  border-color: var(--sacred-blue);
  animation: mandalaRotate 8s linear infinite reverse;
}

/* Sacred Dot Patterns */
.sacred-dots {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.sacred-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--sacred-gold);
  border-radius: 50%;
  opacity: 0.7;
  animation: dotPulse 3s ease-in-out infinite;
}

.sacred-dot:nth-child(1) { top: 46px; left: 46px; } /* Center */
.sacred-dot:nth-child(2) { top: 20px; left: 46px; animation-delay: 0.5s; } /* Top */
.sacred-dot:nth-child(3) { top: 72px; left: 46px; animation-delay: 1s; } /* Bottom */
.sacred-dot:nth-child(4) { top: 46px; left: 20px; animation-delay: 1.5s; } /* Left */
.sacred-dot:nth-child(5) { top: 46px; left: 72px; animation-delay: 2s; } /* Right */
.sacred-dot:nth-child(6) { top: 28px; left: 28px; animation-delay: 2.5s; } /* Top-left */
.sacred-dot:nth-child(7) { top: 28px; left: 64px; animation-delay: 0.3s; } /* Top-right */
.sacred-dot:nth-child(8) { top: 64px; left: 28px; animation-delay: 0.8s; } /* Bottom-left */
.sacred-dot:nth-child(9) { top: 64px; left: 64px; animation-delay: 1.3s; } /* Bottom-right */

/* Tree of Life Pattern */
.tree-of-life {
  position: relative;
  width: 80px;
  height: 120px;
  margin: 0 auto;
}

.sephirah {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--sacred-gold);
  border: 1px solid var(--sacred-accent);
  border-radius: 50%;
  animation: sephirahGlow 4s ease-in-out infinite;
}

.sephirah:nth-child(1) { top: 0; left: 32px; } /* Kether */
.sephirah:nth-child(2) { top: 25px; left: 10px; animation-delay: 0.4s; } /* Chokmah */
.sephirah:nth-child(3) { top: 25px; left: 54px; animation-delay: 0.8s; } /* Binah */
.sephirah:nth-child(4) { top: 50px; left: 32px; animation-delay: 1.2s; } /* Daath/Chesed */
.sephirah:nth-child(5) { top: 75px; left: 10px; animation-delay: 1.6s; } /* Geburah */
.sephirah:nth-child(6) { top: 75px; left: 54px; animation-delay: 2s; } /* Tiphereth */
.sephirah:nth-child(7) { top: 100px; left: 32px; animation-delay: 2.4s; } /* Netzach */

/* Sacred Geometry Animations */
@keyframes merkabaSpin {
  from { transform: translate(-50%, -50%) rotateZ(0deg); }
  to { transform: translate(-50%, -50%) rotateZ(360deg); }
}

@keyframes spiralRotate {
  from { transform: translate(-50%, -50%) rotateZ(0deg); }
  to { transform: translate(-50%, -50%) rotateZ(360deg); }
}

@keyframes vesicaPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes fibGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

@keyframes tetrahedronRotate {
  from { transform: translateX(-50%) rotateY(0deg); }
  to { transform: translateX(-50%) rotateY(360deg); }
}

@keyframes mandalaRotate {
  from { transform: translate(-50%, -50%) rotateZ(0deg); }
  to { transform: translate(-50%, -50%) rotateZ(360deg); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

@keyframes sephirahGlow {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 5px var(--sacred-gold); }
  50% { opacity: 1; box-shadow: 0 0 15px var(--sacred-gold); }
}

/* Sacred Number Sequences */
.sacred-numbers {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.sacred-number {
  font-family: var(--font-sacred);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sacred-gold);
  text-shadow: 0 0 10px var(--sacred-gold);
  animation: numberGlow 3s ease-in-out infinite;
}

.sacred-number:nth-child(2) { animation-delay: 1s; }
.sacred-number:nth-child(3) { animation-delay: 2s; }

@keyframes numberGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Responsive Sacred Geometry */
@media (max-width: 768px) {
  .sacred-mandala,
  .fibonacci-spiral {
    width: 80px;
    height: 80px;
  }
  
  .tree-of-life {
    width: 60px;
    height: 90px;
  }
  
  .sacred-numbers {
    gap: 15px;
  }
  
  .sacred-number {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .sacred-mandala,
  .fibonacci-spiral,
  .vesica-piscis {
    width: 60px;
    height: 60px;
  }
  
  .tree-of-life {
    width: 50px;
    height: 75px;
  }
  
  .sacred-numbers {
    gap: 10px;
  }
  
  .sacred-number {
    font-size: 1.2rem;
  }
}