/* Oasis Fit — Fully Optimized CSS v2.0 */
:root {
  --deep-blue: #1A3E72;
  --red-accent: #E74C3C;
  --light-gray: #F5F7FA;
  --fresh-green: #2ECC71;
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow-light: 0 4px 12px rgba(26, 62, 114, 0.08);
  --shadow-medium: 0 8px 24px rgba(26, 62, 114, 0.12);
  --shadow-heavy: 0 12px 36px rgba(26, 62, 114, 0.15);
  --border-radius: 12px;
  --border-radius-lg: 16px;
}

/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--light-gray);
  color: #222;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: 76px; /* Fixed navbar height */
}

/* Typography Scale */
h1, .display-1, .display-2, .display-3, .display-4, .display-5 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }
.lead { 
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(26, 62, 114, 0.9);
}

/* Navigation - Fixed */
.navbar {
  padding: 0.8rem 1rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.navbar.scrolled {
  background-color: rgba(26, 62, 114, 0.98) !important;
  padding: 0.5rem 1rem !important;
  box-shadow: var(--shadow-light);
}

.navbar-brand {
  color: #fff !important;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: var(--transition);
  position: relative;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
  color: #fff !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Color System */
.bg-primary { background-color: var(--deep-blue) !important; }
.bg-success { background-color: var(--fresh-green) !important; }
.bg-light { background-color: var(--light-gray) !important; }

.text-primary { color: var(--deep-blue) !important; }
.text-success { color: var(--fresh-green) !important; }

/* Buttons - Enhanced */
.btn {
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--deep-blue);
  border-color: var(--deep-blue);
  color: #fff;
}

.btn-primary:hover {
  background-color: #153258;
  border-color: #153258;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-success {
  background-color: var(--fresh-green);
  border-color: var(--fresh-green);
  color: #fff !important;
}

.btn-success:hover {
  background-color: #25a25a;
  border-color: #25a25a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-outline-primary {
  color: var(--deep-blue);
  border-color: var(--deep-blue);
}

.btn-outline-primary:hover {
  background-color: var(--deep-blue);
  border-color: var(--deep-blue);
  color: #fff;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
}

/* Cards - Fixed Popular Card */
.card-ghost {
  background: #fff;
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

.card-ghost:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-heavy);
}

/* Popular Card Specific Fix */
.card-ghost.border-success {
  border: 2px solid var(--fresh-green) !important;
  transform: scale(1.02);
}

.card-ghost.border-success:hover {
  transform: scale(1.02) translateY(-8px);
}

.card-ghost.border-success::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--fresh-green);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 0 var(--border-radius-lg) 0 var(--border-radius-lg);
  z-index: 2;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1.5rem 1.5rem 0.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Feature Icons */
.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(26, 62, 114, 0.1) 0%, rgba(46, 204, 113, 0.08) 100%);
  font-size: 2rem;
  color: var(--deep-blue);
  transition: var(--transition);
  flex-shrink: 0;
}

.feature-icon.small {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
}

.card-ghost:hover .feature-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--fresh-green) 100%);
  color: white;
}

/* ==================== IMAGE DIMENSION CONTROL ==================== */

/* Hero Images - Forced Dimensions */
.hero-img {
  width: 100%;
  height: 400px; /* Fixed height */
  object-fit: cover;
  object-position: center;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-heavy);
  transition: var(--transition);
}

.hero-img:hover {
  transform: scale(1.02);
}

/* Trainer Images - Forced Square Dimensions */
.trainer-img {
  width: 100%;
  height: 250px; /* Fixed height */
  object-fit: cover;
  object-position: center top;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.card-ghost:hover .trainer-img {
  transform: scale(1.05);
}

/* Facility Carousel Images - Forced Dimensions */
.carousel-item img {
  width: 100%;
  height: 450px; /* Fixed height */
  object-fit: cover;
  object-position: center;
  border-radius: var(--border-radius);
}

/* Service Card Images - Forced Dimensions */
.service-img {
  width: 100%;
  height: 200px; /* Fixed height */
  object-fit: cover;
  object-position: center;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Contact Page Images - Forced Dimensions */
.contact-hero-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--border-radius-lg);
}

/* General Image Optimization */
img {
  max-width: 100%;
  height: auto; /* Maintain aspect ratio */
}

img[data-src] {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img.loaded {
  opacity: 1;
}

/* Lazy loading enhancement */
img[loading="lazy"] {
  background: #f8f9fa;
  border-radius: var(--border-radius);
}

/* ==================== LAYOUT COMPONENTS ==================== */

/* Header Hero Section */
.header-hero {
  background: linear-gradient(135deg, rgba(245, 247, 250, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
  padding: 4rem 0;
  position: relative;
}

/* Hero Grid Layout */
@media (min-width: 992px) {
  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 3rem;
    align-items: center;
  }
}

/* Footer */
.footer {
  background: var(--deep-blue);
  color: #fff;
  margin-top: 4rem;
  padding: 2rem 0;
}

.footer a {
  transition: var(--transition);
  text-decoration: none;
}

.footer a:hover {
  color: var(--fresh-green) !important;
  transform: translateY(-1px);
}

/* ==================== FORM STYLES ==================== */

.form-control, .form-select {
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius);
  padding: 0.875rem;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--deep-blue);
  box-shadow: 0 0 0 0.2rem rgba(26, 62, 114, 0.15);
  transform: translateY(-2px);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--deep-blue);
}

/* Validation States */
.is-valid {
  border-color: var(--fresh-green) !important;
}

.is-invalid {
  border-color: var(--red-accent) !important;
}

.invalid-feedback {
  color: var(--red-accent);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ==================== CAROUSEL ENHANCEMENTS ==================== */

.carousel {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.carousel-item {
  transition: transform 0.6s ease-in-out;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  right: 5%;
  left: 5%;
  bottom: 2rem;
}

.carousel-indicators {
  bottom: 1rem;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 6px;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  transition: var(--transition);
}

.carousel-indicators button.active {
  background-color: #fff;
  transform: scale(1.2);
}

/* ==================== ACCORDION STYLES ==================== */

.accordion-button {
  border-radius: var(--border-radius) !important;
  font-weight: 600;
  padding: 1rem 1.25rem;
  transition: var(--transition);
}

.accordion-button:not(.collapsed) {
  background-color: var(--deep-blue);
  color: white;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(26, 62, 114, 0.15);
  border-color: var(--deep-blue);
}

.accordion-body {
  background: #f8f9fa;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  padding: 1.25rem;
}

/* ==================== ANIMATIONS & EFFECTS ==================== */

/* Loading Animation */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--light-gray) 0%, #fff 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(26, 62, 114, 0.1);
  border-radius: 50%;
  border-top-color: var(--deep-blue);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse Animation */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-pulse {
  animation: pulse 2s infinite;
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== UTILITY CLASSES ==================== */

.text-shadow { text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.box-shadow { box-shadow: var(--shadow-medium); }
.rounded-lg { border-radius: var(--border-radius-lg); }

.price-display {
  line-height: 1;
  margin: 1rem 0;
}

.price-display .h2 {
  font-size: 3rem;
  font-weight: 800;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
  body {
    padding-top: 66px;
    font-size: 14px;
  }
  
  .header-hero {
    padding: 2rem 0;
  }
  
  .hero-img {
    height: 300px; /* Adjusted for mobile */
  }
  
  .trainer-img {
    height: 200px; /* Adjusted for mobile */
  }
  
  .carousel-item img {
    height: 300px; /* Adjusted for mobile */
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .feature-icon.small {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .display-5 { font-size: 1.75rem; }
  
  .carousel-caption {
    padding: 1rem;
    font-size: 0.9rem;
    bottom: 1rem;
  }
  
  .carousel-caption h3 {
    font-size: 1.2rem;
  }
  
  /* Fix popular card badge on mobile */
  .card-ghost.border-success::before {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card-ghost {
    margin: 0.25rem;
  }
  
  .navbar-brand {
    font-size: 1.3rem;
  }
  
  .header-hero {
    padding: 1.5rem 0;
  }
  
  .feature-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .hero-img {
    height: 250px;
  }
  
  /* Stack cards on extra small screens */
  .row-cols-1 .col {
    margin-bottom: 1rem;
  }
}

/* Print Styles */
@media print {
  .navbar, .footer, .btn, .carousel-controls, 
  .carousel-indicators, .loader, .card-ghost.border-success::before {
    display: none !important;
  }
  
  body {
    padding-top: 0;
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .card-ghost {
    box-shadow: none;
    border: 1px solid #ddd !important;
    background: white !important;
    color: black !important;
    break-inside: avoid;
  }
  
  .header-hero {
    background: white !important;
    padding: 1rem 0 !important;
  }
  
  .text-primary {
    color: black !important;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  .container {
    max-width: none !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
  
  .btn-pulse {
    animation: none;
  }
  
  .spinner {
    animation: none;
    border-top-color: transparent;
  }
  
  .card-ghost:hover {
    transform: none;
  }
  
  .feature-icon,
  .trainer-img,
  .hero-img {
    transition: none;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  :root {
    --deep-blue: #000080;
    --fresh-green: #008000;
  }
  
  .card-ghost {
    border: 2px solid #000;
  }
  
  .navbar.scrolled {
    background-color: var(--deep-blue) !important;
  }
}

/* Focus styles for accessibility */
.keyboard-navigation .btn:focus,
.keyboard-navigation .form-control:focus,
.keyboard-navigation .form-select:focus,
.keyboard-navigation .nav-link:focus {
  outline: 3px solid var(--deep-blue);
  outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--deep-blue);
  color: white;
  padding: 8px;
  z-index: 10000;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 6px;
}