/* ==========================================================================
   Swapnil Fabrication & Solar Systems - custom styles
   (Tailwind handles most styling; this file covers reusable components,
   navbar states, animations and language-specific typography.)
   ========================================================================== */

/* ---------- Language / typography ---------- */
/* Hide content until the Marathi text has been applied, to avoid an English flash.
   The animation is a fallback that reveals the page if JavaScript fails. */
html.i18n-pending body {
  opacity: 0;
  animation: i18n-fallback 0s linear 1.5s forwards;
}
@keyframes i18n-fallback { to { opacity: 1; } }

body { transition: opacity 0.25s ease; }

html[lang="mr"] body { font-family: 'Mukta', 'Poppins', ui-sans-serif, system-ui, sans-serif; }
html[lang="mr"] h1 { line-height: 1.25; }
html[lang="mr"] p,
html[lang="mr"] li { line-height: 1.75; }

section[id] { scroll-margin-top: 80px; }

/* ---------- Navbar ---------- */
#navbar .nav-brand { color: #fff; }
#navbar .nav-sub { color: #fcd34d; }
#navbar .nav-link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 9999px;
  transition: color 0.2s, background-color 0.2s;
}
#navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
#navbar .nav-link.active { color: #fcd34d; }
#navbar .lang-switch { background: rgba(255, 255, 255, 0.12); color: #fff; }
#navbar .menu-btn { color: #fff; }

#navbar .lang-btn { transition: background-color 0.2s, color 0.2s; }
#navbar .lang-btn.active { background: #f59e0b; color: #04190f; }

/* Solid navbar after scrolling or when mobile menu is open */
#navbar.scrolled,
#navbar.menu-open {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px -16px rgba(6, 78, 59, 0.35);
}
#navbar.scrolled .nav-brand,
#navbar.menu-open .nav-brand { color: #0b3d2e; }
#navbar.scrolled .nav-sub,
#navbar.menu-open .nav-sub { color: #d97706; }
#navbar.scrolled .nav-link { color: #334155; }
#navbar.scrolled .nav-link:hover { color: #047857; background: #ecfdf5; }
#navbar.scrolled .nav-link.active { color: #047857; background: #ecfdf5; }
#navbar.scrolled .lang-switch,
#navbar.menu-open .lang-switch { background: #f1f5f9; color: #334155; }
#navbar.scrolled .menu-btn,
#navbar.menu-open .menu-btn { color: #0b3d2e; }

/* Mobile menu slide-down */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}
.mobile-menu.open { max-height: 480px; opacity: 1; }
.mobile-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  color: #334155;
}
.mobile-link:hover,
.mobile-link.active { background: #ecfdf5; color: #047857; }

/* ---------- Section headings ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d97706;
}
.section-title {
  margin-top: 0.75rem;
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: #0b3d2e;
}
.section-subtitle {
  margin: 1rem auto 0;
  font-size: 1.075rem;
  line-height: 1.7;
  color: #64748b;
}

/* ---------- Hero floating cards ---------- */
.float-card { animation: floaty 6s ease-in-out infinite; }
.float-delay { animation-delay: -3s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Benefits ---------- */
.benefit-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.5rem;
  background: #fff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.benefit-card:hover {
  transform: translateY(-6px);
  border-color: #a7f3d0;
  box-shadow: 0 24px 40px -20px rgba(6, 78, 59, 0.35);
}
.benefit-icon {
  display: inline-flex;
  width: 3.75rem;
  height: 3.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
}

/* ---------- Services ---------- */
.service-card {
  overflow: hidden;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.25);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 50px -22px rgba(6, 78, 59, 0.45);
}
.service-img { aspect-ratio: 16 / 10; overflow: hidden; }
.service-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.service-card:hover .service-img img { transform: scale(1.07); }
.service-icon {
  position: absolute;
  top: -1.75rem;
  left: 1.5rem;
  display: flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: #047857;
  color: #fff;
  box-shadow: 0 10px 20px -8px rgba(4, 120, 87, 0.6);
  transition: background-color 0.3s, color 0.3s, transform 0.3s;
}
.service-card:hover .service-icon { background: #f59e0b; color: #04190f; transform: rotate(-6deg); }
.service-link {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #047857;
  transition: gap 0.2s, color 0.2s;
}
.service-link:hover { gap: 0.7rem; color: #d97706; }

/* ---------- Installations ---------- */
.install-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  aspect-ratio: 4 / 3;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
}
.install-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.install-card:hover img { transform: scale(1.06); }
.install-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 25, 15, 0.9) 0%, rgba(4, 25, 15, 0.25) 45%, transparent 70%);
}
.install-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.95);
  color: #04190f;
  font-size: 0.75rem;
  font-weight: 600;
}
.install-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem; }

/* ---------- About ---------- */
.about-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
}

/* ---------- Contact ---------- */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: #fff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 10px 30px -22px rgba(15, 23, 42, 0.3);
}
.contact-icon {
  display: flex;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  background: #ecfdf5;
  color: #047857;
}
.contact-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; }
.contact-value { margin-top: 0.15rem; font-weight: 600; color: #0b3d2e; }

.form-label { display: block; margin-bottom: 0.45rem; font-size: 0.9rem; font-weight: 600; color: #334155; }
.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.form-input:focus { border-color: #10b981; background: #fff; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
.form-input.invalid { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12); }
.form-error { min-height: 1.1rem; margin-top: 0.3rem; font-size: 0.8rem; color: #dc2626; }

/* ---------- Footer ---------- */
.footer-link { transition: color 0.2s; }
.footer-link:hover { color: #fcd34d; }

/* ---------- Back to top ---------- */
#back-to-top.show { opacity: 1; transform: translateY(0); }

/* ---------- Modal ---------- */
#success-modal.open { display: flex; }
#success-modal.open .modal-card { animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes pop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- WhatsApp picker ---------- */
#wa-modal.open { display: flex; }
#wa-modal.open .modal-card { animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.wa-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.wa-option:hover { border-color: #86efac; background: #f0fdf4; }
.wa-option[aria-checked="true"] { border-color: #25d366; background: #dcfce7; color: #075e54; }
.wa-option svg { flex-shrink: 0; width: 1.1rem; height: 1.1rem; color: #16a34a; }
.wa-float::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: wa-pulse 2.4s infinite;
}
@keyframes wa-pulse {
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html.i18n-pending body { opacity: 1; }
}
