@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Cinzel+Decorative:wght@700;900&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #07080d;
  --bg-secondary: #0f111a;
  --bg-card: #141724;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --ruby-red: #ef4444;
  --byzantine-purple: #9333ea;
  --celestial-blue: #0284c7;
  --emerald-living: #10b981;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: #e2e8f0;
  overflow-x: hidden;
}

.font-serif {
  font-family: 'EB Garamond', Georgia, serif;
}

.font-cinzel {
  font-family: 'Cinzel', Georgia, serif;
}

.font-greek {
  font-family: 'EB Garamond', 'Gentium Plus', 'Palatino Linotype', serif;
}

/* Byzantine Gold Foil Text Gradient with Shimmer */
.gold-text-gradient {
  background: linear-gradient(135deg, #fffbeb 0%, #fde047 25%, #d4af37 60%, #996515 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.25));
}

.gold-glow-box {
  box-shadow: 0 10px 35px -5px rgba(212, 175, 55, 0.18), 0 0 15px rgba(212, 175, 55, 0.1);
}

/* Glassmorphism with Stained Glass Iridescence */
.glass-panel {
  background: rgba(15, 17, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #07080d;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: #d4af37;
}

/* Tab Navigation Active State */
.nav-tab {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-tab.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(147, 51, 234, 0.15) 100%);
  color: #fef08a;
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
  font-weight: 700;
  transform: translateY(-1px);
}

/* Diff Badges */
.diff-badge {
  font-family: monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-added {
  background: rgba(6, 95, 70, 0.7);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.badge-modified {
  background: rgba(120, 53, 15, 0.7);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.badge-preserved {
  background: rgba(30, 58, 138, 0.7);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.badge-deleted {
  background: rgba(127, 29, 29, 0.7);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.badge-filioque {
  background: rgba(88, 28, 135, 0.85);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.7);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

/* Cathedral SVG Interactivity */
.cathedral-zone {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cathedral-zone:hover rect,
.cathedral-zone:hover path {
  filter: brightness(1.35) drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

/* Animated Golden Halo Pulse */
@keyframes holyPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

.animate-holy-pulse {
  animation: holyPulse 3.5s infinite ease-in-out;
}

/* Modal transition */
#inspector-modal:not(.hidden) {
  display: flex;
}

/* -------------------------------------------------------------
   Leaflet Realistic Geographic Cartography (Patristic Theme)
   ------------------------------------------------------------- */
.leaflet-container {
  background: #060911 !important;
  font-family: inherit;
}

/* Universal Leaflet Dark Popup & Tooltip Architecture */
.leaflet-popup-content-wrapper,
.leaflet-container .leaflet-popup-content-wrapper,
.patristic-leaflet-popup .leaflet-popup-content-wrapper {
  background: #090d16 !important;
  background-color: #090d16 !important;
  color: #f1f5f9 !important;
  border: 1.5px solid rgba(212, 175, 55, 0.65) !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.95), 0 0 25px rgba(212, 175, 55, 0.35) !important;
  padding: 4px !important;
}

.leaflet-popup-tip,
.leaflet-container .leaflet-popup-tip,
.patristic-leaflet-popup .leaflet-popup-tip {
  background: #090d16 !important;
  background-color: #090d16 !important;
  border: 1px solid rgba(212, 175, 55, 0.5) !important;
}

.leaflet-popup-content,
.leaflet-container .leaflet-popup-content {
  color: #f1f5f9 !important;
  margin: 10px 14px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-close-button,
.leaflet-container a.leaflet-popup-close-button {
  color: #cbd5e1 !important;
  padding: 8px 10px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:hover {
  color: #fde047 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
}

/* Tooltips (Exile routes and sea lanes) */
.leaflet-tooltip,
.leaflet-container .leaflet-tooltip {
  background: #090d16 !important;
  background-color: #090d16 !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(212, 175, 55, 0.55) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9) !important;
  padding: 6px 10px !important;
}
.leaflet-tooltip-top:before {
  border-top-color: #090d16 !important;
}
.leaflet-tooltip-bottom:before {
  border-bottom-color: #090d16 !important;
}
.leaflet-tooltip-left:before {
  border-left-color: #090d16 !important;
}
.leaflet-tooltip-right:before {
  border-right-color: #090d16 !important;
}

/* Custom Marker Elements */
.custom-patristic-marker {
  background: transparent !important;
  border: none !important;
}

.marker-container {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.marker-halo {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  animation: pulseHalo 2.8s infinite ease-in-out;
  pointer-events: none;
}

.council-type .marker-halo {
  background: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.7);
}

.see-type .marker-halo {
  background: rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.synod-type .marker-halo {
  background: rgba(52, 211, 153, 0.25);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.5);
}

.marker-badge {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border: 1.5px solid;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.council-type .marker-badge {
  background: #78350f;
  color: #fde047;
  border-color: #fbbf24;
}

.see-type .marker-badge {
  background: #0c4a6e;
  color: #bae6fd;
  border-color: #38bdf8;
}

.synod-type .marker-badge {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #34d399;
}

.marker-container:hover .marker-badge,
.marker-container.active .marker-badge {
  transform: scale(1.3);
  filter: drop-shadow(0 0 8px rgba(253, 224, 71, 0.8));
}

.marker-name-tag {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 13, 22, 0.95);
  color: #cbd5e1;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 7px;
  border: 1px solid #334155;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
  transition: all 0.2s ease;
}

.marker-container:hover .marker-name-tag,
.marker-container.active .marker-name-tag {
  color: #fde047;
  border-color: #f59e0b;
  background: #0f172a;
  transform: translateX(-50%) translateY(-2px);
}

@keyframes pulseHalo {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.9;
  }
}

/* Leaflet Zoom Control Obsidian Styling */
.leaflet-control-zoom a {
  background: #090d16 !important;
  color: #f59e0b !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
  background: #1e293b !important;
  color: #fde047 !important;
  border-color: #f59e0b !important;
}

.leaflet-control-zoom-in {
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
}

.leaflet-control-zoom-out {
  border-bottom-left-radius: 10px !important;
  border-bottom-right-radius: 10px !important;
}
