/* Eco-Explorer - Unified Main Styles */

/* Critical Above-the-Fold Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #0a0f1a; /* Dark blue-tone */
  color: #e6f1ff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  /* Performance optimizations */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Enable selection for interactive elements */
button, a, input, textarea, select {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* Scroll progress bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #1f2937;
  color: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 0.5rem;
  z-index: 10000;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Gradient Text */
.gradient-text {
  background: -webkit-linear-gradient(45deg, #3b82f6, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass Effect */
.glass-effect {
  background: rgba(10, 15, 26, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

/* Glow Effect */
.glow-effect {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 5px rgba(147, 197, 253, 0.6);
}

/* Gradient Border */
.gradient-border {
  border-radius: 0.75rem;
  padding: 2px;
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.3), rgba(147, 197, 253, 0.3));
  transition: all 0.3s ease;
}

.gradient-border > div {
  background-color: #0a0f1a;
  border-radius: 0.6rem;
  padding: 2rem;
}

.gradient-border:hover {
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.6), rgba(147, 197, 253, 0.6));
}

/* Wild Pattern Background */
.wild-pattern {
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(147, 197, 253, 0.08) 0%, transparent 40%),
    linear-gradient(45deg, transparent 49%, rgba(59, 130, 246, 0.03) 50%, transparent 51%);
  background-size: 100% 100%, 100% 100%, 30px 30px;
}

/* Jaguar Spots Pattern */
.jaguar-spots {
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 75% 75%, rgba(147, 197, 253, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 15%);
  background-size: 60px 60px, 80px 80px, 40px 40px;
}

/* Wild Glow Animation */
.wild-glow {
  animation: wildPulse 3s ease-in-out infinite alternate;
}

@keyframes wildPulse {
  0% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
  100% { box-shadow: 0 0 30px rgba(147, 197, 253, 0.5); }
}

/* Navigation */
.nav-link {
  transition: color 0.2s ease-in-out;
}

.nav-link:hover {
  color: #34d399;
}

.nav-active {
  color: #34d399 !important;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: #059669;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #047857;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

/* Cards */
.card {
  background-color: #1f2937;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #065f46;
}

/* --- Mobile Nav Fallback (ensures hamburger visibility) --- */
@media (max-width: 767.98px) {
  /* Hide desktop nav even if Tailwind hasn’t loaded yet */
  header nav[aria-label="Main navigation"] {
    display: none !important;
  }
  /* Ensure the hamburger button is visible */
  #menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  /* Make mobile menu scrollable if content overflows */
  #mobile-menu {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.2);
  border-color: #34d399;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #d1d5db;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #374151;
  border: 1px solid #4b5563;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Jungle-specific animations */
@keyframes leafSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

@keyframes mistFloat {
  0%, 100% { opacity: 0.3; transform: translateY(0px); }
  50% { opacity: 0.6; transform: translateY(-10px); }
}

/* Section Spacing */
.section {
  padding: 5rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 7rem 0;
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #34d399;
}

/* Utility Classes */
.text-shadow {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.text-shadow-sm {
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Jungle-themed gradients */
.jungle-gradient {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
}

.jungle-overlay {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(5, 150, 105, 0.2));
}

.border-jungle {
  border-color: #34d399;
}

.border-jungle-left {
  border-left: 4px solid #34d399;
  padding-left: 1rem;
}

/* Language Switcher Styles */
.language-switcher {
  position: relative;
  display: inline-block;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 8rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.language-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  color: #E2E8F0;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.language-option:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #A5B4FC;
}

.language-option.active {
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  font-weight: 600;
}

/* Language Transition Effects */
[data-translate] {
  transition: opacity 0.3s ease;
}

.language-transition {
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  
  .language-switcher {
    margin-left: auto;
  }
  
  .language-dropdown {
    right: 0;
    min-width: 7rem;
  }

  /* Mobile language links active state */
  .mobile-lang-selector a.active {
    color: #ffffff;
    font-weight: 600;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
  
  h1 { font-size: 3rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 2rem; }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 3rem;
  }
  
  h1 { font-size: 3.5rem; }
  h2 { font-size: 3rem; }
  h3 { font-size: 2.25rem; }
}

/* Hero Jungle Styles */
.hero-jungle {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
  position: relative;
  overflow: hidden;
}

/* Animated gradient overlay for hero */
.animated-gradient {
  background: radial-gradient(1200px 600px at 10% 10%, rgba(59, 130, 246, 0.12), transparent 60%),
              radial-gradient(1200px 600px at 90% 20%, rgba(99, 102, 241, 0.12), transparent 60%),
              radial-gradient(1200px 600px at 50% 90%, rgba(34, 197, 94, 0.08), transparent 60%);
  animation: gradientDrift 18s ease-in-out infinite alternate;
}

@keyframes gradientDrift {
  0% { transform: translate3d(0,0,0) scale(1); filter: saturate(1); }
  100% { transform: translate3d(0,-2%,0) scale(1.03); filter: saturate(1.2); }
}

.hero-jungle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: 100px 100px;
  animation: leafSway 4s ease-in-out infinite;
}

.jungle-card {
  background: rgba(31, 41, 55, 0.9);
  border: 1px solid #34d399;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.jungle-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px rgba(52, 211, 153, 0.2);
  border-color: #10b981;
}

.btn-jungle {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-jungle:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(52, 211, 153, 0.3);
} 

/* Back to top button */
#back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: rgba(15,23,42,0.8);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 9999px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: transform .2s ease, opacity .2s ease, background .2s ease;
}

#back-to-top:hover {
  transform: translateY(-2px);
  background: rgba(30,41,59,0.9);
}
