/* 
   Monte Santiago Shared Styles 
   Premium UI components and animations
*/

:root {
  /* Premium Color Palette (HSL for precision) */
  --p-emerald-950: 160, 84%, 6%;
  --p-emerald-900: 160, 84%, 12%;
  --p-emerald-800: 160, 70%, 18%;
  --p-emerald-700: 160, 60%, 25%;
  --p-emerald-500: 160, 60%, 45%;
  --p-emerald-400: 160, 60%, 65%;
  
  --p-moss-500: 142, 70%, 45%;
  --p-gold-500: 45, 100%, 50%;
  --p-parchment: 40, 30%, 96%;
  
  /* Depth & Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(20, 30, 24, 0.08);
  
  /* Animations */
  --transition-premium: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- Premium Foundations --- */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-premium);
}

.reveal-up.active {
  opacity: 1;
  transform: translateY(0);
}

.hero-float {
  animation: hero-float 6s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.drop-cap::first-letter {
  float: left;
  font-size: 4.5rem;
  line-height: 0.8;
  padding-right: 0.75rem;
  font-weight: 800;
  color: hsl(var(--p-emerald-900));
  font-family: 'Plus Jakarta Sans', sans-serif;
}


/* --- Typography & Icons --- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  vertical-align: middle;
}

/* --- Layout & Panels --- */
.editorial-shadow {
  box-shadow: 0px 20px 40px rgba(20, 30, 24, 0.06);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-premium {
  box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

/* --- Animations & Loading --- */
.loading-img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --- Premium Cards & Hover Effects --- */
.premium-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(20, 30, 24, 0.12);
}

.premium-card img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover img {
  transform: scale(1.08);
}

/* Specific Fauna Cards (Inheriting or extending) */
.raptor-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.raptor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(20, 30, 24, 0.12);
}
.raptor-card img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.raptor-card:hover img {
  transform: scale(1.08);
}
.mammal-card {
  transition: all 0.5s ease;
  border: 1px solid transparent;
}
.mammal-card:hover {
  border-color: rgba(34, 80, 50, 0.15);
  transform: translateY(-4px);
}

.amphibian-card {
  transition: all 0.5s ease;
  position: relative;
  z-index: 1;
}

.amphibian-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 2rem;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.2),
    rgba(59, 130, 246, 0.2)
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
}

.amphibian-card:hover {
  transform: translateY(-6px);
}

.amphibian-card:hover::before {
  opacity: 1;
}

/* --- Bird Cards & Audio --- */
.bird-card {
  transition: all 0.5s ease;
}

.bird-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(20, 30, 24, 0.1);
}

.bird-card img {
  transition: transform 0.6s ease;
}

.bird-card:hover img {
  transform: scale(1.06);
}

.audio-btn {
  transition: all 0.3s ease;
}

.audio-btn:hover {
  background: #166534;
  transform: scale(1.05);
}

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

/* --- Badges & Stats --- */
.species-badge {
  font-size: 10px;
  letter-spacing: 0.15em;
  line-height: 1;
}

.stat-float {
  animation: float 3s ease-in-out infinite;
}

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

/* --- Utility Classes --- */
.scroll-mt-header {
  scroll-margin-top: 140px;
}

/* --- Accessibility: Focus Visible --- */
*:focus-visible {
  outline: 3px solid #2c6a3c;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content (screen reader only until focused) */
.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
  clip-path: inset(50%) !important;
}

.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
  position: fixed !important;
  top: 1rem !important;
  left: 1rem !important;
  z-index: 9999 !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  clip-path: none !important;
  padding: 0.75rem 1.5rem !important;
  background-color: #2c6a3c !important; /* Primary Emerald */
  color: white !important;
  font-weight: 700 !important;
  border-radius: 0.5rem !important;
  text-decoration: none !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
}

/* --- Image Protection --- */
img {
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -o-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

/* --- Map Layer Switcher --- */
.map-layer-switcher {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  padding: 3px;
  gap: 3px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
  z-index: 1000;
  margin: 0 !important;
}

.map-layer-btn {
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.map-layer-btn:hover {
  background: rgba(4, 120, 87, 0.1);
  color: #047857;
}

.map-layer-btn.active {
  background: #047857;
  color: white;
}

.map-layer-btn span {
  font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════ */
/* INTERACTIVE CARD INDICATORS                                */
/* Badges + hover overlays for cards with popup/carousel      */
/* ═══════════════════════════════════════════════════════════ */

/* Container setup */
.has-popup-indicator {
  position: relative;
  cursor: pointer;
}

/* ── Corner Badge ── */
.popup-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(4, 120, 87, 0.15);
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #047857;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  animation: popup-badge-entrance 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.popup-badge .material-symbols-outlined {
  font-size: 14px;
  color: #059669;
}

@keyframes popup-badge-entrance {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Subtle pulse on mobile to draw attention */
@media (hover: none) {
  .popup-badge {
    animation: popup-badge-entrance 0.6s cubic-bezier(0.23, 1, 0.32, 1) both,
               popup-badge-pulse 3s ease-in-out 1.5s 2;
  }
}

@keyframes popup-badge-pulse {
  0%, 100% {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(4, 120, 87, 0.15);
  }
  50% {
    box-shadow: 0 2px 16px rgba(4, 120, 87, 0.25), 0 0 0 3px rgba(4, 120, 87, 0.12);
  }
}

/* Hover state — desktop (badge only, no overlay) */
@media (hover: hover) {
  .has-popup-indicator:hover .popup-badge {
    background: #059669;
    color: white;
    box-shadow: 0 4px 16px rgba(4, 120, 87, 0.35);
  }

  .has-popup-indicator:hover .popup-badge .material-symbols-outlined {
    color: white;
  }
}

/* ── Dark variant for cards on dark backgrounds ── */
.has-popup-indicator--dark .popup-badge {
  background: rgba(6, 78, 59, 0.85);
  color: #d1fae5;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(209, 250, 229, 0.2);
}

.has-popup-indicator--dark .popup-badge .material-symbols-outlined {
  color: #6ee7b7;
}

@media (hover: hover) {
  .has-popup-indicator--dark:hover .popup-badge {
    background: #10b981;
    color: white;
  }

  .has-popup-indicator--dark:hover .popup-badge .material-symbols-outlined {
    color: white;
  }
}

