/*
 * Divine Power 48 - Design System
 *
 * Color palette:
 * - Gold Primary: #CEA52F
 * - Gold Light: #DAA520
 * - Gold Dark: #816309
 * - Black Background: #000000
 * - Card Background: #1E1E1E
 * - Secondary Card: #2A2A2A
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  --dp-gold: #CEA52F;
  --dp-gold-light: #DAA520;
  --dp-gold-dark: #816309;
  --dp-black: #000000;
  --dp-card: #1E1E1E;
  --dp-card-secondary: #2A2A2A;
  --dp-nav-start: #38301E;
}

/* ============================================
   Typography
   ============================================ */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', serif;
}

/* Gold text utility */
.text-gold {
  color: var(--dp-gold);
}

/* Text shadow for emphasis */
.text-shadow-gold {
  text-shadow: 0 0 10px rgba(206, 165, 47, 0.5);
}

/* ============================================
   Buttons
   ============================================ */
.btn-gold {
  background-color: var(--dp-gold);
  color: var(--dp-black);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.btn-gold:hover {
  background-color: var(--dp-gold-light);
}

.btn-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Outline button variant */
.btn-gold-outline {
  background-color: transparent;
  border: 2px solid var(--dp-gold);
  color: var(--dp-gold);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.btn-gold-outline:hover {
  background-color: var(--dp-gold);
  color: var(--dp-black);
}

/* ============================================
   Cards
   ============================================ */
.card-dp {
  background-color: var(--dp-card);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(206, 165, 47, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

/* Card with gold glow effect */
.card-dp-glow {
  box-shadow: 0 0 20px rgba(206, 165, 47, 0.3);
}

/* ============================================
   Inputs
   ============================================ */
.input-dp {
  width: 100%;
  background-color: var(--dp-card-secondary);
  border: 1px solid rgba(206, 165, 47, 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: white;
  transition: border-color 0.2s ease;
}

.input-dp::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-dp:focus {
  outline: none;
  border-color: var(--dp-gold);
}

/* ============================================
   Backgrounds
   ============================================ */
.bg-dp-gradient {
  background: radial-gradient(
    ellipse at top,
    var(--dp-gold-dark) 0%,
    #312604 40%,
    var(--dp-black) 100%
  );
}

.bg-dp-nav {
  background: linear-gradient(to top, var(--dp-black) 0%, var(--dp-nav-start) 100%);
}

/* ============================================
   Flash Messages
   ============================================ */
.flash-notice {
  background-color: rgba(54, 211, 153, 0.9);
  color: #000;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.flash-error {
  background-color: rgba(248, 114, 114, 0.9);
  color: #000;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(206, 165, 47, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(206, 165, 47, 0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

.animate-pulse-gold {
  animation: pulse-gold 2s infinite;
}

/* Staggered animation delays */
.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }
.animate-delay-500 { animation-delay: 500ms; }

/* ============================================
   Sanctuary entry — door / light open
   ============================================ */
.sanctuary-entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: #000;
  overflow: hidden;
}

.sanctuary-entry-overlay.is-done {
  animation: sanctuaryOverlayFade 0.9s ease-out forwards;
  pointer-events: none;
}

.sanctuary-entry-overlay.is-dismissed {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.sanctuary-entry-doors {
  position: absolute;
  inset: 0;
  display: flex;
}

.sanctuary-entry-door {
  flex: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 16, 8, 0.98) 40%, rgba(12, 10, 6, 1) 100%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(206, 165, 47, 0.04) 48px,
      rgba(206, 165, 47, 0.04) 49px
    );
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
  transition: transform 3.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.sanctuary-entry-door--left {
  border-right: 1px solid rgba(206, 165, 47, 0.25);
  transform-origin: left center;
}

.sanctuary-entry-door--right {
  border-left: 1px solid rgba(206, 165, 47, 0.25);
  transform-origin: right center;
}

.sanctuary-entry-overlay.is-opening .sanctuary-entry-door--left {
  transform: translateX(-102%);
}

.sanctuary-entry-overlay.is-opening .sanctuary-entry-door--right {
  transform: translateX(102%);
}

.sanctuary-entry-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 55% 70% at 50% 45%, rgba(255, 230, 160, 0.55) 0%, rgba(206, 165, 47, 0.22) 35%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 50% 50%, rgba(255, 248, 220, 0.35) 0%, transparent 60%);
  transition: opacity 1.8s ease-out 0.45s;
}

.sanctuary-entry-overlay.is-opening .sanctuary-entry-light {
  opacity: 1;
  animation: sanctuaryLightPulse 2.8s ease-in-out 0.5s both;
}

.sanctuary-entry-title {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 1.1s ease-out 1.1s, transform 1.1s ease-out 1.1s;
}

.sanctuary-entry-overlay.is-opening .sanctuary-entry-title {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sanctuary-entry-title h2 {
  font-family: var(--font-display, Georgia, "Times New Roman", serif);
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.2;
  color: #cea52f;
  text-shadow: 0 0 40px rgba(206, 165, 47, 0.45);
  margin: 0;
}

.sanctuary-entry-title p {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(255, 248, 220, 0.72);
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
}

.sanctuary-entry-content {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.sanctuary-entry-content.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@keyframes sanctuaryOverlayFade {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

@keyframes sanctuaryLightPulse {
  0% { filter: brightness(0.7); }
  45% { filter: brightness(1.15); }
  100% { filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .sanctuary-entry-overlay,
  .sanctuary-entry-door,
  .sanctuary-entry-light,
  .sanctuary-entry-title,
  .sanctuary-entry-content {
    transition: none !important;
    animation: none !important;
  }

  .sanctuary-entry-content {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   Card Flip Animation
   ============================================ */
.card-flip-container {
  perspective: 1000px;
}

.card-flipper {
  position: relative;
  width: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-flipper.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: rotateY(180deg);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner-gold {
  width: 2rem;
  height: 2rem;
  border: 4px solid rgba(206, 165, 47, 0.3);
  border-top-color: var(--dp-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Utilities
   ============================================ */
/* Blur for locked content */
.blur-content {
  filter: blur(4px);
  user-select: none;
}

/* Safe area padding for notched devices */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.pt-safe {
  padding-top: env(safe-area-inset-top, 0);
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Touch optimization */
.touch-target {
  min-height: 44px;
  min-width: 44px;
}

/* ============================================
   International Phone Input (intl-tel-input)
   Dark theme overrides for Track 8
   ============================================ */
.iti {
  width: 100%;
}

.iti__tel-input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: none !important;
  border-radius: 0.75rem !important;
  padding: 0.875rem 1rem 0.875rem 90px !important;
  color: white !important;
  font-size: 1rem;
}

.iti__tel-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.iti__tel-input:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--dp-gold) !important;
}

.iti__country-container {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-top-left-radius: 0.75rem !important;
  border-bottom-left-radius: 0.75rem !important;
}

.iti__selected-dial-code {
  color: rgba(255, 255, 255, 0.7) !important;
}

.iti__arrow {
  border-top-color: rgba(255, 255, 255, 0.7) !important;
}

.iti__country-list {
  background-color: var(--dp-card) !important;
  border: 1px solid rgba(206, 165, 47, 0.3) !important;
  border-radius: 0.5rem !important;
  max-height: 200px !important;
}

.iti__country {
  padding: 0.5rem 1rem !important;
  color: white !important;
}

.iti__country:hover,
.iti__country--highlight {
  background-color: rgba(206, 165, 47, 0.2) !important;
}

.iti__dial-code {
  color: rgba(255, 255, 255, 0.6) !important;
}

.iti__search-input {
  background-color: var(--dp-card-secondary) !important;
  border: 1px solid rgba(206, 165, 47, 0.3) !important;
  color: white !important;
  border-radius: 0.375rem !important;
}

.iti__search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}
