/* ============================== */
/* SERVICES PAGE STYLES           */
/* ============================== */

/* Hero Section (matched to about page hero styles) */
.services-hero-section {
  position: relative;
  height: 50vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--text-light);
}

.services-hero-section .hero-background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

.services-hero-section .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  /* default (mobile / small screens): solid dark overlay for good contrast */
  background-color: rgba(0, 0, 0, 0.7);
}

/* Desktop: directional gradient like the about/homepage so LTR (English) shows the gradient as well */
@media (min-width: 992px) {
  .services-hero-section .hero-overlay {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.2) 100%);
  }
}

.services-hero-section .container {
  z-index: 3;
}

.hero-eyebrow {
  font-weight: 700;
  /* Slightly larger eyebrow to better match homepage scale */
  font-size: 1.6rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.9rem;
  animation: fadeInUp 0.4s ease-out forwards;
  animation-delay: 0.2s;
}

.hero-title {
  /* Slightly smaller than homepage .page-title for About page parity */
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.4px;
  margin-bottom: 1.6rem;
  color: var(--text-light);
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.3s;
}

.hero-subtitle {
  /* Slightly smaller subtitle to match About composition */
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.8rem;
  max-width: 600px;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.4s;
}

@media (min-width: 992px) {
  /* Desktop: make services hero slightly smaller like the About hero */
  .services-hero-section {
    height: 35vh;
    min-height: 400px;
    padding-top: 3rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 991.98px) {
  .services-hero-section {
    height: 60vh;
    min-height: 400px;
    /* remove extra space that was reserved for header */
    margin-top: 0;
  }

  .hero-title {
    /* Medium screens: slightly reduced size */
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 767.98px) {
  .services-hero-section {
    /* Match about hero height exactly */
    height: 50vh;
    min-height: 350px;
    padding-top: 80px;
    margin-top: 0;
  }

  .services-hero-section .container {
    /* center hero text on mobile */
    text-align: center;
  }

  .hero-eyebrow {
    /* Match about hero eyebrow size */
    font-size: 1.6rem;
  }

  .hero-title {
    /* Match about hero title size */
    font-size: 1.6rem;
  }

  .hero-subtitle {
    /* Match about hero subtitle size */
    font-size: 1rem;
  }
}

/* Services Section */
.services-section {
  background-color: white;
}

/* Category Headers */
.service-category {
  animation: fadeInUp 0.6s ease-out;
}

.category-header {
  text-align: center;
  /* padding-bottom: 2rem; */
  /* border-bottom: 2px solid var(--border-color); */
}

.category-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.category-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.category-description {
  font-size: 1.1rem;
  color: #666;
  margin-top: 1rem;
}

/* Services List */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Service Card */
.service-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
  box-shadow: 0 4px 16px rgba(236, 179, 96, 0.15);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Service Card Header */
.service-card-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
  min-height: 100px;
  position: relative;
}

.service-card:hover .service-card-header {
  background-color: rgba(236, 179, 96, 0.03);
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-radius: 10px;
  font-size: 1.75rem;
  color: white;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Service Info */
.service-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.service-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.service-short-desc {
  font-size: 0.95rem;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

/* Service Toggle Icon */
.service-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--border-color);
  border-radius: 50%;
  color: var(--primary-color);
  font-size: 1rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.service-card.active .service-toggle {
  background-color: var(--primary-color);
  color: white;
  transform: rotate(180deg);
}

/* Service Card Details - WITH IMAGE */
.service-card-details {
  max-height: 0;
  overflow: hidden;
  background-color: rgba(236, 179, 96, 0.05);
  padding: 0 1.75rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card.active .service-card-details {
  max-height: 2000px;
  padding: 1.75rem;
}

.service-detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.service-detail-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-detail-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.service-details-text {
  color: #555;
  line-height: 1.8;
  font-size: 1rem;
  margin: 0;
}

.service-detail-text p {
  color: #555;
  line-height: 1.8;
  font-size: 0.95rem;
  margin: 0;
  /* Preserve newline characters from translations (JSON) as line breaks */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* CTA Section */
.cta-final-section {
  text-align: center;
  padding: 5rem 0;
}

.cta-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .service-detail-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-detail-image {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .category-title {
    font-size: 1.5rem;
  }

  .services-list {
    /* border-top: 2px solid var(--border-color); */
    padding-top: 1.25rem;
    margin-top: 0.5rem;
  }

  /* Mobile: Stack header elements vertically */
  .service-card-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    min-height: auto;
    padding: 1.5rem;
  }

  /* Icon stays on the left */
  .service-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    order: 1;
  }

  /* Service info takes remaining space */
  .service-info {
    flex: 1;
    min-width: 0;
    order: 2;
  }

  /* Toggle button positioned on the right side, vertically centered with icon */
  .service-toggle {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    order: 3;
    margin-left: auto;
    align-self: center;
  }

  .service-title {
    font-size: 1.1rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 0.35rem;
  }

  .service-short-desc {
    font-size: 0.9rem;
    white-space: normal;
  }

  .cta-title {
    font-size: 1.75rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .service-detail-image {
    height: 220px;
  }

  .service-detail-text p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* Mobile: disable hover effects entirely */
  .service-card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .service-card:hover .service-card-header {
    background-color: white;
  }

  .service-card:hover .service-icon {
    transform: none;
  }

  /* Mobile: animate icon only when card is active/expanded */
  .service-card.active .service-icon {
    animation: iconPulse 0.4s ease-out;
  }
}

/* Icon pulse animation for mobile when card expands */
@keyframes iconPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 576px) {
  .category-title {
    font-size: 1.3rem;
  }

  .service-title {
    font-size: 1rem;
  }

  .service-icon {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }

  .service-toggle {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .services-hero-section {
    height: 32vh;
    min-height: 220px;
  }

  .hero-eyebrow {
    font-size: 1.2rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .service-detail-image {
    height: 200px;
  }

  .service-card.active .service-card-details {
    max-height: 2000px;
  }
}

/* RTL Support */
html[dir='rtl'] .service-card-header {
  flex-direction: row-reverse;
}

html[dir='rtl'] .service-toggle {
  margin-left: 0;
  margin-right: auto;
}

html[dir='rtl'] .service-card.active .service-toggle {
  transform: rotate(180deg);
}

html[dir='rtl'] .service-detail-content {
  direction: rtl;
}

/* RTL: ensure titles and short descriptions align right */
html[dir='rtl'] .service-title,
html[dir='rtl'] .service-short-desc {
  text-align: right;
}

/* RTL: ensure detail paragraphs align right and keep preserved newlines */
html[dir='rtl'] .service-detail-text p {
  text-align: right;
}

/* RTL: hero text alignment */
html[dir='rtl'] .services-hero-section .container .col-lg-8,
html[dir='rtl'] .services-hero-section .container .col-md-10 {
  text-align: right;
}

html[dir='rtl'] .hero-eyebrow,
html[dir='rtl'] .hero-title,
html[dir='rtl'] .hero-subtitle {
  direction: rtl;
}

/* RTL Mobile: Toggle stays on the right (visual start for RTL) */
@media (max-width: 768px) {
  html[dir='rtl'] .service-card-header {
    flex-direction: row-reverse;
  }

  html[dir='rtl'] .service-toggle {
    margin-right: 0;
    margin-left: auto;
  }

  html[dir='rtl'] .service-icon {
    order: 3;
  }

  html[dir='rtl'] .service-info {
    order: 2;
  }

  html[dir='rtl'] .service-toggle {
    order: 1;
  }
}
