/* Services & Programs Section */
.services-programs-section {
  position: relative;
  padding: 6rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #ffffff 100%);
  overflow: hidden;
  min-height: 100vh;
}

/* Animated Background Shapes */
.bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(
    45deg,
    rgba(0, 123, 191, 0.1),
    rgba(255, 215, 0, 0.1)
  );
  animation: floatShape 8s ease-in-out infinite;
}

.shape.circle-1 {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.shape.circle-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.shape.circle-3 {
  width: 100px;
  height: 100px;
  top: 80%;
  left: 20%;
  animation-delay: 4s;
}

@keyframes floatShape {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
    opacity: 0.6;
  }
}

/* Swimming Icons Floating */
.swimming-icons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.swim-icon {
  position: absolute;
  font-size: 2rem;
  color: rgba(0, 123, 191, 0.2);
  animation: swimFloat 6s ease-in-out infinite;
}

.swim-icon:nth-child(1) {
  top: 15%;
  left: 80%;
  animation-delay: 0s;
}

.swim-icon:nth-child(2) {
  top: 40%;
  left: 10%;
  animation-delay: 2s;
}

.swim-icon:nth-child(3) {
  top: 70%;
  right: 15%;
  animation-delay: 4s;
}

@keyframes swimFloat {
  0%,
  100% {
    transform: translateY(0px) translateX(0px);
    opacity: 0.2;
  }
  25% {
    transform: translateY(-15px) translateX(10px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-25px) translateX(-5px);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-10px) translateX(15px);
    opacity: 0.4;
  }
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInUp 1s ease-out;
}

.section-title-Services2 {
  font-size: 3rem;
  font-weight: bold;
  color: #003366;
  margin-bottom: 1rem;
  position: relative;
}

.section-title-Services2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(45deg, #007bbf, #ffd700);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tab Navigation Wrapper */
.tab-navigation-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  animation: slideInFromLeft 1s ease-out 0.3s both;
}

/* Scroll Buttons - Hidden by default on desktop */
.tab-scroll-btn {
  display: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, #007bbf, #4a90e2);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 123, 191, 0.3);
}

.tab-scroll-btn:hover {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

.tab-scroll-btn:active {
  transform: scale(0.95);
}

.tab-scroll-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Tab Navigation - Desktop */
.tab-navigation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  width: 100%;
}

.tab-btn {
  background: linear-gradient(45deg, #007bbf, #4a90e2);
  color: white;
  border: none;
  padding: 1.1rem 2.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-width: 180px;
  text-align: center;
}

.tab-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.tab-btn:hover::before {
  left: 100%;
}

.tab-btn.active {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #003366;
  transform: scale(1.05);
}

.tab-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 123, 191, 0.3);
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeInContent 0.5s ease-out;
}

.tab-content.active {
  display: block;
}

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

/* Programs Grid */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Program Card */
.program-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transform: translateY(0);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.program-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(45deg, #007bbf, #ffd700);
}

.program-card:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 25px 50px rgba(0, 123, 191, 0.2);
}

/* Program Icon */
.program-icon {
  width: 80px;
  height: 80px;
  padding: 1rem;
  background: linear-gradient(45deg, #007bbf, #4a90e2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  font-size: 1.8rem;
  color: white;
  transition: all 0.3s ease;
  animation: iconPulse 2s ease-in-out infinite;
}

.program-icon img {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
  object-fit: contain;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.program-card:hover .program-icon {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #003366;
  transform: rotate(360deg) scale(1.2);
  animation-play-state: paused;
}

/* Program Content */
.program-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: #003366;
  margin-bottom: 1rem;
}

.program-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.program-features {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-bottom: 1.5rem;
}

.program-features li {
  color: #555;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.program-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #007bbf;
  font-weight: bold;
}

/* Program Card Button */
.program-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(45deg, #007bbf, #4a90e2);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: auto;
  box-shadow: 0 4px 12px rgba(0, 123, 191, 0.2);
}

.program-card-btn:hover {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #003366;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.3);
}

/* Highlight card button override */
.highlight-card .program-card-btn {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #003366;
}

.highlight-card .program-card-btn:hover {
  background: white;
  color: #007bbf;
}

/* Special Highlight Card */
.highlight-card {
  background: linear-gradient(135deg, #007bbf, #4a90e2);
  color: white;
}

.highlight-card .program-title {
  color: #ffd700;
}

.highlight-card .program-description {
  color: rgba(255, 255, 255, 0.95);
}

.highlight-card .program-features li {
  color: rgba(255, 255, 255, 0.9);
}

.highlight-card .program-features li::before {
  color: #ffd700;
}

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

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Interactive Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.6);
  transform: scale(0);
  animation: rippleEffect 0.6s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Focus States for Accessibility */
.tab-btn:focus,
.program-card:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
  .services-programs-section {
    padding: 4rem 0;
  }

  .section-title-Services2 {
    font-size: 2.5rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
    padding: 0 1rem;
  }

  .tab-navigation {
    gap: 0.85rem;
    justify-content: flex-start;
  }

  .tab-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-width: 160px;
  }

  .programs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .program-card {
    padding: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Show scroll buttons on tablet */
  .tab-scroll-btn {
    display: flex;
  }

  .tab-navigation {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 123, 191, 0.4) transparent;
    max-width: calc(100% - 100px);
  }

  .tab-navigation::-webkit-scrollbar {
    height: 5px;
    display: block;
  }

  .tab-navigation::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
  }

  .tab-navigation::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #007bbf, #4a90e2);
    border-radius: 10px;
  }

  .tab-navigation::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #ffd700, #ffa500);
  }
}

/* Mobile Optimization - BEAUTIFUL SCROLLABLE TABS */
@media (max-width: 480px) {
  .services-programs-section {
    padding: 3rem 0;
  }

  .container {
    padding: 0 1rem;
    max-width: 100%;
  }

  .section-header {
    margin-bottom: 2.5rem;
    padding: 0 1rem;
  }

  .section-title-Services2 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .section-subtitle {
    font-size: 1rem;
    padding: 0;
    line-height: 1.5;
  }

  /* Tab Navigation Wrapper for Mobile */
  .tab-navigation-wrapper {
    padding: 0 0.5rem;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  /* Show scroll buttons on mobile */
  .tab-scroll-btn {
    display: flex;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
  }

  /* Horizontal Scrollable Tabs - Mobile */
  .tab-navigation {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: scroll;
    overflow-y: hidden;
    gap: 0.5rem;
    padding: 0.5rem 0 1rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 123, 191, 0.6) rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
  }

  /* Beautiful Custom Scrollbar */
  .tab-navigation::-webkit-scrollbar {
    height: 6px;
  }

  .tab-navigation::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
  }

  .tab-navigation::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #007bbf, #4a90e2);
    border-radius: 10px;
  }

  .tab-navigation::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #ffd700, #ffa500);
  }

  .tab-btn {
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
    flex: 0 0 auto;
    min-width: auto;
    width: auto;
    box-shadow: 0 2px 8px rgba(0, 123, 191, 0.2);
  }

  .tab-btn.active {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  }

  .tab-btn:hover {
    transform: none;
  }

  /* Single column layout for cards */
  .programs-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .program-card {
    padding: 1.5rem;
  }

  .program-card:hover {
    transform: translateY(0) scale(1);
  }

  .program-icon {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
  }

  .program-icon img {
    width: 35px;
    height: 35px;
  }

  .program-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .program-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .program-features li {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    line-height: 1.4;
  }

  .program-card-btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem;
  }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
  .section-title-Services2 {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
  }

  .tab-scroll-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .tab-navigation {
    gap: 0.4rem;
  }

  .tab-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
  }

  .program-card {
    padding: 1.2rem;
  }

  .program-icon {
    width: 60px;
    height: 60px;
  }

  .program-icon img {
    width: 30px;
    height: 30px;
  }

  .program-title {
    font-size: 1.1rem;
  }
}

/* Tablet Landscape */
@media (min-width: 481px) and (max-width: 768px) {
  .programs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .shape,
  .swim-icon,
  .program-icon {
    animation: none;
  }

  .program-card {
    transition: none;
  }

  .tab-btn::before {
    transition: none;
  }
}

/* Print styles */
@media print {
  .bg-shapes,
  .swimming-icons,
  .tab-scroll-btn {
    display: none;
  }

  .services-programs-section {
    background: white;
  }

  .program-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
