/* Mobile Responsive Enhancements for Fitness with Bennies */
/* Enhanced Hero Banner Responsiveness */

/* Fluid Typography for Hero Sections */
.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: clamp(0.5rem, 2vw, 1.5rem);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  line-height: 1.4;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

.page-hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
}

.page-hero-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  line-height: 1.4;
}

/* Enhanced Hero Section Scaling */
.hero {
  min-height: clamp(40vh, 50vh, 70vh);
  padding: clamp(60px, 8vh, 100px) 0;
}

/* Override styles.css mobile hero height truncation */
@media (max-width: 767px) {
  .hero {
    min-height: clamp(40vh, 50vh, 70vh) !important;
    padding: clamp(60px, 8vh, 100px) 0 !important;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: clamp(40vh, 50vh, 70vh) !important;
    padding: clamp(60px, 8vh, 100px) 0 !important;
  }
}

.page-hero {
  min-height: clamp(40vh, 50vh, 70vh);
  padding: clamp(60px, 8vh, 100px) 0;
}

/* Improved Hero Content Positioning */
.hero-content {
  padding: 0 clamp(1rem, 4vw, 2rem);
  margin-top: clamp(2rem, 8vh, 4rem);
  max-width: min(90vw, 800px);
}

.page-hero-content {
  padding: 0 clamp(1rem, 4vw, 2rem);
  max-width: min(90vw, 600px);
}

/* Enhanced Mobile Navigation */
.mobile-nav-toggle {
  display: none !important;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  color: var(--color-dark-gray, #333);
  font-size: 1.5rem;
  z-index: 1001;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus {
  background-color: rgba(255, 49, 49, 0.1);
  transform: scale(1.05);
}

.mobile-nav-toggle:active {
  transform: scale(0.95);
}

/* Show hamburger menu on mobile and tablet */
@media (max-width: 1023px) {
  .mobile-nav-toggle {
    display: flex !important;
  }
  
  .nav-list {
    display: none !important;
  }
  
  .nav-cta {
    display: none !important;
  }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-list {
    top: 90px;
    padding: 2rem;
  }
  
  .nav-item {
    margin: 1rem 0;
  }
  
  .nav-link {
    font-size: 1.2rem;
    padding: 1rem;
  }
}

/* Enhanced Mobile Menu */
@media (max-width: 1023px) {
  .nav-list {
    display: none !important;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    padding: clamp(1rem, 4vw, 2rem);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  
  .nav-list.active {
    display: flex !important;
    transform: translateY(0);
  }
  
  .nav-item {
    margin: clamp(0.5rem, 2vw, 1rem) 0;
    width: 100%;
    text-align: center;
  }
  
  .nav-link {
    display: block;
    padding: clamp(0.75rem, 3vw, 1.25rem);
    width: 100%;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    border-radius: 8px;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
  }
  
  .nav-link:hover,
  .nav-link:focus {
    background-color: rgba(255, 49, 49, 0.1);
    transform: translateY(-2px);
  }
  
  .nav-cta {
    margin-top: clamp(1rem, 3vw, 1.5rem);
    display: flex;
    justify-content: center;
  }
  
  /* Hide desktop navigation elements on mobile */
  .nav {
    position: relative;
  }
  
  /* Hamburger icon animation */
  .mobile-nav-toggle.active i {
    transform: rotate(90deg);
  }
  
  .mobile-nav-toggle i {
    transition: transform 0.3s ease;
  }
}

/* Touch-Friendly Button Enhancements */
.btn {
  min-height: 44px;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
  font-size: clamp(0.9rem, 2vw, 1rem);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}

.btn-primary:active {
  background-color: #d42929;
}

/* Enhanced Hero CTA Layout */
.hero-cta {
  display: flex;
  gap: clamp(0.75rem, 3vw, 1.5rem);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: clamp(1rem, 3vw, 2rem);
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* Improved Video Responsiveness */
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Override styles.css that hides video on mobile */
@media (max-width: 768px) {
  .hero-video {
    display: block !important;
    object-position: center 30%;
  }
}

@media (max-width: 480px) {
  .hero-video {
    display: block !important;
    object-position: center 25%;
  }
}

/* Override specific styles.css media query that hides video on mobile devices */
@media (max-width: 480px) and (max-device-width: 480px) {
  .hero-video {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 25% !important;
  }
  
  .hero {
    background: none !important;
  }
}

/* Fix mobile hero layout - ensure content overlays video properly */
@media (max-width: 767px) {
  .hero {
    display: block !important; /* Override flexbox layout */
    position: relative !important;
  }
  
  .hero-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 600px !important;
    margin-top: 0 !important;
    z-index: 3 !important;
    text-align: center !important;
  }
  
  .hero-video-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
  }
}

/* Ensure video container is visible on mobile */
@media (max-width: 480px) {
  .hero-video-container {
    display: block !important;
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
  
  .hero-video-container.loaded .hero-video {
    opacity: 1 !important;
  }
  
  /* Fallback background for loading states */
  .hero-video-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-black) 0%, rgba(26, 26, 26, 0.9) 30%, var(--color-primary) 70%, var(--color-secondary) 100%);
    z-index: 1;
  }
  
  /* Error state fallback background */
  .hero-video-container.error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-black) 0%, rgba(26, 26, 26, 0.9) 30%, var(--color-primary) 70%, var(--color-secondary) 100%);
    z-index: 1;
  }
  
  .hero-video-container.error .hero-video {
    display: none;
  }
}

/* Enhanced Decorative Shapes Responsiveness */
.hero .shape-1,
.hero .shape-2,
.hero .shape-3,
.page-hero .shape-1,
.page-hero .shape-2,
.page-hero .shape-3 {
  display: none;
}

@media (min-width: 768px) {
  .hero .shape-1,
  .hero .shape-2,
  .hero .shape-3,
  .page-hero .shape-1,
  .page-hero .shape-2,
  .page-hero .shape-3 {
    display: block;
  }
}

/* Improved Typography Scale */
h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  line-height: 1.3;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.4;
}

p {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  line-height: 1.6;
}

/* Enhanced Container Responsiveness */
.container {
  max-width: min(90vw, 1200px);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Improved Section Spacing */
section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.hero,
.page-hero {
  padding-top: clamp(60px, 10vh, 120px);
  padding-bottom: clamp(2rem, 6vw, 4rem);
}

/* Enhanced Form Responsiveness */
.form-group {
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.form-control {
  min-height: 44px;
  padding: clamp(0.75rem, 2vw, 1rem);
  font-size: clamp(0.9rem, 2vw, 1rem);
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Enhanced Grid Responsiveness */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: clamp(1rem, 3vw, 1.5rem);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(0.75rem, 2vw, 1rem);
}

/* Enhanced Card Responsiveness */
.service-card,
.credential-item,
.benefit-card {
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: clamp(8px, 2vw, 16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.credential-item:hover,
.benefit-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Enhanced Image Responsiveness */
img {
  max-width: 100%;
  height: auto;
  border-radius: clamp(4px, 1vw, 8px);
}

.service-detail-image {
  width: clamp(150px, 30vw, 200px);
  height: clamp(150px, 30vw, 200px);
  border-radius: clamp(8px, 2vw, 16px);
}

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

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-video,
  .page-hero img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding-top: 60px;
  }
  
  .hero-content {
    margin-top: 1rem;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
  }
  
  .hero-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-bottom: 1rem;
  }
  
  .hero-cta {
    gap: 1rem;
  }
}

/* Fix hero video layering - decorative shapes behind video */
.hero .shape-1,
.hero .shape-2,
.hero .shape-3,
.hero .shape-4,
.hero .shape-5 {
  z-index: 0 !important; /* Behind video (z-index: 1) but above particles (z-index: 0) */
}

/* Ensure video elements maintain proper layering */
.hero-video-container {
  z-index: 1 !important;
}

.hero-video {
  z-index: 1 !important;
}

.hero-content {
  z-index: 3 !important;
}

/* Ultra-wide Screen Optimizations */
@media (min-width: 1400px) {
  .container {
    max-width: 1200px;
  }
  
  .hero-content,
  .page-hero-content {
    max-width: 900px;
  }
}

/* Print Styles */
@media print {
  .hero-video,
  .mobile-nav-toggle,
  .nav-cta,
  .hero .shape-1,
  .hero .shape-2,
  .hero .shape-3 {
    display: none !important;
  }
  
  .hero {
    min-height: auto;
    padding: 2rem 0;
    background: white !important;
    color: black !important;
  }
}