/* Landing Page Styles */
.landing-section {
  padding: 40px 0 80px; /* Reduced top padding, kept bottom padding */
  position: relative;
  overflow: hidden;
  min-height: 600px; /* Reduced height */
  display: flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    #0a1f44 0%,
    #2a5bd7 100%
  ); /* Solid gradient fallback */
}

/* Background Slideshow */
.landing-bg-slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.landing-bg-slideshow .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.1);
  transition:
    opacity 1.5s ease-in-out,
    transform 6s ease-in-out;
  will-change: opacity, transform;
}

.landing-bg-slideshow .slide.active {
  opacity: 0.8; /* Reduced opacity to make text more readable */
  transform: scale(1);
  z-index: 1;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(10, 31, 68, 0.85) 0%,
    rgba(42, 91, 215, 0.7) 50%,
    rgba(42, 91, 215, 0.3) 100%
  );
  z-index: 2;
}

/* Container overlay */
.landing-section .container {
  position: relative;
  z-index: 3;
  padding-top: 20px; /* Reduced top padding */
}

/* Compact Section Title */
.landing-section-title {
  text-align: center;
  margin-bottom: 40px; /* Reduced margin */
  padding: 0 20px;
}

.landing-section-title h2 {
  color: white;
  font-size: 36px; /* Smaller font */
  font-weight: 700;
  margin-bottom: 10px; /* Reduced margin */
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.landing-section-title p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px; /* Smaller font */
  font-weight: 400;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  margin: 0 auto;
}

/* Wrapper for cards */
.landing-wrapper {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.landing-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 380px; /* Reduced container height */
  gap: 15px;
  transition: gap 0.4s ease;
  list-style: none;
  padding: 0;
  margin: 0;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.landing-item {
  position: relative;
  overflow: hidden;
  flex: 0 0 180px; /* Reduced starting width */
  height: 300px; /* Reduced starting height */
  border-radius: 20px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    10px 15px 30px rgba(0, 0, 0, 0.3),
    -6px -8px 20px rgba(255, 255, 255, 0.03);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: #000;
  will-change: flex, transform, width, height;
  transform-style: preserve-3d;
  perspective: 1000px;
  touch-action: manipulation; /* Better touch handling */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.landing-item img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: brightness(0.8);
}

.landing-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  color: #fff;
  padding: 25px 20px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.7) 20%,
    rgba(0, 0, 0, 0.4) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  opacity: 1;
  visibility: visible;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateZ(15px);
  -webkit-user-select: none; /* Prevent text selection on mobile */
  user-select: none;
}

/* Non-hovered state - Show only title at bottom */
.landing-item:not(:hover) .landing-content {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.55) 40%,
    transparent 100%
  );
  justify-content: flex-end;
  padding-bottom: 25px;
}

.landing-content span {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateZ(20px);
}

.landing-content h2 {
  font-weight: 700;
  font-size: 22px; /* Smaller font */
  line-height: 1.2;
  margin: 0;
  color: #fff;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
  transition: all 0.4s ease;
  width: 100%;
  text-align: center;
}

/* For non-hovered cards, keep title at bottom */
.landing-item:not(:hover) .landing-content h2 {
  font-size: 20px; /* Even smaller for non-hovered */
  margin-bottom: 0;
  padding: 0 10px;
}

/* Hide description and button on non-hovered cards */
.landing-item:not(:hover) .landing-content p,
.landing-item:not(:hover) .demo-btn {
  opacity: 0;
  visibility: hidden;
  height: 0;
  width: 0;
  margin: 0;
  padding: 0;
  transform: translateY(15px);
  transition: all 0.3s ease;
}

/* Show description only on hover */
.landing-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px; /* Smaller font */
  line-height: 1.5;
  margin: 15px 0 20px;
  padding: 0 15px;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  height: 0;
  transform: translateY(10px);
  transition: all 0.4s ease 0.1s;
  font-weight: 300;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

/* Get Demo Button Styles */
.demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #2a5bd7 100%);
  color: white;
  padding: 10px 25px; /* Smaller padding */
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px; /* Smaller font */
  letter-spacing: 0.5px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 15px rgba(42, 91, 215, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.9);
  transition: all 0.4s ease 0.15s;
  min-width: 130px;
  touch-action: manipulation;
}

.demo-btn i {
  margin-right: 8px;
  font-size: 16px;
}

.demo-btn:hover {
  background: white;
  color: var(--primary);
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 8px 20px rgba(42, 91, 215, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

/* Hover Effects - Desktop only */
@media (hover: hover) and (pointer: fine) {
  .landing-container:hover .landing-item:not(:hover) {
    flex: 0 0 160px;
    filter: brightness(0.6);
    transform: scale(0.92) translateY(3px);
  }

  .landing-item:hover {
    flex: 0 1 380px; /* Reduced expanded width */
    height: 340px; /* Reduced expanded height */
    transform: translateY(-10px) scale(1.05);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
      0 25px 50px rgba(0, 0, 0, 0.4),
      0 0 0 2px rgba(255, 255, 255, 0.15),
      0 0 20px rgba(42, 91, 215, 0.3);
  }

  .landing-item:hover img {
    width: 125%;
    height: 125%;
    filter: brightness(1.05);
  }

  /* Show content on hover */
  .landing-item:hover .landing-content {
    justify-content: center;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.75) 25%,
      rgba(0, 0, 0, 0.45) 55%,
      transparent 100%
    );
    padding: 35px 25px;
  }

  .landing-item:hover .landing-content h2 {
    font-size: 28px; /* Larger on hover */
    margin-bottom: 15px;
  }

  .landing-item:hover .landing-content p {
    opacity: 1;
    visibility: visible;
    height: auto;
    transform: translateY(0);
    margin: 15px 0 22px;
  }

  .landing-item:hover .demo-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    height: auto;
    width: auto;
  }
}

/* Special styling for the Clinic item */
.landing-item:first-child {
  border-color: rgba(76, 175, 80, 0.4);
  box-shadow:
    10px 15px 30px rgba(76, 175, 80, 0.15),
    -6px -8px 20px rgba(76, 175, 80, 0.08);
}

.landing-item:first-child .demo-btn {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  box-shadow:
    0 4px 15px rgba(76, 175, 80, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.landing-item:first-child .demo-btn:hover {
  background: white;
  color: #4caf50;
  border-color: #4caf50;
  box-shadow:
    0 8px 20px rgba(76, 175, 80, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* MOBILE-FRIENDLY IMPROVEMENTS */

/* Tablet Landscape and smaller desktops */
@media (max-width: 1200px) {
  .landing-section {
    min-height: 500px;
    padding: 30px 0 60px;
  }

  .landing-wrapper {
    width: 98%;
    padding: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .landing-container {
    height: 320px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 15px;
    padding: 10px 15px;
    gap: 12px;
  }

  .landing-item {
    flex: 0 0 200px;
    height: 260px;
    scroll-snap-align: start;
  }

  .landing-section-title h2 {
    font-size: 28px;
  }

  .landing-section-title p {
    font-size: 15px;
  }
}

/* Tablet Portrait */
@media (max-width: 1024px) {
  .landing-section {
    min-height: 450px;
    padding: 25px 0 50px;
  }

  .landing-container {
    height: 300px;
    gap: 10px;
  }

  .landing-item {
    flex: 0 0 180px;
    height: 240px;
  }

  .landing-section-title h2 {
    font-size: 26px;
  }

  .landing-section-title p {
    font-size: 14px;
    max-width: 400px;
  }

  .demo-btn {
    padding: 9px 22px;
    font-size: 13px;
    min-width: 120px;
  }
}

/* Mobile Landscape and small tablets */
@media (max-width: 768px) {
  .landing-section {
    padding: 20px 0 40px;
    min-height: 400px;
  }

  .landing-wrapper {
    padding: 12px;
    margin: 0 10px;
    width: calc(100% - 20px);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: none; /* Disable blur on mobile for performance */
  }

  .landing-container {
    height: 280px;
    gap: 8px;
    padding: 8px 10px;
  }

  .landing-item {
    flex: 0 0 160px;
    height: 220px;
  }

  /* On mobile, always show full content for clicked/tapped item */
  .landing-item.mobile-active {
    flex: 0 0 190px;
    height: 250px;
    transform: translateY(-5px);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
      0 15px 30px rgba(0, 0, 0, 0.4),
      0 0 0 2px rgba(42, 91, 215, 0.3);
  }

  .landing-item.mobile-active .landing-content {
    justify-content: center;
    padding: 25px 15px;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.75) 25%,
      rgba(0, 0, 0, 0.45) 55%,
      transparent 100%
    );
  }

  .landing-item.mobile-active .landing-content h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .landing-item.mobile-active .landing-content p {
    opacity: 1;
    visibility: visible;
    height: auto;
    transform: translateY(0);
    margin: 10px 0 15px;
    font-size: 13px;
  }

  .landing-item.mobile-active .demo-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    height: auto;
    width: auto;
    padding: 8px 20px;
    font-size: 12px;
    min-width: 110px;
  }

  .landing-section-title {
    margin-bottom: 25px;
  }

  .landing-section-title h2 {
    font-size: 24px;
  }

  .landing-section-title p {
    font-size: 14px;
    max-width: 350px;
  }

  /* On mobile, show all content for clicked item */
  .landing-content p,
  .landing-item:not(.mobile-active) .demo-btn {
    display: none;
  }

  .landing-item.mobile-active .landing-content p,
  .landing-item.mobile-active .demo-btn {
    display: inline-block;
  }
}

/* Mobile Portrait */
@media (max-width: 576px) {
  .landing-section {
    min-height: 380px;
    padding: 15px 0 35px;
  }

  .landing-wrapper {
    padding: 10px;
    margin: 0 8px;
    width: calc(100% - 16px);
    border-radius: 15px;
  }

  .landing-container {
    height: 250px;
    gap: 6px;
    padding: 6px 8px;
  }

  .landing-item {
    flex: 0 0 140px;
    height: 190px;
    border-radius: 15px;
  }

  .landing-item.mobile-active {
    flex: 0 0 160px;
    height: 210px;
  }

  .landing-content {
    padding: 15px 10px;
  }

  .landing-content h2 {
    font-size: 16px;
  }

  .landing-item.mobile-active .landing-content h2 {
    font-size: 18px;
  }

  .landing-item.mobile-active .landing-content p {
    font-size: 12px;
    line-height: 1.4;
    margin: 8px 0 12px;
  }

  .landing-item.mobile-active .demo-btn {
    padding: 7px 18px;
    font-size: 11px;
    min-width: 100px;
  }

  .landing-section-title h2 {
    font-size: 22px;
  }

  .landing-section-title p {
    font-size: 13px;
    max-width: 300px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .landing-section {
    min-height: 350px;
    padding: 12px 0 30px;
  }

  .landing-container {
    height: 220px;
    gap: 5px;
    padding: 5px;
  }

  .landing-item {
    flex: 0 0 120px;
    height: 170px;
    border-radius: 12px;
  }

  .landing-item.mobile-active {
    flex: 0 0 140px;
    height: 190px;
  }

  .landing-content h2 {
    font-size: 14px;
  }

  .landing-item.mobile-active .landing-content h2 {
    font-size: 16px;
  }

  .landing-item.mobile-active .landing-content p {
    font-size: 11px;
    margin: 6px 0 10px;
  }

  .landing-item.mobile-active .demo-btn {
    padding: 6px 15px;
    font-size: 10px;
    min-width: 90px;
  }

  .landing-section-title h2 {
    font-size: 20px;
  }

  .landing-section-title p {
    font-size: 12px;
    max-width: 280px;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  .landing-section {
    min-height: 320px;
    padding: 10px 0 25px;
  }

  .landing-container {
    height: 200px;
  }

  .landing-item {
    flex: 0 0 110px;
    height: 150px;
  }

  .landing-item.mobile-active {
    flex: 0 0 130px;
    height: 170px;
  }

  .landing-content h2 {
    font-size: 13px;
  }

  .landing-item.mobile-active .landing-content h2 {
    font-size: 15px;
  }

  .landing-section-title h2 {
    font-size: 18px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .landing-item {
    cursor: default;
  }

  /* Disable hover effects on touch devices */
  .landing-container:hover .landing-item:not(:hover) {
    filter: none;
    transform: none;
  }

  .landing-item:hover {
    transform: none;
  }
}

/* Prevent horizontal scroll on body */
body {
  overflow-x: hidden;
}

/* Better scrollbar for mobile */
.landing-wrapper::-webkit-scrollbar {
  height: 4px;
}

.landing-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.landing-wrapper::-webkit-scrollbar-thumb {
  background: rgba(42, 91, 215, 0.5);
  border-radius: 2px;
}
