/* Gema Nusa Custom Styles - Updated with Purple Theme */

/* Font Imports */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap");

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.6);
  }
}

/* Utility Classes */
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* Custom Gradients - Updated to Purple */
.gradient-nusantara {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
}

.gradient-gold {
  background: linear-gradient(135deg, #A855F7 0%, #9333EA 100%);
}

.gradient-purple-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
}

.gradient-purple-secondary {
  background: linear-gradient(135deg, #A855F7 0%, #C084FC 100%);
}

/* Component Loading States */
.component-loading {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

.component-loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Typography */
.text-hero {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  font-weight: 800;
}

.text-section-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
}


/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Loading Spinner - Updated to Purple */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #7C3AED;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Map Integration Styles - Updated to Purple */
.map-container {
  background-color: #faf7ff; 
  border: none;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.map-region {
  transition: all 0.3s ease;
  cursor: pointer;
}

.map-region:hover {
  fill: #c4b5fd !important; /* Purple light on hover */
  opacity: 0.9;
}

.map-region.highlighted {
  fill: #8b5cf6 !important; /* Purple highlight */
  stroke: #7c3aed !important; /* Purple stroke */
  stroke-width: 2 !important;
}

.map-tooltip {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.15);
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  max-width: 200px;
}

.map-scope-btn {
  transition: all 0.3s ease;
  border: none;
  outline: none;
  font-weight: 600;
}

.map-scope-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.map-scope-btn.active {
  background-color: #7C3AED !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Map Loading Animation - Updated to Purple */
.map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  font-size: 16px;
}

.map-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #7C3AED;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

/* Responsive Map Styles */
@media (max-width: 768px) {
  .map-container {
    height: 300px !important;
  }
  
  .map-scope-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .map-tooltip {
    font-size: 12px;
    padding: 8px;
  }
}

@media (max-width: 640px) {
  .map-container {
    height: 250px !important;
  }
  
  .map-scope-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Map Legend Styles */
.map-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  color: #6b7280;
}

.map-legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .map-legend {
    gap: 1rem;
    font-size: 12px;
  }
  
  .map-legend-color {
    width: 16px;
    height: 16px;
  }
}

/* Additional Purple Theme Elements */
.btn-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
  background: rgba(124, 58, 237, 0.1);
  color: #7C3AED;
  border: 2px solid #7C3AED;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #7C3AED;
  color: white;
  transform: translateY(-2px);
}

.card-purple {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card-purple:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
}

.text-purple-gradient {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.border-purple-gradient {
  border: 2px solid;
  border-image: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%) 1;
}

/* Focus States */
.focus-purple:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  border-color: #7C3AED;
}

/* Status Indicators */
.status-active {
  color: #7C3AED;
  background: rgba(124, 58, 237, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-completed {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Progress Bars */
.progress-bar-purple {
  background: #e5e7eb;
  border-radius: 9999px;
  height: 0.5rem;
  overflow: hidden;
}

.progress-bar-purple .progress-fill {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Navbar Styles */
#main-navbar {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

#main-navbar.navbar-hidden {
  transform: translateY(-100%);
}

#main-navbar.navbar-visible {
  transform: translateY(0);
}

/* Ensure navbar is visible during component loading */
#navbar:not(:empty) #main-navbar {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Mobile Menu Transitions */
#mobile-menu {
  transition: opacity 300ms ease-in-out, transform 300ms ease-in-out;
}

#mobile-menu.menu-hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

#mobile-menu.menu-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- fallback helpers for mobile menu animation --- */
.scale-y-95 { transform-origin: top; transform: scaleY(.95); }
.scale-y-100 { transform-origin: top; transform: scaleY(1); }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
#mobile-menu { transition: transform 200ms ease, opacity 200ms ease; }