/* KMS Power Solutions - Custom Styles */

/* Services hero title: black in light mode, white in dark mode */
[data-theme="light"] .services-hero-title { color: #000000; }
[data-theme="dark"]  .services-hero-title { color: #ffffff; }

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #111111;
}
::-webkit-scrollbar-thumb {
  background: #9C1C1C;
  border-radius: 3px;
}

/* Font */
body {
  font-family: 'Roboto', sans-serif;
}

/* Header */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #9C1C1C;
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero section */
.hero-overlay {
  background: linear-gradient(135deg, rgba(17,17,17,0.92) 0%, rgba(156,28,28,0.5) 100%);
}

/* Animated counter */
.counter-value {
  display: inline-block;
}

/* Card hover effects */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(156,28,28,0.25);
}

.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
  border-color: #9C1C1C;
}

/* Image overlay effect */
.img-overlay {
  position: relative;
  overflow: hidden;
}
.img-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(156,28,28,0.0);
  transition: background 0.3s ease;
}
.img-overlay:hover::after {
  background: rgba(156,28,28,0.15);
}
.img-overlay img {
  transition: transform 0.5s ease;
}
.img-overlay:hover img {
  transform: scale(1.05);
}

/* Modal */
#quoteModal {
  backdrop-filter: blur(4px);
}
.modal-enter {
  animation: modalFadeIn 0.3s ease forwards;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* WhatsApp button */
#whatsapp-btn {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: pulse 2.5s infinite;
}
#whatsapp-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 24px rgba(37,211,102,0.5);
  animation: none;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  50%       { box-shadow: 0 0 0 10px rgba(37,211,102,0); }
}

/* Stats section */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: #9C1C1C;
}

/* Section fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.0s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* Testimonial card */
.testimonial-card {
  transition: transform 0.3s ease;
}
.testimonial-card:hover {
  transform: translateY(-4px);
}

/* CTA section diagonal */
.cta-diagonal {
  position: relative;
}
.cta-diagonal::before {
  content: '';
  position: absolute;
  top: -40px; left: 0;
  width: 100%; height: 80px;
  background: inherit;
  transform: skewY(-2deg);
  transform-origin: top left;
}

/* Form inputs */
.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
  box-shadow: 0 0 0 3px rgba(156,28,28,0.25);
}

/* Hamburger */
.hamburger-line {
  transition: all 0.3s ease;
}
.hamburger.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu */
#mobile-menu {
  transition: max-height 0.4s ease, opacity 0.4s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
#mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

/* Map placeholder */
.map-placeholder {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 2px dashed #333;
}

/* Hero badge */
.hero-badge {
  animation: badgePop 0.6s ease 0.8s both;
}
@keyframes badgePop {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* Marquee / ticker (optional for brand strip) */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  animation: marquee 18s linear infinite;
}

/* Active nav page highlight */
.nav-active::after {
  width: 100% !important;
}

/* =====================================================
   THEME — smooth colour transitions on mode switch
   ===================================================== */
*,
*::before,
*::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
/* Preserve animation-specific transitions on interactive elements */
.fade-in,
.stagger-children > *,
.hero-badge,
.product-card,
.service-card,
.testimonial-card,
#whatsapp-btn,
#scroll-top {
  transition: opacity 0.6s ease, transform 0.6s ease,
              background-color 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, box-shadow 0.3s ease;
}

/* =====================================================
   LIGHT MODE
   ===================================================== */
[data-theme="light"] ::-webkit-scrollbar-track { background: #e2e8f0; }

/* Body */
[data-theme="light"] body {
  background-color: #f8fafc;
  color: #111827;
}

/* Header */
[data-theme="light"] #site-header {
  background-color: rgba(255, 255, 255, 0.97) !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] .nav-link             { color: #374151 !important; }
[data-theme="light"] .nav-link:hover       { color: #111827 !important; }
[data-theme="light"] .hamburger-line       { background-color: #111827 !important; }
[data-theme="light"] #mobile-menu nav      { border-color: #e2e8f0 !important; }

/* Theme toggle button */
[data-theme="light"] #theme-toggle {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

/* Backgrounds */
[data-theme="light"] .bg-dark              { background-color: #f8fafc !important; }
[data-theme="light"] .bg-gray-950          { background-color: #f1f5f9 !important; }
[data-theme="light"] .bg-gray-900          { background-color: #ffffff !important; }
[data-theme="light"] .bg-gray-800          { background-color: #e2e8f0 !important; }

/* Text */
[data-theme="light"] .text-white           { color: #111827 !important; }
[data-theme="light"] .text-gray-300        { color: #374151 !important; }
[data-theme="light"] .text-gray-400        { color: #6b7280 !important; }
[data-theme="light"] .text-gray-500        { color: #94a3b8 !important; }
[data-theme="light"] .text-gray-600        { color: #6b7280 !important; }

/* Borders */
[data-theme="light"] .border-gray-800      { border-color: #e2e8f0 !important; }
[data-theme="light"] .border-gray-700      { border-color: #cbd5e1 !important; }
[data-theme="light"] .border-gray-600      { border-color: #94a3b8 !important; }

/* Cards */
[data-theme="light"] .service-card         { border-color: #e2e8f0 !important; }
[data-theme="light"] .service-card:hover   { box-shadow: 0 16px 32px rgba(0,0,0,0.08) !important; }
[data-theme="light"] .product-card:hover   { box-shadow: 0 20px 40px rgba(156,28,28,0.12) !important; }
[data-theme="light"] .stat-card            { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* Form inputs */
[data-theme="light"] input:not([type="submit"]):not([type="hidden"]):not([type="checkbox"]),
[data-theme="light"] select,
[data-theme="light"] textarea {
  background-color: #ffffff !important;
  border-color: #d1d5db !important;
  color: #111827 !important;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder  { color: #9ca3af !important; }

/* Quote modal */
[data-theme="light"] #quoteModalInner {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] #quoteModalInner .text-white            { color: #111827 !important; }
[data-theme="light"] #quoteModalInner .text-gray-300,
[data-theme="light"] #quoteModalInner .text-gray-400         { color: #6b7280 !important; }
[data-theme="light"] #quoteModalInner .border-gray-700       { border-color: #e2e8f0 !important; }

/* Map */
[data-theme="light"] .map-placeholder {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0) !important;
  border-color: #cbd5e1 !important;
}

/* Scroll-to-top */
[data-theme="light"] #scroll-top           { background-color: #e2e8f0 !important; }
[data-theme="light"] #scroll-top svg       { color: #374151 !important; }

/* =====================================================
   IMAGE OVERLAY CARDS — always stay dark (backdrop-blur-sm)
   The header uses backdrop-blur-md, so this only targets
   the frosted info cards overlaid on images.
   ===================================================== */
[data-theme="light"] .backdrop-blur-sm {
  background-color: rgba(17, 17, 17, 0.85) !important;
}
[data-theme="light"] .backdrop-blur-sm .text-white  { color: #ffffff !important; }
[data-theme="light"] .backdrop-blur-sm .text-gray-400 { color: #9ca3af !important; }

/* =====================================================
   ALWAYS DARK — hero image section & maroon CTA
   ===================================================== */
/* Force all text inside hero to stay light (dark image overlay behind it) */
[data-theme="light"] #hero                 { color: #ffffff !important; }
[data-theme="light"] #hero h1              { color: #ffffff !important; }
[data-theme="light"] #hero .text-white     { color: #ffffff !important; }
[data-theme="light"] #hero .text-gray-300  { color: #d1d5db !important; }
[data-theme="light"] #hero .text-gray-400  { color: #9ca3af !important; }
[data-theme="light"] #hero .text-gray-500  { color: #6b7280 !important; }

/* Maroon backgrounds (buttons, icon boxes, CTA section) — always keep white */
[data-theme="light"] .bg-maroon                      { color: #ffffff !important; }
[data-theme="light"] .bg-maroon .text-white          { color: #ffffff !important; }
[data-theme="light"] .bg-maroon .text-gray-300       { color: #fecaca !important; }
[data-theme="light"] .bg-maroon svg                  { color: #ffffff !important; }
