body {
  background-color: #f5f7fa;
}

.two-column-layout {
  display: flex;
  gap: 20px;
  max-width: 960px;
  margin: 40px auto;
  align-items: stretch;
}

/* Left side with rows of small buttons */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 2;
}

.row {
  display: flex;
  gap: 20px;
}

.container-3 h1 {
  color: black;
}

.small-btn {
  flex: 1;
  font-size: 16px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background-color: #e6ebf1;
  color: #1e3a8a;
  cursor: pointer;
  text-align: center;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: column;
  height: 100%;
}

.small-btn p {
  color: #2f4f4f;
  font-weight: 600;
  font-family: "Marcellus", serif;
}

.view-button {
  display: flex;
  height: fit-content;
  width: fit-content;
  padding: 10px;
  border-radius: 10px;
  /* background: linear-gradient(145deg, #202937, #151d29); */
  background-color: #202937;
  color: #fafafa;
  transition: all 0.2s ease;
  margin-bottom: 10px;
  font-weight: 600;
  text-decoration: none;
}

.view-button:hover {
  background-color: orange;
  /* Gold on hover */
  color: #003366;
  /* Deep Blue Text on Hover */
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: white;
}

.our-services-img {
  height: 90px;
  width: 90px;
  border-radius: 45%;
  margin-top: 15px;
}

.container-3 {
  color: #ffe031;
  text-align: center;
  font-size: 28px;
}

/*Section-3*/
.section-3 {
  background: linear-gradient(145deg, #202937, #151d29);
  padding: 10px 20px;
  color: #ffffff;
  font-family: "Segoe UI", sans-serif;
  border-radius: 10px;
  text-align: center;
}

.section-3 h1 {
  color: #e6ebf1;
}

.credential-content {
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.credential-content ul {
  list-style: none;
  padding: 0;
}

.credential-content li {
  font-size: 28px;
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
}

.credential-content li span {
  color: #2e7d32;
  /* Green check icon */
  font-size: 1.2em;
  flex-shrink: 0;
}

#slider {
  position: relative;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 40px auto;
}

.card {
  width: 100%;
  height: 360px;
  /* fixed height for all cards */
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  padding: 24px;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.8s ease-in-out;
  box-sizing: border-box;
}

.card.active {
  opacity: 1;
  position: relative;
}

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  height: 72px;
  width: 72px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ef4444;
  color: #fff;
  font-size: 38px;
  font-weight: 600;
  border-radius: 50%;
}

.name {
  color: #111827;
  font-weight: 500;
  font-size: 32px;
}

.place {
  color: #6b7280;
  font-size: 26px;
}

.text {
  color: #374151;
  font-size: 20px;
  line-height: 1.5;
}

.controls {
  display: flex;
  justify-content: center;
  /* center align buttons */
  gap: 16px;
  margin-top: 16px;
}

.btn {
  background-color: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn:hover {
  background-color: #dc2626;
}

@media only screen and (max-width: 600px) {
  .text-container {
    font-size: 45px;
    margin: 0px;
  }

  .container-1 {
    display: grid;
    grid-template-areas:
      "image"
      "text";
    grid-template-columns: 1fr;
    align-items: center;
    justify-content: space-around;
  }
  .two-column-layout {
    flex-direction: column;
    align-items: center;
  }

  .image-container img {
    height: 100%;
    width: 80vw;
    margin-right: 10px;
    right: 0px;
  }
  .row {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .small-btn {
    width: 90%;
    height: 80%;
    margin: 10px 0;
    font-size: 14px;
  }
  .small-btn h1 {
    font-size: 18px;
  }
  .small-btn p {
    font-size: 12px;
  }

  .our-services-img {
    height: 60px;
    width: 60px;
    margin-top: 10px;
  }

  .head-bar {
    flex-direction: column;
    text-align: center;
  }

  .dropdown-content {
    text-align: center;
    z-index: 2;
  }
  .credential-content li {
    font-size: 14px;
  }

  footer h1,
  footer p {
    text-align: center;
    padding: 0 10px;
  }
  .avatar {
    width: 45px;
    height: 45px;
    font-size: 24px;
  }
  .name {
    font-size: 20px;
  }
  .place {
    font-size: 16px;
  }
  .text {
    font-size: 18px;
  }
}

@media only screen and (min-width: 601px) and (max-width: 1024px) {
  .text-container {
    font-size: 52px;
    text-align: center;
    margin: 0;
  }

  .container-1 {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "text";
    align-items: center;
    justify-content: center;
    gap: 20px;
  }

  .image-container {
    justify-content: center;
  }

  .image-container img {
    height: auto;
    width: 70vw;
    margin: 0 auto;
  }

  .two-column-layout {
    flex-direction: column;
    align-items: center;
  }

  /* ✅ Change to grid with 2 columns => 3 rows for 5 items */
  .small-btn {
    height: 200px;
    padding: 0px;
  }
  .small-btn h1 {
    font-size: 22px;
  }
  .small-btn p {
    font-size: 16px;
  }
  .view-button {
    font-size: 16px;
    font-weight: 500;
    padding: 5px;
  }

  .our-services-img {
    height: 60px;
    width: 60px;
    margin-top: 10px;
  }

  .head-bar {
    flex-direction: row;
    text-align: center;
  }

  .dropdown-content {
    text-align: center;
  }

  .credential-content li {
    font-size: 18px;
    text-align: center;
    justify-content: center;
  }

  footer h1,
  footer p {
    text-align: center;
    padding: 0 15px;
  }
}

/* Desktop Layout */
.slider-container {
  width: 100%;
  height: 450px;
  position: relative;
  overflow: hidden;
  display: flex;
  background-color: #e6ebf1;
  flex-direction: row;
}

/* SLIDE IMAGE — desktop style */
.slide {
  position: absolute;
  top: 0;
  right: -50%;
  width: 40%;
  height: 100%;
  opacity: 0;
  transition: all 1s ease;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* TEXT — desktop */
.slide-text {
  position: absolute;
  left: 0;
  top: -100px;
  width: 60%;
  padding: 40px;
  font-size: 55px;
  line-height: 1.1;
  font-family: "Playfair Display", serif;
  color: #1e3a8a;
  font-weight: 800;
  opacity: 0;
  transition: all 0.8s ease;
  word-wrap: break-word;
}

/* Overlay */
#popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Popup card */
.popup-content {
  position: relative;
  background: #fff;
  padding: 12px;
  border-radius: 10px;

  width: 90%;
  max-width: 600px;
  max-height: 80vh;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  animation: popupFade 0.4s ease;
}

/* Image fit fix */
.popup-content img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ✅ FIXED CLOSE BUTTON */
.popup-close {
  position: absolute;
  top: 8px; /* moved INSIDE card */
  right: 8px;

  background: #0f172a; /* darker for contrast */
  color: #ffffff;
  border: none;

  width: 36px;
  height: 36px;
  border-radius: 50%;

  font-size: 18px;
  font-weight: bold;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 10; /* ensures visibility */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Hover effect */
.popup-close:hover {
  background: #1e3a8a;
}

/* Mobile */
@media (max-width: 600px) {
  .popup-close {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* Animation */
@keyframes popupFade {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .popup-content {
    max-height: 85vh;
  }

  .popup-content img {
    max-height: 70vh;
  }
}

/* ----------------------------------
   MOBILE + TABLET FIX (100% working)
------------------------------------*/
@media (max-width: 950px) {
  .slider-container {
    flex-direction: column;
    height: auto !important;
    padding: 40px 0;
    overflow: visible;
    align-items: center;
  }

  .slide {
    position: relative !important;
    width: 90% !important;
    height: auto !important;
    opacity: 0;
    margin-top: 10px;

    /* Hide all slides in mobile */
    display: none;
  }

  /* Only active slide */
  .slide.active-mobile {
    display: block !important;
    opacity: 1 !important;
    right: 0 !important;
  }

  .slide img {
    width: 100%;
    height: auto;
  }

  .slide-text {
    position: relative !important;
    width: 90% !important;
    top: 0 !important;
    left: 0 !important;
    padding: 0;
    font-size: 32px;
    opacity: 0;
    text-align: center;
    margin-bottom: 15px;
  }
}
