/* 
=========================================
PAL Physiotherapy - Custom CSS Styles
=========================================
*/

:root {
  --primary-color: #13bfb3;
  --primary-dark: #0fada2;
  --secondary-color: #007bff;
  --dark-color: #333333;
  --light-color: #f8f9fa;
  --white-color: #ffffff;
  --gray-color: #6c757d;
  --transition-speed: 0.3s;
}

/*-------------------------------
  General Styles
  --------------------------------*/
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: #333;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary-color);
  transition: color var(--transition-speed) ease;
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

.btn {
  border-radius: 4px;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.bg-darker {
  background-color: #222;
}

.container {
  max-width: 1200px;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  position: relative;
  font-weight: 700;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray-color);
  max-width: 700px;
  margin: 0 auto;
}

/*-------------------------------
  Preloader
  --------------------------------*/
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.97);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: wait;
}

.preloader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.preloader-gif {
  width: 100px; /* Adjust based on your GIF size */
  height: auto;
  /* Ensure proper dimensions are set in the HTML as well for CLS prevention */
}

.preloader-text {
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 500;
  margin-top: 10px;
  animation: pulse 1.5s infinite;
}

.preloader::after {
  content: 'Tap to continue if loading takes too long';
  position: absolute;
  bottom: 20%;
  font-size: 12px;
  color: #666;
  opacity: 0;
  transition: opacity 2s ease;
}

.preloader.extended-wait::after {
  opacity: 1;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

/*-------------------------------
  Navigation
  --------------------------------*/
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
}

.navbar-brand img {
  transition: all var(--transition-speed) ease;
}

.navbar-light .navbar-nav .nav-link {
  color: var(--dark-color);
  font-weight: 600;
  padding: 1rem 1rem;
  transition: color var(--transition-speed) ease;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus,
.navbar-light .navbar-nav .active .nav-link {
  color: var(--primary-color);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

/*-------------------------------
  Hero Section
  --------------------------------*/
.hero {
  background-color: #f9f9fa;
  min-height: 500px;
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 80px; /* Adjust for fixed navbar */
}

.hero-content {
  height: 100%;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark-color);
}

.booking-form {
  height: 100%;
}

/*-------------------------------
  Services Section
  --------------------------------*/
.service-card {
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.service-icon {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
}

/*-------------------------------
  About Section
  --------------------------------*/
.about {
  background-color: var(--primary-color);
}

.about-image {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.video-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--white-color);
  color: var(--primary-color);
  font-size: 1.5rem;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.video-play-btn:hover {
  transform: scale(1.1);
  background-color: var(--primary-color);
  color: var(--white-color);
}

/*-------------------------------
  Treatments Section
  --------------------------------*/
.treatment-card {
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  overflow: hidden;
}

.treatment-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.treatment-img {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.treatment-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.treatment-card:hover .treatment-img img {
  transform: scale(1.05);
}

/*-------------------------------
  CTA Section
  --------------------------------*/
.cta {
  background-color: var(--primary-color);
}

.second-cta {
  width: 100%;
  position: relative;
  z-index: 10;
}

.cta-inner {
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.cta-inner:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/*-------------------------------
  Team Section
  --------------------------------*/
.team-member-tab {
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.team-member-tab:hover,
.team-member-tab.active {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.team-content {
  height: 100%;
}

/*-------------------------------
Testimonials Carousel
--------------------------------*/
.testimonial-carousel {
  position: relative;
  padding-bottom: 50px; /* Space for indicators */
}

.testimonial-card {
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  min-height: 350px; /* Fixed height to prevent CLS */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonial-content {
  flex-grow: 1;
}

.testimonial-content p {
  font-style: italic;
  color: #555;
  line-height: 1.8;
  position: relative;
  padding: 0 20px;
}

.testimonial-content p::before,
.testimonial-content p::after {
  content: '"';
  font-family: Georgia, serif;
  font-size: 60px;
  color: rgba(19, 191, 179, 0.2);
  position: absolute;
}

.testimonial-content p::before {
  left: -10px;
  top: -20px;
}

.testimonial-content p::after {
  right: -10px;
  bottom: -50px;
}

.carousel-indicators {
  bottom: 0;
}

.carousel-indicators li {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #d1d1d1;
  opacity: 0.5;
  transition: all 0.3s ease;
  margin: 0 5px;
}

.carousel-indicators li.active {
  background-color: var(--primary-color);
  opacity: 1;
  width: 14px;
  height: 14px;
}

.testimonial-control {
  background-color: var(--primary-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.carousel-control-prev,
.carousel-control-next {
  width: 5%;
  opacity: 0.8;
  background: none;
  border: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--primary-color);
  text-align: center;
  outline: none !important;
}

.carousel-control-prev {
  left: -50px;
}

.carousel-control-next {
  right: -50px;
}

.carousel-control-prev:focus,
.carousel-control-next:focus,
.carousel-control-prev:active,
.carousel-control-next:active {
  outline: none !important;
  box-shadow: none !important;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  color: var(--primary-dark);
  opacity: 1;
}

/* Additional JS fix - Add this to ensure smooth carousel operation */
.carousel-item-next,
.carousel-item-prev,
.carousel-item.active {
  display: block;
}

/* Animation for carousel items */
.carousel-item {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  height: 320px !important;
}

.carousel-item.active {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .carousel-control-prev,
  .carousel-control-next {
    display: none; /* Hide controls on smaller screens */
  }

  .testimonial-card {
    min-height: 400px; /* Adjust height for smaller screens */
  }

  .testimonial-content p {
    font-size: 1rem;
  }
}

@media (max-width: 767.98px) {
  .testimonial-card {
    min-height: 450px;
  }
}

@media (max-width: 575.98px) {
  .testimonial-card {
    min-height: 500px;
  }

  .carousel-item {
    height: 430px !important;
  }

  .testimonial-content p::before,
  .testimonial-content p::after {
    font-size: 40px;
  }

  .testimonial-content p::before {
    top: -10px;
  }

  .testimonial-content p::after {
    bottom: -30px;
  }
}

/*-------------------------------
  FAQ Section
  --------------------------------*/
.faqs .card {
  transition: all var(--transition-speed) ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.faqs .card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.faqs .card-header {
  background-color: var(--white-color);
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.faqs .btn-link {
  color: var(--dark-color);
  font-weight: 600;
  text-decoration: none;
  width: 100%;
  text-align: left;
  padding: 0;
}

.faqs .btn-link:hover,
.faqs .btn-link:focus {
  color: var(--primary-color);
  text-decoration: none;
}

.faqs .btn-link .fa {
  transition: transform var(--transition-speed) ease;
}

.faqs .btn-link[aria-expanded='true'] .fa {
  transform: rotate(180deg);
}

/*-------------------------------
  Footer
  --------------------------------*/
.footer {
  background-color: #343a40;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-speed) ease;
}

.footer a:hover {
  color: var(--white-color);
  text-decoration: none;
}

.footer-contact li {
  margin-bottom: 1rem;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white-color);
  margin-right: 10px;
  transition: all var(--transition-speed) ease;
}

.social-links a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

.opening-hours li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.copyright {
  background-color: rgba(0, 0, 0, 0.2);
}

/*-------------------------------
  Back to Top Button
  --------------------------------*/
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: none;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  background-color: var(--primary-color);
  color: var(--white-color);
  border-radius: 50%;
  z-index: 99;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  color: var(--white-color);
  transform: translateY(-5px);
}

/*-------------------------------
  Animations
  --------------------------------*/
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn var(--transition-speed) ease-in;
}

.slide-up {
  animation: slideUp var(--transition-speed) ease-out;
}

/*-------------------------------
  CSS Fixes for CLS Issues
  --------------------------------*/
/* Fix for image-related CLS */
img {
  aspect-ratio: attr(width) / attr(height);
}

img:not([width]):not([height]) {
  aspect-ratio: 16/9;
}

/* Ensure content doesn't shift on loading */
.hero,
.services,
.about,
.treatments,
.team,
.testimonials,
.faqs,
.second-cta,
.footer {
  min-height: 100px;
  height: auto;
}

/* Fix for form button CLS */
.booking-form button[type='submit'] {
  height: 48px; /* Fixed height to prevent CLS */
}

/* Pre-defined spaces for content areas */
.hero-content,
.booking-form,
.service-card,
.about-content,
.treatment-card,
.team-content,
.testimonial-card,
.map-container,
.cta-inner {
  min-height: 100px;
  height: auto;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding: 1rem 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 767.98px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .about-image {
    margin-bottom: 2rem;
  }
}

@media (max-width: 575.98px) {
  .hero {
    padding-top: 60px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .service-icon {
    width: 60px;
    height: 60px;
  }

  .video-play-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}

/* Smooth transition for navbar collapse */
.navbar-collapse {
  transition: height 0.3s ease-in-out;
}

/* Improved mobile menu appearance */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding: 1rem 0;
  }

  .navbar-nav .nav-item {
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }

  .navbar-nav .nav-link {
    padding: 1rem 1.5rem;
    position: relative;
    transition: all 0.3s ease;
  }

  .navbar-nav .nav-link:active,
  .navbar-nav .nav-link:focus {
    background-color: rgba(19, 191, 179, 0.05);
  }

  .navbar-toggler {
    border: none;
    padding: 0.6rem;
    transition: all 0.2s ease;
  }

  .navbar-toggler:focus {
    outline: none;
  }

  /* Active nav item styling */
  .navbar-nav .nav-item.active .nav-link {
    color: var(--primary-color);
    background-color: rgba(19, 191, 179, 0.05);
  }

  .navbar-nav .nav-item.active .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
  }
}

/* Overlay for mobile menu */
@media (max-width: 991.98px) {
  .navbar-collapse.show,
  .navbar-collapse.collapsing {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  }
}

/* Smooth scrolling improvements */
html {
  scroll-padding-top: 80px; /* Account for fixed header height */
}

/* Add these styles to your style.css file or create a separate faq.css if preferred */

/*-------------------------------
FAQ Page Specific Styles
--------------------------------*/
.faq-hero {
  background-color: #f3f9fd;
  padding-top: 100px; /* Extra padding for the fixed header */
}

.faq-hero h1 {
  color: var(--dark-color);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* FAQ Tabs Styling */
#faqTabs {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

#faqTabs .nav-link {
  color: var(--dark-color);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0;
  position: relative;
  transition: all 0.3s ease;
}

#faqTabs .nav-link.active {
  color: var(--primary-color);
  background-color: transparent;
}

#faqTabs .nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

#faqTabs .nav-link.active::after {
  transform: scaleX(1);
}

/* Accordion Styling */
.accordion .card {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.accordion .card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.accordion .card-header {
  border-bottom: none;
  background-color: #fff;
  padding: 0;
}

.accordion .btn-link {
  color: var(--dark-color);
  font-weight: 600;
  padding: 1.25rem;
  text-decoration: none;
  width: 100%;
  text-align: left;
  transition: all 0.3s ease;
}

.accordion .btn-link:hover,
.accordion .btn-link:focus {
  color: var(--primary-color);
  text-decoration: none;
}

.accordion .card-body {
  padding: 0 1.25rem 1.25rem;
  color: #444;
}

.accordion .btn-link .fa {
  transition: transform 0.3s ease;
  color: var(--primary-color);
}

.accordion .btn-link[aria-expanded='true'] .fa {
  transform: rotate(180deg);
}

.accordion ul,
.accordion ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.accordion ul li,
.accordion ol li {
  margin-bottom: 0.5rem;
}

/* Services Summary Cards */
.services-summary .service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
}

.services-summary .service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.services-summary .service-card img {
  height: 200px;
  object-fit: cover;
  width: 100%;
}

/* Additional Questions Section */
.additional-questions {
  background-color: #f3f9fd;
}

/* Make sure icons in buttons are properly spaced */
.btn i {
  margin-right: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .faq-hero h1 {
    font-size: 2rem;
  }

  #faqTabs .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .faq-hero h1 {
    font-size: 1.8rem;
  }

  .faq-hero {
    padding-top: 80px;
  }

  #faqTabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  #faqTabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
  }

  .accordion .btn-link {
    padding: 1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 575.98px) {
  .faq-hero h1 {
    font-size: 1.6rem;
  }

  .accordion h3.h5 {
    font-size: 1rem;
  }

  .accordion .btn-link {
    padding: 0.75rem;
  }
}
