/* ============================================
   LOADING SCREEN - NOW NOW CLOCK
   AfricaNow Now Booking Platform
   ============================================ */

/* Variables */
:root {
  /* Brand Colors */
  --color-orange: #FF7F50;
  --color-purple: #8B4789;
  --color-turquoise: #00CED1;
  --color-red: #C73E1D;
  --color-gold: #FFD700;
  --color-charcoal: #36454F;
  --color-cream: #FAF9F6;

  /* Clock Dimensions - SMALLER */
  --clock-size-desktop: 150px;
  --clock-size-mobile: 120px;

  /* Timing */
  --fade-duration: 500ms;
}

/* ============================================
   LOADING SCREEN CONTAINER
   ============================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;

  background: linear-gradient(135deg, var(--color-cream) 0%, #F0E6DC 100%);

  display: flex;
  align-items: center;
  justify-content: center;

  /* Initial state - visible */
  opacity: 1;
  visibility: visible;
  transition: opacity var(--fade-duration) ease-out,
              visibility 0s linear 0s;
}

/* Hidden state (after loading complete) */
.loading-screen.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  max-width: 600px;
  text-align: center;
}

/* ============================================
   CLOCK CONTAINER & BORDER
   ============================================ */

.now-now-clock-container {
  position: relative;
  width: var(--clock-size-desktop);
  height: var(--clock-size-desktop);
  margin-bottom: 30px;
  /* FORCE CIRCULAR - CRITICAL FIX */
  aspect-ratio: 1 / 1;
}

/* Rotating Kente Border - THICK VISIBLE COLORFUL RING */
.clock-border {
  position: absolute;
  top: -30px;
  left: -30px;
  width: calc(var(--clock-size-desktop) + 60px);
  height: calc(var(--clock-size-desktop) + 60px);
  border-radius: 50%;
  aspect-ratio: 1 / 1;

  /* Colorful striped background - CONIC gradient for visibility */
  background: conic-gradient(
    from 0deg,
    var(--color-orange) 0deg 60deg,
    var(--color-gold) 60deg 120deg,
    var(--color-turquoise) 120deg 180deg,
    var(--color-purple) 180deg 240deg,
    var(--color-red) 240deg 300deg,
    var(--color-orange) 300deg 360deg
  );

  /* Rotating animation */
  animation: rotate-border 60s linear infinite;
  will-change: transform;

  /* Make it POP */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  z-index: 0;
}

@keyframes rotate-border {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Clock Face */
.clock-face {
  position: relative;
  width: var(--clock-size-desktop);
  height: var(--clock-size-desktop);
  border-radius: 50%;
  background: var(--color-cream);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* FORCE CIRCULAR - CRITICAL FIX */
  aspect-ratio: 1 / 1;
  z-index: 2;
}

/* Clock SVG */
.clock-svg {
  width: 100%;
  height: 100%;
  /* FORCE CIRCULAR - CRITICAL FIX */
  aspect-ratio: 1 / 1;
}

.clock-background {
  fill: var(--color-cream);
}

/* ============================================
   CLOCK NUMBERS (12, 3, 6, 9)
   ============================================ */

.clock-number {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 20px;
  font-weight: 700;
  dominant-baseline: middle;
}

.clock-12 { fill: var(--color-orange); }
.clock-3 { fill: var(--color-purple); }
.clock-6 { fill: var(--color-turquoise); }
.clock-9 { fill: var(--color-red); }

/* ============================================
   CURVED "NOW NOW" TEXT
   ============================================ */

.curved-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 2px;
}

.curved-text-1 { fill: var(--color-orange); }
.curved-text-2 { fill: var(--color-purple); }
.curved-text-3 { fill: var(--color-turquoise); }
.curved-text-4 { fill: var(--color-red); }

/* ============================================
   CLOCK HANDS
   ============================================ */

.hour-hand,
.minute-hand {
  transform-origin: 160px 160px; /* Center of clock */
  transition: transform 0.1s linear;
  will-change: transform;
}

.hour-hand-line {
  filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.2));
}

.minute-hand-line {
  filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.2));
}

/* Hand Tips (Africa & Turtle) - Counter-rotate to stay upright */
.hour-hand-tip,
.minute-hand-tip {
  transform-origin: 0px 0px;
  transition: transform 0.1s linear;
  will-change: transform;
}

/* Center Pin */
.clock-center-pin {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* ============================================
   AFRICA & TURTLE ICONS
   ============================================ */

.africa-container,
.turtle-container {
  transform: translate(-50%, -50%); /* Center on tip point */
}

/* Fallback emoji styling */
.emoji-fallback {
  font-size: 30px;
  text-align: center;
  user-select: none;
}

/* Turtle walking animation - Legs moving */
@keyframes turtle-walk-legs {
  0% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(1px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(1px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Apply walking animation to tortoise legs */
.turtle-leg {
  animation: turtle-walk-legs 0.8s ease-in-out infinite;
  transform-origin: center;
}

/* Alternate legs timing for realistic walk - diagonal pairs move together */
.turtle-leg-1 {
  animation-delay: 0s;
}

.turtle-leg-2 {
  animation-delay: 0.4s;
}

.turtle-leg-3 {
  animation-delay: 0.4s;
}

.turtle-leg-4 {
  animation-delay: 0s;
}

/* ============================================
   TEXT BELOW CLOCK
   ============================================ */

.loading-icon {
  font-size: 32px;
  margin: 30px 0 20px 0;
  user-select: none;
}

.loading-tagline {
  font-size: 24px;
  font-weight: 400;
  text-align: center;
  color: var(--color-charcoal);
  line-height: 1.5;
  margin: 0 0 20px 0;
  max-width: 500px;
}

.loading-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-orange);
  margin: 0 0 30px 0;
}

/* ============================================
   PROGRESS DOTS
   ============================================ */

.loading-progress {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #D3D3D3;
  transition: background 0.3s ease;
}

.dot.active {
  background: var(--color-orange);
}

/* ============================================
   SKIP BUTTON
   ============================================ */

.loading-skip {
  background: transparent;
  border: 2px solid var(--color-orange);
  color: var(--color-orange);
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline-offset: 4px;
}

.loading-skip:hover {
  background: var(--color-orange);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 127, 80, 0.3);
}

.loading-skip:focus {
  outline: 2px solid var(--color-orange);
  outline-offset: 4px;
}

.loading-skip:active {
  transform: translateY(0);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .now-now-clock-container {
    width: var(--clock-size-mobile);
    height: var(--clock-size-mobile);
    /* FORCE CIRCULAR - CRITICAL FIX */
    aspect-ratio: 1 / 1;
  }

  .clock-border {
    top: -30px;
    left: -30px;
    width: calc(var(--clock-size-mobile) + 60px);
    height: calc(var(--clock-size-mobile) + 60px);
    /* FORCE CIRCULAR - CRITICAL FIX */
    aspect-ratio: 1 / 1;
  }

  .clock-face {
    width: var(--clock-size-mobile);
    height: var(--clock-size-mobile);
    /* FORCE CIRCULAR - CRITICAL FIX */
    aspect-ratio: 1 / 1;
  }

  .clock-number {
    font-size: 18px;
  }

  .curved-text {
    font-size: 14px;
  }

  .loading-tagline {
    font-size: 20px;
    padding: 0 20px;
  }

  .loading-brand {
    font-size: 16px;
  }

  .emoji-fallback {
    font-size: 25px;
  }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .clock-border,
  .hour-hand,
  .minute-hand,
  .turtle-animated {
    animation: none !important;
  }

  .hour-hand,
  .minute-hand,
  .hour-hand-tip,
  .minute-hand-tip {
    transition: none !important;
  }
}
