/* SolarSpark Energy - Custom Overrides */
/* Fonts: Poppins (headings) and Inter (body) are loaded via Google Fonts.
   Tailwind provides utility classes; this file is for small custom tweaks. */

:root {
  --brand: #36b35b;
  --sun: #f59e0b;
}

html {
  scroll-behavior: smooth;
}

/* Typography defaults */
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6, .font-poppins {
  font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Focus outline enhancement for accessibility */
:focus-visible {
  outline: 2px dashed var(--sun);
  outline-offset: 3px;
}

/* Smooth drop shadow helper (paired with Tailwind shadow-soft) */
.shadow-soft {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.shadow-soft:hover {
  transform: translateY(-2px);
}

/* Utility: hide when [hidden] attribute used in JS toggles */
[hidden] { display: none !important; }

/* Mobile menu */
#mobileMenu {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1rem 1.5rem;
  gap: 0.25rem;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  overflow: hidden;
  background-color: #ffffff;
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#mobileMenu a {
  padding: 0.75rem 1rem;
  color: #1f2937;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

#mobileMenu a:not(:last-child) {
  margin-bottom: 0.25rem;
}

#mobileMenu a:hover {
  background-color: #f3f4f6;
  color: #111827;
  transform: translateX(4px);
}

#mobileMenu a:active {
  background-color: #e5e7eb;
}

/* Contact button in mobile menu */
#mobileMenu a:last-child {
  margin-top: 0.5rem;
  background: linear-gradient(to right, #059669, #047857);
  color: white;
  text-align: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

#mobileMenu a:last-child:hover {
  background: linear-gradient(to right, #047857, #065f46);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Menu open state */
#mobileMenu:not(.hidden) {
  display: flex;
  max-height: 1000px;
  opacity: 1;
}

/* Body lock when menu is open */
body.menu-open {
  overflow: hidden;
  height: 100vh;
}

/* Contact Form Styles */
#contactForm {
  transition: all 0.3s ease;
}

/* Form input fields */
#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm input[type="tel"],
#contactForm select,
#contactForm textarea {
  transition: all 0.2s ease;
  border: 1px solid rgba(203, 213, 225, 0.3);
  background-color: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(4px);
}

#contactForm input[type="text"]:focus,
#contactForm input[type="email"]:focus,
#contactForm input[type="tel"]:focus,
#contactForm select:focus,
#contactForm textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(54, 179, 91, 0.2);
  background-color: white !important;
}

/* Select dropdown styling */
#contactForm select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* Country code selector */
#contactForm .relative select {
  appearance: none;
  background-image: none;
  padding-right: 1rem;
  border-right: 1px solid #e2e8f0;
  background-color: #f8fafc;
  width: 5rem;
}

/* Form labels */
#contactForm label {
  font-weight: 500;
  color: #334155;
}

/* Required field indicator */
#contactForm .text-red-500 {
  color: #ef4444;
}

/* Optional field text */
#contactForm .text-slate-400 {
  font-weight: normal;
}

/* Checkbox styling */
#contactForm input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

#contactForm input[type="checkbox"]:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

/* Submit button */
#whatsappBtn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#whatsappBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  z-index: -1;
}

#whatsappBtn:hover::before {
  width: 100%;
}

/* Form validation */
#contactForm input:invalid,
#contactForm select:invalid,
#contactForm textarea:invalid {
  border-color: #fca5a5;
}

#contactForm input:focus:invalid,
#contactForm select:focus:invalid,
#contactForm textarea:focus:invalid {
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.2);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  #contactForm {
    grid-template-columns: 1fr;
  }
  
  #contactForm .sm\:col-span-2 {
    grid-column: span 1;
  }
  
  #contactForm .sm\:flex-row {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Help widget panel small animation */
#helpPanel {
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#helpPanel.open {
  transform: translateY(0);
  opacity: 1;
}

/* Hide scrollbar utility for carousels */
.no-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none;    /* Firefox */
}
.no-scrollbar::-webkit-scrollbar { /* Chrome, Safari */
  display: none;
}

/* Subtle background texture for dark footer */
.bg-texture {
  background-repeat: no-repeat;
  background-size: cover;
  background-image:
    radial-gradient(60rem 40rem at 20% 10%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(45rem 30rem at 80% 50%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(35rem 25rem at 15% 85%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%);
}

/* Smooth scrolling for in-page anchor navigation */
html {
  scroll-behavior: smooth;
}

/* Header shrink behavior */
.nav-shell {
  transition: background-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.nav-shell > .max-w-7xl {
  padding-top: 1rem; /* py-4 */
  padding-bottom: 1rem;
  transition: padding 200ms ease;
}
.nav-shell.shrink {
  background-color: rgba(255,255,255,0.85);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(0,0,0,0.2);
}
.nav-shell.shrink > .max-w-7xl {
  padding-top: 0.5rem; /* py-2 */
  padding-bottom: 0.5rem;
}

/* Ripple effect for buttons/links */
.ripple-container {
  position: relative;
  overflow: hidden; /* clip ripple */
}
.ripple {
  position: absolute;
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: rgba(255, 255, 255, 0.35);
  animation: ripple 600ms ease-out;
}
@keyframes ripple {
  from { width: 0; height: 0; opacity: 0.5; }
  to { width: 500px; height: 500px; opacity: 0; }
}

/* Hover lift utility (for cards) */
.hover-lift {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.25);
}

/* Gradient hover animation for gradient buttons */
a[class*='bg-gradient-to-'],
button[class*='bg-gradient-to-'] {
  background-size: 200% 200%;
  transition: background-position 300ms ease, filter 200ms ease;
}
a[class*='bg-gradient-to-']:hover,
button[class*='bg-gradient-to-']:hover {
  background-position: 100% 0;
  filter: brightness(0.98);
}

/* Premium hover glow for nav links/buttons */
.hover-glow {
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease, color 200ms ease;
}
.hover-glow:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 28px -12px rgba(34,197,94,0.45);
  filter: brightness(1.02);
}

/* Glass dark helper */
.glass-dark {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: saturate(150%) blur(8px);
}

/* Framed rounded container with side margins (used by topbar) */
.framed {
  border-radius: 1rem;
  margin-left: 1rem;
  margin-right: 1rem;
}

/* Marquee (cities auto-scroll) */
.marquee {
  display: flex;
  overflow: hidden;
  gap: 1rem;
  user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
          mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  animation: scroll-left 25s linear infinite;
}
.marquee:hover .marquee-track,
.marquee.paused .marquee-track {
  animation-play-state: paused;
}
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 50px;
  /* Default size, can be overridden */
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .logo-img {
    height: 45px;
  }
}

@media (max-width: 480px) {
  .logo-img {
    height: 40px;
  }
}