/* static/css/website/home.css */

/* ============================================= */
/* ==     HERO SECTION                        == */
/* ============================================= */
.hero {
  background: var(--header-bg);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
  transition: background var(--transition-speed) ease;
  min-height: 90vh;
  display: flex;
  align-items: center;
}
html[data-theme="dark"] .hero {
  background: var(--dark-section-bg);
}
.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(44, 90, 160, 0.1),
    rgba(98, 191, 230, 0.1)
  );
  border-radius: 50%;
  transform: rotate(-15deg);
}
.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero-text {
  text-align: left;
}
.hero-text h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 600;
}
.hero-text .highlight {
  background: var(--highlight-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-text p {
  color: var(--text-muted);
  margin: 15px 0;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}
.hero-buttons {
  margin: 15px 0;
}
.hero-stats {
  display: flex;
  justify-content: flex-start;
  margin-top: 30px;
  gap: 1.25rem;
}
.hero-stats .stat {
  text-align: center;
}
.stat-number {
  display: block;
  font-size: 24px;
  color: var(--primary-color);
  font-weight: 700;
}
.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.hero-image {
  position: center;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
    flex-direction: column; 
}
.hero-image img {
  max-width: 65%;
  height: auto;
  border-radius: 20px;
  display: block;
  margin: 0 auto;
}
/* Replace generic h2 rule with scoped typing animation for hero caption */
.hero-image .typing {
  display: inline-block;
  width: 30ch;                /* final visible width */
  white-space: nowrap;        /* prevent wrapping */
  overflow: hidden;           /* hide the hidden characters */
  margin: 1rem 0 0;           /* position under the image */
  font-size: 1.75rem;
  color: var(--primary-color);
  animation: typing 5s steps(30) infinite alternate-reverse;
}

@keyframes typing {
  from {
    width: 0ch;
  }
  to {
    width: 30ch;
  }
}

/* ============================================= */
/* ==     SHARED SECTION STYLES               == */
/* ============================================= */
.services,
.about,
.testimonials {
  padding: 80px 0;
  width: 100%;
  position: relative;
  overflow-x: clip;
  transition: background var(--transition-speed) ease;
}
.section-header {
  text-align: center;
  margin: 0 auto 4rem auto;
}
.section-header h2 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 1rem;
}
.section-header .highlight-text {
  color: var(--secondary-color);
}

/* ============================================= */
/* ==     SERVICES SECTION                    == */
/* ============================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.services-grid::before {
  content: "";
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 1200px;
  height: 4px;
  background-color: var(--line-color);
  z-index: 0;
}
.service-section h2 {
  font-weight: 300;
  font-family: "Poppins", sans-serif;
}
.service-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  border-top: 4px solid;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.service-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.service-header .service-img-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.service-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
}
.service-card p {
  flex-grow: 1;
  color: var(--text-muted);
}
.service-link {
  color: var(--primary-color);
  font-weight: 600;
  margin-top: auto;
  text-decoration: none;
}
.service-link:hover {
  text-decoration: underline;
}

.service-card:nth-child(1) {
  border-color: var(--step-1-color);
}
.service-card:nth-child(2) {
  border-color: var(--step-2-color);
}
.service-card:nth-child(3) {
  border-color: var(--step-3-color);
}
.service-card:nth-child(4) {
  border-color: var(--step-4-color);
}

/* ============================================= */
/* ==     ABOUT SECTION                       == */
/* ============================================= */
.about {
  padding: 80px 0;
  background: var(--dark-section-bg);
  color: var(--text-on-dark-bg);
  position: relative;
  overflow: hidden;
  transition: background var(--transition-speed) ease;
}
.about::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 70%;
  height: 150%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  transform: rotate(15deg);
}
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
}
.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-on-dark-bg);
}
.about-text .highlight-text {
  color: var(--secondary-color);
}
.about-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  color: inherit;
}
.about-features {
  margin: 2rem 0;
}
.feature {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.feature-icon {
  color: var(--text-on-dark-bg);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-weight: bold;
  font-size: 0.8rem;
}

/* ============================================= */
/* ==     TESTIMONIALS SECTION (MODERNIZED)   == */
/* ============================================= */
.new-testimonial-section {
  padding: 80px 0;
  background: transparent;
  transition: background var(--transition-speed) ease;
}

.new-testimonial-header {
  text-align: center;
  margin-bottom: 3rem;
}
.new-testimonial-header h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  font-weight: 300;
  font-family: "Poppins", sans-serif;
  text-align: center;
}
.new-testimonial-header span {
  font-weight: 600;
  color: var(--secondary-color);
}

.new-testimonial-slider-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
}

.new-testimonial-slider {
  display: flex;
  gap: 2.5rem;
}
.new-testimonial-slider-wrapper.is-animated .new-testimonial-slider {
  animation: scroll 60s linear infinite;
}
@keyframes scroll {
  to {
    transform: translate(calc(-50% - 1.25rem));
  }
}

.new-testimonial-card {
  background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.02),
      rgba(0, 0, 0, 0.02)
    ),
    var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.08);
  position: relative;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}
html[data-theme="dark"] .new-testimonial-card {
  background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.05),
      rgba(0, 0, 0, 0.05)
    ),
    var(--card-bg);
}
.new-testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.12);
}

.quote-icon {
  font-size: 3.5rem;
  color: var(--secondary-color);
  position: absolute;
  top: 15px;
  left: 20px;
  opacity: 0.15;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-grow: 1; /* This is key: it pushes the footer down */
}

/* [NEW] Footer to group author info and link */
.card-footer {
  margin-top: auto; /* Pushes this block to the bottom of the flex container */
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.author-details .quote-text {
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 0; /* Removed bottom margin to tighten layout */
}

.author-info {
  text-align: center; /* Ensure author info is centered in the footer */
}

.author-info .author-name {
  font-weight: 600;
  color: var(--primary-color);
  display: block;
}

.author-info .author-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: block;
  opacity: 0.8;
}

.star-rating {
  margin-bottom: 1.5rem;
  color: #f59e0b; /* Amber 500 */
}
.star-rating .bi-star {
  color: var(--border-color);
}

.card-link {
  display: block; /* Make the link a block to take up its own space */
  margin-top: 1rem; /* Space between author info and the link */
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}
.card-link:hover {
  text-decoration: underline;
  color: var(--primary-color-darker);
}
.card-link i {
  margin-left: 0.25rem;
  font-size: 0.8rem;
}

.no-testimonials-message {
  width: 100%;
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--card-bg);
  border-radius: 15px;
  color: var(--text-muted);
}

/* ============================================= */
/* ==     RESPONSIVE ADJUSTMENTS              == */
/* ============================================= */
@media (max-width: 991.98px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-image {
    display: none;
  }
  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-buttons,
  .hero-stats {
    justify-content: center;
  }
  .about-content {
    grid-template-columns: 1fr;
  }
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .services-grid::before {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
