/* ==========================================================================
   SUPERCOOL ENTERPRISES - Core Design System & Custom CSS
   Mobile-First Service Booking Experience & Premium Micro-Interactions
   ========================================================================== */

/* Core design variables (Fonts loaded via non-blocking <link> in HTML) */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --color-primary-navy: #08285B;
  --color-primary-blue: #0879E8;
  --color-light-blue: #EAF5FF;
  --color-extra-light-blue: #F5FAFF;
  --color-success-green: #12B76A;
  --color-orange: #F79009;
  --color-red: #F04438;
  --color-dark-text: #08285B;
  --color-secondary-text: #334155;
  --color-white: #FFFFFF;
  --color-border-subtle: #CBD5E1;
  --color-card-bg: #FFFFFF;
  
  --shadow-subtle: 0 4px 14px rgba(8, 40, 91, 0.08);
  --shadow-card: 0 6px 20px rgba(8, 40, 91, 0.1);
  --shadow-hover: 0 10px 25px rgba(8, 121, 232, 0.18);
  --shadow-nav: 0 -4px 20px rgba(8, 40, 91, 0.08);

  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Standard micro-interaction easings */
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 180ms;
  --duration-normal: 240ms;
}

/* Base resets & typography - Enhanced scaling for superior readability */
html {
  font-size: 16.5px;
  font-family: var(--font-body);
  color: var(--color-dark-text);
  background-color: #F8FAFC;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  html {
    font-size: 17px;
  }
}

body {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.55;
  background-color: #F8FAFC;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Headings font */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

/* Enhanced readability for compact badges & micro text */
.text-\[9px\], .text-\[9\.5px\] {
  font-size: 11px !important;
}
.text-\[10px\] {
  font-size: 11.75px !important;
}
.text-\[10\.5px\] {
  font-size: 12.25px !important;
}
.text-\[11px\] {
  font-size: 12.75px !important;
}
.text-\[11\.5px\] {
  font-size: 13.25px !important;
}

/* Ensure inputs, select boxes, and textareas have clear, easily readable text */
input, select, textarea, button {
  font-family: inherit;
}
input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select, textarea {
  font-size: 14px !important;
}
@media (min-width: 640px) {
  input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select, textarea {
    font-size: 14.5px !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Safe Area Inset Support */
.safe-pb {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

.safe-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   MICRO-INTERACTION 1: PAGE FADE-IN
   ========================================================================== */
main {
  animation: pageFadeIn 220ms ease-out forwards;
}

@keyframes pageFadeIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 4px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ==========================================================================
   MICRO-INTERACTION 2: SCROLL REVEAL (Fast, Subtle & GPU-accelerated)
/* Smooth scroll reveal */
.animate-on-scroll {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 300ms var(--ease-snappy), transform 300ms var(--ease-snappy);
}

.reveal-ready .animate-on-scroll {
  opacity: 1;
  transform: none;
}

.reveal-ready .animate-on-scroll.revealed {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* ==========================================================================
   MICRO-INTERACTION 3: CARD HOVER / ACTIVE TAP & PROMINENT SERVICE BORDERS
   ========================================================================== */
.brand-card, 
.support-category-card, 
.faq-item, 
.offer-card, 
.service-card-item, 
.appliance-select-card, 
.service-type-card, 
.amc-appliance-tab {
  background: var(--color-white);
  border: 2px solid #CBD5E1 !important;
  border-radius: 1rem;
  box-shadow: 0 4px 14px rgba(8, 40, 91, 0.08);
  transition: transform 200ms var(--ease-snappy), border-color 200ms ease, box-shadow 200ms ease;
  will-change: transform;
}

/* Inner image containers for service cards */
.service-card-item .relative {
  border: 2px solid #BFDBFE !important;
}

/* Selected active state for cards */
.appliance-select-card.border-brand-blue,
.service-type-card.border-brand-blue,
.amc-appliance-tab.border-brand-blue,
.selectable-card.selected {
  border-color: #0879E8 !important;
  background-color: #EFF6FF !important;
}

/* Desktop hover: vibrant brand blue border with enhanced shadow */
@media (hover: hover) and (pointer: fine) {
  .brand-card:hover, 
  .support-category-card:hover, 
  .offer-card:hover, 
  .service-card-item:hover,
  .appliance-select-card:hover,
  .service-type-card:hover,
  .amc-appliance-tab:hover {
    transform: translate3d(0, -3px, 0);
    border-color: #0879E8 !important;
    box-shadow: 0 10px 24px rgba(8, 121, 232, 0.18);
  }
}

/* Mobile active tap */
.brand-card:active, 
.support-category-card:active, 
.offer-card:active, 
.service-card-item:active,
.appliance-select-card:active,
.service-type-card:active,
.amc-appliance-tab:active {
  transform: scale(0.985);
  border-color: #0879E8 !important;
}

/* Header logo display enhancement */
header img[src*="logo.svg"], #mobile-drawer img[src*="logo.svg"] {
  filter: drop-shadow(0 1px 2px rgba(8, 40, 91, 0.08));
}

/* High-contrast form elements */
input[type="text"], textarea {
  border-color: #CBD5E1;
  color: #08285B;
  font-weight: 500;
}
input[type="text"]:focus, textarea:focus {
  border-color: #0879E8 !important;
  box-shadow: 0 0 0 3.5px rgba(8, 121, 232, 0.16) !important;
}

/* ==========================================================================
   MICRO-INTERACTION 4: BUTTON PRESS EFFECT
   ========================================================================== */
.btn-press, button, a.btn-press {
  transition: transform 150ms var(--ease-snappy), opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.btn-press:active, button:active, a.btn-press:active {
  transform: scale(0.965);
}

/* ==========================================================================
   MICRO-INTERACTION 5: ICON SCALE ON HOVER & TAP
   ========================================================================== */
.icon-scale-target {
  transition: transform 180ms var(--ease-snappy);
  will-change: transform;
}

.brand-card:hover .icon-scale-target,
.brand-card:active .icon-scale-target,
.btn-press:hover .icon-scale-target,
.btn-press:active .icon-scale-target {
  transform: scale(1.1);
}

/* ==========================================================================
   MICRO-INTERACTION 6: IMAGE SUBTLE ZOOM
   ========================================================================== */
.img-zoom-box {
  overflow: hidden;
  border-radius: 1rem;
}

.img-zoom-box img,
.brand-card img,
.service-icon-box img {
  transition: transform 250ms var(--ease-snappy);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .brand-card:hover img,
  .img-zoom-box:hover img {
    transform: scale(1.05);
  }
}

.brand-card:active img,
.img-zoom-box:active img {
  transform: scale(1.02);
}

/* ==========================================================================
   MICRO-INTERACTION 7: BOTTOM NAVIGATION ACTIVE ANIMATION
   ========================================================================== */
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-secondary-text);
  transition: color 180ms ease, transform 180ms var(--ease-snappy);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item.active {
  color: var(--color-primary-blue);
  font-weight: 700;
}

.bottom-nav-item.active svg,
.bottom-nav-item.active i {
  stroke: var(--color-primary-blue);
  transform: scale(1.12);
  transition: transform 200ms var(--ease-snappy);
}

/* ==========================================================================
   MICRO-INTERACTION 8: DRAWER SLIDE ANIMATION
   ========================================================================== */
#mobile-drawer {
  transition: transform 240ms var(--ease-snappy) !important;
  will-change: transform;
}

#drawer-overlay {
  transition: opacity 220ms ease !important;
  will-change: opacity;
}

.drawer-backdrop {
  background-color: rgba(8, 40, 91, 0.45);
  transition: opacity 220ms ease;
  will-change: opacity;
}

/* ==========================================================================
   MICRO-INTERACTION 9: MODAL SCALE & FADE
   ========================================================================== */
.modal-pop {
  animation: modalScaleFade 200ms var(--ease-snappy) forwards;
  will-change: transform, opacity;
}

@keyframes modalScaleFade {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   MICRO-INTERACTION 10: TOAST SLIDE-IN
   ========================================================================== */
.toast-animated {
  animation: toastEntrance 220ms var(--ease-snappy) forwards;
  will-change: transform, opacity;
}

@keyframes toastEntrance {
  0% {
    opacity: 0;
    transform: translate3d(0, -14px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.toast-exit {
  opacity: 0 !important;
  transform: translate3d(0, -12px, 0) !important;
  transition: opacity 180ms ease, transform 180ms ease !important;
}

/* ==========================================================================
   MICRO-INTERACTION 11: FAQ EXPAND / COLLAPSE
   ========================================================================== */
.faq-toggle {
  transition: background-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.faq-icon {
  transition: transform 200ms var(--ease-snappy);
  will-change: transform;
}

.faq-content {
  animation: faqFadeSlide 200ms ease-out forwards;
  will-change: opacity, transform;
}

@keyframes faqFadeSlide {
  0% {
    opacity: 0;
    transform: translate3d(0, -4px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ==========================================================================
   MICRO-INTERACTION 12: SERVICE CARD SELECTION ANIMATION
   ========================================================================== */
.selectable-card {
  transition: transform 180ms var(--ease-snappy), border-color 180ms ease, background-color 180ms ease;
  will-change: transform;
}

.selectable-card:active {
  transform: scale(0.97);
}

.selectable-card.selected {
  animation: cardSelectedPulse 200ms var(--ease-snappy);
}

@keyframes cardSelectedPulse {
  0% {
    transform: scale(0.97);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.check-badge-pop {
  animation: checkPopIn 200ms var(--ease-snappy) forwards;
}

@keyframes checkPopIn {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   MICRO-INTERACTION 13: BOOKING STEP TRANSITION
   ========================================================================== */
.stepper-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 200ms var(--ease-snappy), background-color 200ms ease;
  will-change: transform;
}

.stepper-circle.active {
  background-color: var(--color-primary-blue);
  color: #FFFFFF;
  transform: scale(1.08);
}

.stepper-circle.completed {
  background-color: var(--color-primary-blue);
  color: #FFFFFF;
}

.stepper-circle.upcoming {
  background-color: #F1F5F9;
  color: #94A3B8;
}

.wizard-step-container {
  animation: stepSlideIn 240ms var(--ease-snappy) forwards;
  will-change: opacity, transform;
}

@keyframes stepSlideIn {
  0% {
    opacity: 0;
    transform: translate3d(8px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ==========================================================================
   MICRO-INTERACTION 14: SKELETON SHIMMER LOADING
   ========================================================================== */
.skeleton-shimmer {
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
  background-size: 200% 100%;
  animation: shimmerMove 1.4s infinite linear;
  border-radius: 0.75rem;
}

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

/* Touch Friendly Targets */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hide scrollbar for clean horizontal scrolls */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   ACCESSIBILITY: RESPECT PREFERS-REDUCED-MOTION
   ========================================================================== */
@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;
  }
  main, .modal-pop, .toast-animated, .wizard-step-container, .faq-content {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
