/* ==========================================================================
   myDigiBill — Features Page Styles & Interactive Component Simulator Engine
   ========================================================================== */

/* Smooth Scroll & Base Typography */
html {
  scroll-behavior: smooth !important;
  scroll-padding-top: 210px !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  overflow-x: hidden;
}

.feature-module-section,
section[id],
section,
table,
.overflow-x-auto {
  scroll-margin-top: 210px !important;
}

/* Hero Canvas Overlay (Tailwind Fallback) */
.hero-dark-canvas {
  background: radial-gradient(circle at 50% 20%, #0F1C3D 0%, #0A1229 60%, #050A1A 100%);
  position: relative;
  overflow: hidden;
}

.hero-grid-overlay {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.text-gradient-cyan {
  background: linear-gradient(100deg, #60A5FA 10%, #A5C8FF 45%, #38BDF8 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Primary Animated Button Shimmer */
.btn-shimmer-blue {
  background: linear-gradient(110deg, #0052CC 0%, #2563EB 40%, #38BDF8 50%, #2563EB 60%, #0052CC 100%);
  background-size: 200% 100%;
  animation: shimmerBtn 4s infinite linear;
}

@keyframes shimmerBtn {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Sticky Jump Bar Clean Light Theme Overlay */
.sticky-jump-bar {
  position: sticky;
  top: var(--header-sticky-offset, 72px);
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(255, 255, 255, 0.98) !important;
  border-top: 1px solid #E2E8F0 !important;
  border-bottom: 1px solid #E2E8F0 !important;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow-x: hidden;
  max-width: 100%;
}

/* When header is hidden (scrolled down), jump bar smoothly moves to top: 0 */
html.header--hidden .sticky-jump-bar,
body.header--hidden .sticky-jump-bar,
.header--hidden ~ * .sticky-jump-bar,
[data-component="header"].header--hidden ~ main .sticky-jump-bar,
[data-component="header"].nav-hidden ~ main .sticky-jump-bar,
#site-header.header--hidden ~ main .sticky-jump-bar,
#site-header.nav-hidden ~ main .sticky-jump-bar {
  top: 0px !important;
}

/* Scrollbar Hiding Engine for Navigation Bar */
#jump-pills-container,
.scrollbar-none {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
}

#jump-pills-container::-webkit-scrollbar,
.scrollbar-none::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

.jump-pill {
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: 9999px;
  font-weight: 600;
}

.jump-pill.active {
  background-color: #0066CC !important;
  color: #FFFFFF !important;
  border-color: #0066CC !important;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25) !important;
}

.jump-pill.active svg {
  stroke: #FFFFFF !important;
}

/* Mobile View: 2-Column Symmetric Grid Layout (< 768px) */
@media (max-width: 767px) {
  #jump-pills-container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }
  .jump-pill {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.4rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

/* Desktop View: Flexible Centered Wrap (>= 768px) */
@media (min-width: 768px) {
  #jump-pills-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    overflow-x: visible !important;
  }
  .jump-pill {
    width: auto !important;
  }
}

/* Feature Cards & Simulators */
.feature-card-clean {
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  background: #FFFFFF;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.feature-card-clean:hover {
  border-color: #93C5FD;
  box-shadow: 0 12px 28px -6px rgba(0, 102, 204, 0.09);
}

.code-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}

/* Invoice Template Switcher Tabs */
.template-tab {
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-tab.active {
  border-color: #0066CC !important;
  background-color: #EBF4FE !important;
  color: #0066CC !important;
  font-weight: 700 !important;
}

/* Role Permission Matrix Chips */
.role-chip {
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-chip.active {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
}

/* Modern Clean Feature Grid Cards */
.colorful-feature-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.colorful-feature-card:hover {
  transform: translateY(-4px);
  border-color: #93C5FD;
  box-shadow: 0 12px 24px -6px rgba(0, 102, 204, 0.1);
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Dedicated Template Showcase Cards */
.template-card-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.template-card-item:hover {
  transform: translateY(-4px);
  border-color: #3B82F6;
  box-shadow: 0 16px 32px -8px rgba(0, 102, 204, 0.12);
}

/* Template Image Preview Container */
.template-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  transition: all 0.3s ease;
  aspect-ratio: 16 / 11;
}

.template-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}

.template-card-item:hover .template-img-wrapper img {
  transform: scale(1.04);
}

.template-img-wrapper:hover {
  border-color: #3B82F6;
}

.template-zoom-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.9;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.template-card-item:hover .template-zoom-badge {
  background: rgba(37, 99, 235, 0.95);
  opacity: 1;
}

/* Clean Product Image Feature Card Frame */
.feature-img-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 0.5rem;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-img-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px -10px rgba(0, 102, 204, 0.14);
  border-color: #93C5FD;
}

/* Responsive Adaptations */
@media (max-width: 768px) {
  .sticky-jump-bar {
    top: var(--header-sticky-offset, 60px);
    padding: 8px 12px;
  }
  html.header--hidden .sticky-jump-bar,
  body.header--hidden .sticky-jump-bar {
    top: 0px !important;
  }
}

/* Custom Range Slider Track & Thumb Styling (Matching Provided Spec) */
.stock-custom-range {
  background: linear-gradient(90deg, #0052A3 0%, #1467D2 var(--fill, 48%), #D0DCEB var(--fill, 48%), #D0DCEB 100%);
  -webkit-appearance: none;
  appearance: none;
}
.stock-custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #1467D2;
  box-shadow: 0 4px 10px rgba(20, 103, 210, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.stock-custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.stock-custom-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #1467D2;
  box-shadow: 0 4px 10px rgba(20, 103, 210, 0.35);
  cursor: grab;
}

/* Tab Change Smooth Animation Engine (Zero Jerks / Jhatke) */
@keyframes tabFadeScaleIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.tab-content-anim {
  animation: tabFadeScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: opacity, transform, filter;
}

/* Image Smooth Switcher */
#content img {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ==========================================================================
   State-of-the-Art Scroll Reveal Animation Engine
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* Staggered Child Element Animations */
.reveal-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible .reveal-child {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Stagger Delays */
.reveal-on-scroll.is-visible .reveal-child:nth-child(1) { transition-delay: 0.08s; }
.reveal-on-scroll.is-visible .reveal-child:nth-child(2) { transition-delay: 0.16s; }
.reveal-on-scroll.is-visible .reveal-child:nth-child(3) { transition-delay: 0.24s; }
.reveal-on-scroll.is-visible .reveal-child:nth-child(4) { transition-delay: 0.32s; }

/* Responsive Screen Scaling across all devices (320px Mobile to 4K Monitors) */
@media (max-width: 640px) {
  .feature-module-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .feature-module-section img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Header & Drawer Logo Dimension Safeguards */
#site-header .brand-logo-link img {
  height: 32px !important;
  max-height: 32px !important;
  width: auto !important;
}

.mobile-drawer__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.75rem 1.25rem !important;
  height: 4rem !important;
  min-height: 4rem !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e8edf3 !important;
}

.mobile-drawer__logo img {
  height: 32px !important;
  max-height: 32px !important;
  width: auto !important;
  object-fit: contain !important;
  display: block !important;
}

@media (min-width: 1024px) {
  #site-header .brand-logo-link img {
    height: 36px !important;
    max-height: 36px !important;
  }
}

/* Compact & Lower Floating WhatsApp Button (Mobile & Desktop) */
.whatsapp-float {
  position: fixed !important;
  z-index: 9999 !important;
  transition: all 0.25s ease !important;
}

@media (max-width: 767px) {
  .whatsapp-float {
    bottom: 14px !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4) !important;
  }
  .whatsapp-float svg {
    width: 22px !important;
    height: 22px !important;
  }
}

@media (min-width: 768px) {
  .whatsapp-float {
    bottom: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
  }
  .whatsapp-float svg {
    width: 25px !important;
    height: 25px !important;
  }
}
