/* Services Page Styles */

/* Services Hero Section - Minimalist Layout */
.services-hero {
  position: relative;
  /* Mobile-first approach - use the most compatible height */
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100); /* JavaScript fallback */
  min-height: 100svh; /* Small viewport height - excludes mobile UI */
  width: 100%;
  background-color: var(--primary-black);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Navigation Placeholder */
.hero-nav-placeholder {
  height: 80px; /* Height of the navbar */
  width: 100%;
  flex-shrink: 0;
}

/* Background Image */
.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px);
  transform: scale(1.1);
  transform-origin: center center;
  animation: gentle-pan-bg 25s ease-in-out infinite;
  animation-play-state: var(--animation-play-state, running);
  will-change: transform;
  contain: layout style paint;
}

/* Gentle panning animation for background */
@keyframes gentle-pan-bg {
  0%,
  100% {
    transform: scale(1.1) translateX(0) translateY(0);
  }
  25% {
    transform: scale(1.1) translateX(10px) translateY(-5px);
  }
  50% {
    transform: scale(1.1) translateX(-10px) translateY(5px);
  }
  75% {
    transform: scale(1.1) translateX(5px) translateY(-2px);
  }
}

/* Text Content Block */
.hero-text-block {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 40px 120px; /* Extra bottom padding for scroll indicator */
  position: relative;
  z-index: 2;
}

.hero-text-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
  position: relative;
}

.hero-text-content::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--electric-blue),
    transparent
  );
  border-radius: 2px;
}

.hero-text-content::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-purple),
    transparent
  );
  border-radius: 1px;
}

.hero-headline {
  font-family: var(--font-primary);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--pure-white);
  margin: 0 0 30px 0;
  opacity: 0;
  transform: translateY(30px);
  animation: slide-up-reveal 1s ease-out 0.3s forwards;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  display: inline-block;
}

.hero-headline::before {
  content: "";
  position: absolute;
  top: -15px;
  left: -20px;
  width: 6px;
  height: 6px;
  background: var(--electric-blue);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--electric-blue);
  animation: pulse 2s ease-in-out infinite;
}

.hero-headline::after {
  content: "";
  position: absolute;
  bottom: -15px;
  right: -20px;
  width: 4px;
  height: 4px;
  background: var(--neon-purple);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-purple);
  animation: pulse 2s ease-in-out infinite 0.5s;
}

.hero-description {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--light-gray);
  margin: 0;
  max-width: 700px;
  margin: 0 auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 0 20px;
}

.hero-description::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 212, 255, 0.3),
    transparent
  );
  border-radius: 1px;
}

.hero-description::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(128, 0, 255, 0.3),
    transparent
  );
  border-radius: 1px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Slide-up reveal animation for headline */
@keyframes slide-up-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--pure-white);
  z-index: 3;
  animation: fade-in-out 2s ease-in-out infinite;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.scroll-arrow {
  font-size: 1.5rem;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

.scroll-text {
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 300;
  font-family: var(--font-secondary);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes fade-in-out {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Services Grid Section */
.services-grid-section {
  padding: 100px 0;
  background: var(--primary-black);
}

.service-category {
  margin-bottom: 100px;
}

.service-category:last-child {
  margin-bottom: 0;
}

.category-header {
  text-align: center;
  margin-bottom: 50px;
}

.category-title {
  font-family: var(--font-primary);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--pure-white);
}

.category-description {
  max-width: 700px;
  margin: 0 auto;
  color: var(--light-gray);
  font-size: 1.1rem;
  line-height: 1.7;
}

.services-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  align-items: stretch; /* Ensure all items stretch to same height */
}

/* Enhanced Service Item Styles */
.service-item {
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 450px; /* Minimum height for consistency */
}

.service-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
  border-color: var(--electric-blue);
}

/* New Image Card Style */
.service-item-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.service-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-item:hover .service-item-image img {
  transform: scale(1.1);
}

.service-item-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    0deg,
    rgba(15, 15, 20, 0.8) 0%,
    rgba(15, 15, 20, 0.3) 100%
  );
  z-index: 1;
}

.service-item-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--cyber-gradient);
  color: var(--pure-white);
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

.service-item-header {
  padding: 25px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
  z-index: 2;
}

.service-item-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pure-white);
  margin-bottom: 10px;
}

.service-item-description {
  color: var(--light-gray);
  font-size: 1rem;
  line-height: 1.6;
}

.service-item-body {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.service-features {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-features li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 15px;
  color: var(--light-gray);
}

.service-features li:before {
  content: "\f058"; /* Font Awesome checkmark */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: var(--electric-blue);
}

.service-item-footer {
  padding: 20px 25px;
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  text-align: center;
}

.service-pricing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.price-label {
  font-size: 0.9rem;
  color: var(--light-gray);
}

.price-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--electric-blue);
}

.service-cta {
  display: inline-block;
  padding: 12px 30px;
  background: var(--cyber-gradient);
  color: var(--pure-white);
  border: none;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.service-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

/* CTA Section */
.services-cta {
  padding: 100px 0;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 11, 0.9),
    rgba(26, 26, 30, 0.8)
  );
  position: relative;
  text-align: center;
}

.services-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://images.unsplash.com/photo-1518770660439-4636190af475?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.2;
  z-index: 1;
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.cta-title {
  font-family: var(--font-primary);
  font-size: 3rem;
  font-weight: 800;
  color: var(--pure-white);
  margin-bottom: 20px;
}

.cta-subtitle {
  font-size: 1.3rem;
  color: var(--light-gray);
  margin-bottom: 40px;
  line-height: 1.7;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Process Section */
.process-section {
  padding: 100px 0;
  background: var(--primary-black);
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.process-step {
  position: relative;
  text-align: center;
  padding: 40px 30px;
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 15px;
  transition: all 0.4s ease;
}

.process-step:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
  border-color: var(--electric-blue);
}

.step-number {
  width: 60px;
  height: 60px;
  background: var(--cyber-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pure-white);
  margin: 0 auto 25px;
}

.process-step h4 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pure-white);
  margin-bottom: 20px;
}

.process-step p {
  color: var(--light-gray);
  line-height: 1.7;
}

/* FAQ Section */
.faq-section {
  padding: 100px 0;
  background: linear-gradient(
    180deg,
    var(--primary-black) 0%,
    rgba(26, 26, 30, 0.95) 100%
  );
  position: relative;
  overflow: hidden;
}

.faq-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://iili.io/KcpKl0N.md.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.15;
  z-index: 1;
}

.faq-section .container {
  position: relative;
  z-index: 2;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.faq-item {
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  min-height: 120px; /* Minimum height for consistency */
  display: flex;
  flex-direction: column;
}

.faq-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 212, 255, 0.2);
  border-color: var(--electric-blue);
}

.faq-question {
  padding: 25px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--pure-white);
  background: rgba(0, 212, 255, 0.05);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1; /* Take up available space */
  min-height: 0; /* Allow flex shrinking */
}

.faq-question span {
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  -webkit-box-orient: vertical;
  line-clamp: 3; /* Standard property */
  overflow: hidden;
}

.faq-question i {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 25px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.faq-item.active .faq-answer {
  padding: 25px;
  max-height: 300px; /* Reduced from 500px for smoother transition */
}

.faq-answer p {
  color: var(--light-gray);
  line-height: 1.7;
  margin: 0;
}

/* Testimonials Section */
.testimonials-section {
  padding: 100px 0;
  background: var(--primary-black);
}

.testimonials-carousel {
  max-width: 900px;
  margin: 50px auto 0;
}

.testimonial-slide {
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 15px;
  padding: 40px;
  text-align: center;
}

.testimonial-quote {
  font-size: 1.2rem;
  color: var(--light-gray);
  line-height: 1.8;
  margin-bottom: 30px;
  font-style: italic;
  position: relative;
}

.testimonial-quote::before {
  content: "\201C"; /* Opening quotation mark */
  font-size: 5rem;
  color: rgba(0, 212, 255, 0.2);
  position: absolute;
  top: -40px;
  left: -20px;
  z-index: -1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--electric-blue);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pure-white);
  margin-bottom: 5px;
}

.author-info p {
  color: var(--electric-blue);
  font-size: 0.9rem;
}

/* Responsive styles */
@media (max-width: 992px) {
  .hero-text-block {
    padding: 0 20px 100px;
  }

  .hero-text-content::before {
    width: 100px;
    top: -35px;
  }

  .hero-text-content::after {
    width: 60px;
    bottom: -35px;
  }

  .hero-headline {
    font-size: 3.2rem;
    margin-bottom: 25px;
  }

  .hero-description {
    font-size: 1.1rem;
    padding: 0 15px;
  }

  .hero-description::before,
  .hero-description::after {
    height: 50%;
  }

  .services-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .faq-item {
    min-height: 120px; /* Minimum height for consistency */
  }
}

@media (max-width: 768px) {
  .services-hero {
    min-height: 100vh;
    min-height: 100dvh; /* Use dynamic viewport height */
    height: 100vh;
    height: 100dvh;
  }

  .hero-text-block {
    padding: 20px 15px 90px;
  }

  .hero-text-content::before {
    width: 80px;
    top: -30px;
  }

  .hero-text-content::after {
    width: 50px;
    bottom: -30px;
  }

  .hero-headline {
    font-size: 2.8rem;
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: 1rem;
    padding: 0 10px;
  }

  .hero-description::before,
  .hero-description::after {
    height: 40%;
  }

  .services-hero-content .page-title {
    font-size: 3rem;
  }

  .services-hero-content .page-subtitle {
    font-size: 1.3rem;
  }

  .category-title {
    font-size: 2rem;
  }

  .process-steps {
    grid-template-columns: 1fr;
  }

  .cta-title {
    font-size: 2.5rem;
  }

  .service-item-image {
    height: 180px;
  }
}

@media (max-width: 576px) {
  .services-hero {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .hero-text-block {
    padding: 15px 10px 60px; /* Reduced bottom padding for mobile */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero-headline {
    font-size: 2.4rem;
    margin-bottom: 18px;
  }

  .hero-description {
    font-size: 0.95rem;
    padding: 0;
  }

  .services-hero-content .page-title {
    font-size: 2.5rem;
  }

  .services-hero-content .hero-description p {
    font-size: 1rem;
  }

  .category-title {
    font-size: 1.8rem;
  }

  .service-item-title {
    font-size: 1.3rem;
  }

  .cta-title {
    font-size: 2rem;
  }

  .cta-subtitle {
    font-size: 1.1rem;
  }

  .service-item-image {
    height: 160px;
  }
}

/* Mobile viewport fixes - Real device testing */
@media screen and (max-width: 768px) {
  .services-hero {
    /* Use multiple fallbacks for mobile browsers */
    min-height: calc(100vh - 56px); /* Account for mobile browser chrome */
    min-height: calc(var(--vh, 1vh) * 100 - 56px); /* JS fallback */
    min-height: 100svh; /* Small viewport - excludes address bar */
  }

  .hero-nav-placeholder {
    height: 60px; /* Adjust for mobile navbar */
  }
}

/* Very small mobile devices */
@media screen and (max-width: 480px) {
  .services-hero {
    min-height: calc(100vh - 48px); /* More conservative for small screens */
    min-height: 100svh;
  }

  .hero-nav-placeholder {
    height: 56px;
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .services-hero {
    min-height: -webkit-fill-available;
  }
}

/* Service Item Title Styling */
.service-item-title {
  color: #00d4ff;
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
}

/* Service Features List */
.service-features {
  margin-bottom: auto; /* Pushes enquire button to bottom */
  padding-bottom: 20px;
}

/* Service Enquire Button */
.service-item-action {
  margin-top: auto; /* Always at bottom */
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-enquire {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 48px; /* Consistent button height */
}

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

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

.btn-enquire:hover {
  background: linear-gradient(135deg, #0099cc 0%, #00d4ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

.btn-enquire:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(255, 107, 61, 0.2);
}

.btn-enquire i {
  font-size: 0.9rem;
}

/* Mobile enquire button adjustments */
@media screen and (max-width: 768px) {
  .btn-enquire {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }
}
