/* Custom Variables */
:root {
  --primary-color: #002664;
  --secondary-color: #60a5fa;
  --accent-color: #fcd900;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --text-white: #ffffff;
  --bg-light: #f9fafb;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: #fff;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Remove initial opacity from sections */
section {
  opacity: 1;
  transform: none;
  padding: 6rem 0;  /* Increased padding for better spacing */
}

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

/* Typography */
h1, h2, h3, .logo {
  font-family: 'Montserrat', sans-serif;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
}

.section-title::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* Navigation */
.navbar {
  position: fixed;
  width: 100%;
  background: rgba(0, 38, 100, 0.95);
  
  
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  z-index: 50;
  
  padding: 0.5rem 0; /* Increased padding */
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  height: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--text-white);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  padding: 0 0.5rem;
  outline: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--primary-color);
}

.nav-link.active::after {
  width: 100%;
}

.nav-link:focus {
  outline: none;
}

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

.nav-link:focus-visible {
  outline: none;
}

.navbar.scrolled {
  background: rgba(0, 38, 100, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled .nav-link {
  color: var(--text-white);
}

.navbar.scrolled .nav-link:hover {
  color: var(--text-white);
  text-decoration: underline;
}

/* Mobile Menu */
.mobile-menu {
  position: absolute;
  top: 90px; /* Match navbar height */
  left: 0;
  right: 0;
  background: white;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu.hidden {
  display: none;
}

.mobile-menu:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  transition: all 0.3s ease;
  border-radius: 0.375rem;
}

.mobile-menu a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 0 1rem;
  padding-top: 90px; /* Match navbar height */
  min-height: calc(100vh - 90px);  /* Account for navbar height */
  margin-top: 0px;  /* Push content below navbar */
  padding: 0;  /* Remove default section padding */
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  animation: waveFloat 3s ease-in-out infinite alternate;
}

@keyframes waveFloat {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-10px);
  }
}

.hero-content {
  max-width: 800px;
  z-index: 1;
  position: relative;
  z-index: 2;
}

/* Hero Section Enhancements */
.hero-section {
  position: relative;
  min-height: 100vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), var(--hero-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  position: relative;
  opacity: 1;
  transform: none;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease forwards;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease 0.3s forwards;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease 0.6s forwards;
}

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

/* Enhanced Hero Content Animation */
.hero-content > * {
  opacity: 0;
  transform: translateY(30px);
}

.hero-content h1 {
  animation: fadeUpIn 0.8s ease forwards 0.5s;
}

.hero-content p {
  animation: fadeUpIn 0.8s ease forwards 0.7s;
}

.hero-content .hero-buttons {
  animation: fadeUpIn 0.8s ease forwards 0.9s;
}

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

.hero-btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.hero-btn-primary {
  background: var(--primary-color);
  color: white;
  border: 2px solid var(--primary-color);
}

.hero-btn-primary:hover {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
}

.hero-btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.hero-btn-secondary:hover {
  background: white;
  color: var(--primary-color);
  transform: translateY(-2px);
}

.hero-btn-primary::after,
.hero-btn-secondary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%) scale(0);
  border-radius: inherit;
  transition: transform 0.3s ease;
}

.hero-btn-primary:hover::after,
.hero-btn-secondary:hover::after {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0;
}

@media (max-width: 640px) {
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-btn {
    width: 100%;
  }
}

/* Service Cards */
.service-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  transform: translateY(0);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  color: white;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card:hover p {
  color: rgba(255, 255, 255, 0.9);
}

.service-card:hover .service-icon {
  background: white;
}

.service-card:hover .service-icon svg {
  color: var(--primary-color);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  animation: pulse 1s infinite;
}

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

.service-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

/* Stats Section */
.stats-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
  padding: 5rem 0;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.stat-item {
  position: relative;
  padding: 2rem;
  text-align: center;
  z-index: 1;
  opacity: 1;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.stat-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Testimonials */
.testimonial-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 1rem;
  height: 100%;
}

.testimonial-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
}

/* Testimonials Section */
.testimonial-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 1rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.testimonial-quote {
  font-size: 4rem;
  line-height: 1;
  color: var(--primary-color);
  opacity: 0.2;
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-family: serif;
}

.testimonials-slider {
  padding: 2rem 0;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.swiper-wrapper {
  display: flex;
  height: auto;
}

.swiper-slide {
  height: auto;
  display: flex;
}

.swiper-pagination {
  position: relative;
  margin-top: 2rem;
}

.swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  opacity: 0.3;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  width: 24px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .testimonial-card {
    padding: 2rem;
  }
}

/* Button Styles */
.btn-primary {
  background: var(--primary-color);
  color: white;
  padding: 0.6rem 2rem 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  position: relative;
  overflow: hidden;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background: var(--accent-color);
  color: var(--text-dark);
}

.btn-primary::after,
.btn-secondary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%) scale(0);
  border-radius: inherit;
  transition: transform 0.3s ease;
}

.btn-primary:hover::after,
.btn-secondary:hover::after {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

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

.animate-fade-in {
  animation: fadeIn 1s ease forwards;
}

/* Back to top button */
.back-to-top {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.flex {
  opacity: 1;
  transform: translateY(0);
}

/* Loading Animation */
.loading-animation {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  background: white;
  z-index: 9999;
  transition: all 0.5s ease;
}

.loading-animation.loaded {
  opacity: 0;
  visibility: hidden;
}

/* Loading Indicator */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.loading .loading-indicator {
  transform: scaleX(1);
}

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .stat-label {
    font-size: 1rem;
  }
  
  .navbar {
    padding: 1rem;
    height: 80px;
  }

  .nav-container {
    height: 70px;
  }

  .mobile-menu {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    padding: 1rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
  }

  .mobile-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
  }

  .mobile-menu .nav-link {
    height: auto;
    padding: 1rem;
    width: 100%;
  }
  
  .mobile-menu .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
  }

  .mobile-menu {
    max-height: 0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
  }

  .mobile-menu.active {
    max-height: 400px;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

/* Additional Animation Classes */
.animate-count-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-count-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth Section Transitions */
section {
  transition: opacity 0.5s ease;
}

section:target {
  animation: highlightSection 1s ease;
}

@keyframes highlightSection {
  0% {
    background-color: rgba(37, 99, 235, 0.1);
  }
  100% {
    background-color: transparent;
  }
}

/* Enhance Section Transitions */
section {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Contact Section Enhancements */
.contact-section {
  position: relative;
  overflow: hidden;
}

.contact-info-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  height: 100%;
  transition: transform 0.3s ease;
  transform-origin: center;
  height: 100%;
  padding: 3rem;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.contact-info-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.contact-info-item:hover .contact-info-icon {
  transform: scale(1.1) rotate(5deg);
  background-color: var(--secondary-color);
}

.map-container {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  height: 450px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.map-container:hover iframe {
  transform: scale(1.02);
}

.contact-info-card:hover {
  transform: translateY(-5px);
}

@media (max-width: 768px) {
  .contact-info-card {
    margin-bottom: 2rem;
  }
  
  .map-container {
    height: 350px;
  }
}

/* Enhance Focus States */
.btn-primary:focus,
.btn-secondary:focus,
.nav-link:focus {
  outline: none;
}

/* Add subtle background pattern */
.section-pattern {
  position: relative;
  overflow: hidden;
}

.section-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--primary-color) 1px, transparent 0);
  background-size: 40px 40px;
  opacity: 0.03;
  pointer-events: none;
}

/* Enhanced Card Interactions */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Smooth Image Loading */
.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* Fix footer alignment */
footer {
  background: var(--text-dark);
  color: white;
  padding: 4rem 0 2rem;
  padding: 6rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  margin-top: 3rem;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-grid > div {
  padding: 0 1rem;
}

/* Container and spacing adjustments */
.container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

/* Responsive footer adjustments */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-grid img {
    margin: 0 auto;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Enhanced container responsiveness */
@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }
}

/* Service cards container spacing */
#services .grid {
  margin-top: 3rem;
}

/* Patient Portal Section Image Styling */
#patient-portal img[alt="Patient Portal Promotion"] {
  max-height: 500px;
  width: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: cover;
  background: #f3f6fa;
  box-shadow: 0 4px 24px rgba(0,38,100,0.08);
}

@media (max-width: 768px) {
  #patient-portal .grid {
    display: block;
  }
  #patient-portal img[alt="Patient Portal Promotion"] {
    max-width: 90vw;
    height: auto;
    margin-bottom: 2rem;
  }
}
