/* ==========================================================================
   AL Services — Custom Stylesheet
   Production-ready CSS for the AL Services static HTML website.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BASE STYLES
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1f36;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus-visible — accessible keyboard focus ring */
:focus-visible {
  outline: 2px solid #d5c271;
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link (screen-reader / keyboard users) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: #1a1f36;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0.5rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast preference */
@media (prefers-contrast: more) {
  :root {
    --contrast-border: 2px solid currentColor;
  }

  .btn-primary,
  .btn-secondary,
  .btn-accent,
  .card,
  .glass,
  .glass-strong {
    border: var(--contrast-border);
  }

  .text-gradient {
    -webkit-text-fill-color: currentColor;
    background: none;
  }
}


/* --------------------------------------------------------------------------
   2. COMPONENT CLASSES
   -------------------------------------------------------------------------- */

/* Buttons ---------------------------------------------------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  color: #ffffff;
  background-color: #1a1f36;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background-color: #2a3050;
  box-shadow: 0 4px 14px rgba(26, 31, 54, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  color: #1a1f36;
  background-color: transparent;
  border: 2px solid #1a1f36;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease,
    transform 0.15s ease;
}

.btn-secondary:hover {
  background-color: #1a1f36;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(26, 31, 54, 0.25);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  color: #1a1f36;
  background: linear-gradient(135deg, #d5c271, #c4a94d);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #c4a94d, #a88b3a);
  box-shadow: 0 4px 14px rgba(213, 194, 113, 0.45);
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: translateY(0);
}

/* Cards ------------------------------------------------------------------ */

.card {
  background-color: #ffffff;
  border: 1px solid rgba(26, 31, 54, 0.08);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(26, 31, 54, 0.1);
}

/* Glass ------------------------------------------------------------------ */

.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Loading states --------------------------------------------------------- */

.loading-shimmer {
  background: linear-gradient(
    90deg,
    rgba(26, 31, 54, 0.06) 25%,
    rgba(26, 31, 54, 0.12) 50%,
    rgba(26, 31, 54, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}

.loading-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(26, 31, 54, 0.15);
  border-top-color: #d5c271;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Screen-reader only ----------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* --------------------------------------------------------------------------
   3. LOGO STYLES
   -------------------------------------------------------------------------- */

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-glow {
  filter: drop-shadow(0 0 6px rgba(213, 194, 113, 0.3));
  transition: filter 0.3s ease;
}

.logo-glow:hover {
  filter: drop-shadow(0 0 12px rgba(213, 194, 113, 0.5));
}


/* --------------------------------------------------------------------------
   4. TEXT UTILITIES
   -------------------------------------------------------------------------- */

.text-gradient {
  background: linear-gradient(135deg, #1a1f36, #d5c271);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* --------------------------------------------------------------------------
   5. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */

.section-padding {
  padding-top: 5rem;    /* py-20 */
  padding-bottom: 5rem;
}

.container-padding {
  padding-left: 1rem;   /* px-4 */
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-padding {
    padding-left: 1.5rem;  /* sm:px-6 */
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .section-padding {
    padding-top: 7rem;    /* lg:py-28 */
    padding-bottom: 7rem;
  }

  .container-padding {
    padding-left: 2rem;   /* lg:px-8 */
    padding-right: 2rem;
  }
}


/* --------------------------------------------------------------------------
   6. KEYFRAME ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(213, 194, 113, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(213, 194, 113, 0.7);
  }
}

@keyframes wave {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(-10deg);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(213, 194, 113, 0.4);
  }
  50% {
    box-shadow: 0 0 24px rgba(213, 194, 113, 0.8);
  }
}


/* --------------------------------------------------------------------------
   7. STAGGER ANIMATIONS
   -------------------------------------------------------------------------- */

.stagger-animate > * {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.stagger-animate > *:nth-child(1)  { animation-delay: 0.1s; }
.stagger-animate > *:nth-child(2)  { animation-delay: 0.2s; }
.stagger-animate > *:nth-child(3)  { animation-delay: 0.3s; }
.stagger-animate > *:nth-child(4)  { animation-delay: 0.4s; }
.stagger-animate > *:nth-child(5)  { animation-delay: 0.5s; }
.stagger-animate > *:nth-child(6)  { animation-delay: 0.6s; }
.stagger-animate > *:nth-child(7)  { animation-delay: 0.7s; }
.stagger-animate > *:nth-child(8)  { animation-delay: 0.8s; }
.stagger-animate > *:nth-child(9)  { animation-delay: 0.9s; }
.stagger-animate > *:nth-child(10) { animation-delay: 1.0s; }
.stagger-animate > *:nth-child(11) { animation-delay: 1.1s; }
.stagger-animate > *:nth-child(12) { animation-delay: 1.2s; }


/* --------------------------------------------------------------------------
   8. ANIMATION UTILITY CLASSES
   -------------------------------------------------------------------------- */

.animate-fadeIn {
  animation: fadeIn 0.6s ease both;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease both;
}

.animate-bounce {
  animation: bounce 1s ease infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent 25%,
    rgba(213, 194, 113, 0.15) 50%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

.animate-scroll {
  animation: scroll 30s linear infinite;
}

.animate-slideInLeft {
  animation: slideInLeft 0.6s ease both;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease both;
}

.animate-scaleUp {
  animation: scaleUp 0.5s ease both;
}

.animate-rotateIn {
  animation: rotateIn 0.6s ease both;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-wave {
  animation: wave 1.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

/* Ping animation for green dot */
@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-500 { animation-delay: 0.5s; }


/* --------------------------------------------------------------------------
   9. MOBILE RESPONSIVE OVERRIDES
   -------------------------------------------------------------------------- */

/* Prevent horizontal overflow globally */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Mobile header - always visible bg on small screens */
@media (max-width: 1023px) {
  #header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(226,232,240,0.5);
  }

  /* Nav links dark text on white header */
  #header .nav-link {
    color: #334155 !important;
  }

  #header .nav-link:hover {
    color: #c4a94d !important;
  }

  /* Logo smaller on mobile */
  #header img[alt="AL Services Logo"] {
    height: 3rem;
  }
}

/* Extra small screens */
@media (max-width: 640px) {
  /* Hero padding fix */
  #home {
    padding-top: 6rem;
  }

  /* Hero headline smaller */
  #home h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  /* Hero metrics stack nicely */
  #hero-metrics > div {
    padding: 1rem;
  }

  /* CTA buttons full width */
  #home .flex.flex-col a {
    width: 100%;
    text-align: center;
  }

  /* Footer grid single column */
  footer .grid {
    gap: 2rem;
  }

  /* Service cards padding */
  .card {
    padding: 1.25rem;
  }

  /* Contact form padding */
  #contact .bg-white {
    padding: 1.5rem;
  }

  /* Section headings smaller on mobile */
  .font-display {
    word-break: break-word;
  }

  /* Pincode modal full width */
  #pincode-modal .bg-white {
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  /* WhatsApp panel responsive */
  #whatsapp-panel {
    width: calc(100vw - 3rem);
    max-width: 320px;
  }
}

/* Medium screens */
@media (max-width: 768px) {
  /* Top bar hidden on mobile since header is sticky */
  #top-bar {
    font-size: 0.75rem;
  }

  /* Mobile menu position */
  #mobile-menu {
    top: 57px;
  }

  /* Testimonial grid 2 columns on tablet */
  #testimonials .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Scrolled state - header bg change (added via JS) */
#header.scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#header.scrolled .nav-link {
  color: #334155;
}

#header.scrolled .nav-link:hover {
  color: #c4a94d;
}

/* Hide top bar when scrolled */
#top-bar.hidden-bar {
  display: none;
}

/* Body scroll lock for mobile menu */
body.menu-open {
  overflow: hidden;
}


/* --------------------------------------------------------------------------
   10. FONT OVERRIDES
   -------------------------------------------------------------------------- */

.font-display,
.font-serif {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
}
