/* ===== MODAL CONTAINER ===== */
.service-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 20px;
  pointer-events: none;
}

.service-modal.active {
  display: flex;
  pointer-events: auto;
}

/* ===== MODAL BACKDROP (PREMIUM BLUR) ===== */
.service-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(10, 37, 64, 0.92),
    rgba(15, 41, 77, 0.88)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: modalFadeIn 0.4s ease forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== MODAL CONTENT BOX (GLASSMORPHISM) ===== */
.service-modal-content {
  position: relative;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.98),
    rgba(248, 250, 252, 0.95)
  );
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  max-width: 1200px; /* Wider for split layout */
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 1;
  opacity: 0;
  transform: translateY(50px) scale(0.97);
}

.service-modal.active .service-modal-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes modalSlideUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== SPLIT LAYOUT CONTAINER ===== */
.service-modal-split {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  min-height: 500px;
}

/* ===== CLOSE BUTTON (PREMIUM) ===== */
.service-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hc-navy, #0a2540);
  border: 1px solid white;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
}

.service-modal-close:hover {
  background: white;
  color: var(--hc-navy, #0a2540);
  transform: rotate(90deg) scale(1.05);
  border-color: var(--hc-navy, #0a2540);
}

.service-modal-close:focus {
  outline: 2px solid var(--hc-teal, #0d9488);
  outline-offset: 3px;
}

/* ===== MODAL IMAGE ===== */
.service-modal-image {
  position: relative;
  width: 100%;
  min-height: 500px;
  overflow: hidden;
  border-radius: 24px 0 0 24px;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fbff 40%, #eef2ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Soft background glow */
.service-modal-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(13, 148, 136, 0.12),
      transparent 55%
    ),
    radial-gradient(circle at 80% 70%, rgba(30, 58, 138, 0.1), transparent 60%);
  z-index: 0;
}

/* Bottom fade */
.service-modal-image::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.65), transparent);
  z-index: 1;
}

/* IMAGE WIDTH CONTROL */
.service-modal-image img {
  width: 85%; 
  max-width: 420px;
  height: 62%;
  object-fit: cover;
  border-radius: 16px;
  position: relative;
  z-index: 2;

  box-shadow:
    0 18px 45px rgba(10, 37, 64, 0.18),
    0 2px 10px rgba(0, 0, 0, 0.05);

  transition: all 0.5s ease;
}

/* Hover effect */
.service-modal-image:hover img {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 28px 65px rgba(10, 37, 64, 0.25),
    0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Dynamic Image Badge (Top-Left) */
.service-image-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 18px;
  background: linear-gradient(
    135deg,
    var(--hc-teal, #0d9488),
    var(--hc-cyan, #06b6d4)
  );
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 24px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
  animation: badgePop 0.4s ease forwards;
  opacity: 0;
  transform: translateY(-10px);
}

.service-modal.active .service-image-badge {
  opacity: 1;
  transform: translateY(0);
}

@keyframes badgePop {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  70% {
    transform: translateY(2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== MODAL BODY (RIGHT SIDE) ===== */
.service-modal-body {
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Service Title */
.service-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hc-navy, #0a2540);
  margin: 0 0 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Service Description */
.service-modal-desc {
  font-size: 1.05rem;
  color: var(--hc-gray, #64748b);
  line-height: 1.75;
  margin: 0 0 28px;
}

/* ===== SERVICE FEATURES LIST ===== */
.service-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  gap: 14px;
}

.service-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.95rem;
  color: var(--hc-slate, #475569);
  line-height: 1.6;
}

.service-features li::before {
  content: "✓";
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(
    135deg,
    var(--hc-teal, #0d9488),
    var(--hc-cyan, #06b6d4)
  );
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ===== SERVICE META BADGES ===== */
.service-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hc-border, #e2e8f0);
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: linear-gradient(
    135deg,
    rgba(240, 249, 255, 0.95),
    rgba(248, 250, 252, 0.95)
  );
  border: 1px solid var(--hc-border, #e2e8f0);
  border-radius: 24px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hc-navy, #0a2540);
  transition: all 0.2s ease;
}

.service-badge:hover {
  background: var(--hc-light, #f0f9ff);
  border-color: var(--hc-teal, #0d9488);
  transform: translateY(-2px);
}

.service-badge i {
  font-size: 0.85rem;
  color: var(--hc-teal, #0d9488);
}

/* ===== MODAL CTA BUTTONS (PREMIUM) ===== */
.service-modal-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
}

.service-modal-cta .btn {
  flex: 1;
  min-width: 150px;
  justify-content: center;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.service-modal-cta .btn-primary {
  background: linear-gradient(
    135deg,
    var(--hc-navy, #0a2540),
    var(--hc-blue, #1e3a8a)
  );
  color: white;
  border: none;
  box-shadow: 0 8px 25px rgba(10, 37, 64, 0.25);
}

.service-modal-cta .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(10, 37, 64, 0.35);
}

.service-modal-cta .btn-secondary {
  background: transparent;
  color: var(--hc-navy, #0a2540);
  border: 2px solid var(--hc-border, #e2e8f0);
}

.service-modal-cta .btn-secondary:hover {
  background: var(--hc-light, #f0f9ff);
  border-color: var(--hc-navy, #0a2540);
  transform: translateY(-2px);
}

/* ===== READ MORE BUTTON ===== */
.read-more-btn {
  background: transparent;
  border: 2px solid var(--hc-navy, #0a2540);
  color: var(--hc-navy, #0a2540);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}

.read-more-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(10, 37, 64, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.read-more-btn:hover::before {
  left: 100%;
}

.read-more-btn:hover {
  background: var(--hc-navy, #0a2540);
  color: var(--hc-white, #ffffff);
  border-color: var(--hc-navy, #0a2540);
  transform: translateX(6px);
  box-shadow: 0 10px 30px rgba(10, 37, 64, 0.2);
}

.read-more-btn i {
  font-size: 0.85rem;
  transition: transform 0.35s ease;
}

.read-more-btn:hover i {
  transform: translateX(4px);
}

/* ===== RESPONSIVE: MOBILE STACKED LAYOUT ===== */
@media (max-width: 991px) {
  .service-modal-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .service-modal-content {
    max-width: 100%;
    border-radius: 20px;
    max-height: 96vh;
  }

  .service-modal-image {
    min-height: 220px;
    border-radius: 20px 20px 0 0;
  }

  .service-modal-body {
    padding: 24px 24px 28px;
  }

  .service-modal-title {
    font-size: 1.5rem;
  }

  .service-modal-desc {
    font-size: 1rem;
  }

  .service-features li {
    font-size: 0.9rem;
  }

  .service-modal-cta {
    flex-direction: column;
  }

  .service-modal-cta .btn {
    width: 100%;
  }

  .read-more-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .service-modal {
    padding: 10px;
  }

  .service-modal-image {
    min-height: 380px;
  }

  .service-modal-close {
    width: 36px;
    height: 36px;
    top: 16px;
    right: 16px;
  }

  .service-image-badge {
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    font-size: 0.75rem;
  }

  .service-modal-title {
    font-size: 1.35rem;
  }

  .service-badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }
}

/* ===== ACCESSIBILITY ===== */
.service-modal[aria-hidden="false"] {
  pointer-events: auto;
}

.service-modal-content:focus {
  outline: none;
}

/* ===== SCROLLBAR STYLING (PREMIUM) ===== */
.service-modal-content::-webkit-scrollbar {
  width: 8px;
}

.service-modal-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 16px 0;
}

.service-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--hc-border, #e2e8f0),
    var(--hc-gray, #64748b)
  );
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.service-modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--hc-gray, #64748b),
    var(--hc-navy, #0a2540)
  );
}

/* ===== IMAGE LOADING STATE ===== */
.service-modal-image img:not([src]),
.service-modal-image img[src=""] {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== SUBTLE ENTRANCE ANIMATION FOR CONTENT ===== */
.service-modal-title,
.service-modal-desc,
.service-features,
.service-meta,
.service-modal-cta {
  animation: contentFadeIn 0.4s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}

.service-modal.active .service-modal-title {
  animation-delay: 0.15s;
  opacity: 1;
  transform: translateY(0);
}
.service-modal.active .service-modal-desc {
  animation-delay: 0.25s;
  opacity: 1;
  transform: translateY(0);
}
.service-modal.active .service-meta {
  animation-delay: 0.35s;
  opacity: 1;
  transform: translateY(0);
}
.service-modal.active .service-features {
  animation-delay: 0.45s;
  opacity: 1;
  transform: translateY(0);
}
.service-modal.active .service-modal-cta {
  animation-delay: 0.55s;
  opacity: 1;
  transform: translateY(0);
}
.service-modal.active .service-image-badge {
  animation-delay: 0.2s;
}

@keyframes contentFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
