/* Heading */
@import url("https://fonts.googleapis.com/css2?family=Madimi+One&family=Nanum+Myeongjo:wght@400;700;800&display=swap");

/* sub heading */
@import url("https://fonts.googleapis.com/css2?family=Madimi+One&family=Mina:wght@400;700&family=Nanum+Myeongjo:wght@400;700;800&display=swap");

:root {
  --bg-color: #1a1a1a;
  --primary-text-color: #e0e0e0;
  --accent-color: #00f0ff;
  --card-bg: #222;
  --font-main: "Russo One", sans-serif;
  --mobile-breakpoint: 900px;
}

/* --- Main Services Container --- */
.services-section {
  /* width: 100%; */
  /* clip-path: polygon(45% 0, 74% 0, 100% 0, 100% 100%, 0 100%, 0 12%, 36% 12%); */
  /* clip-path: polygon(30% 0%, 100% 0%, 100% 0%, 100% 100%, 0 100%, 0% 6%, 27% 6%); */
  max-width: 1100px;
  background-color: var(--bg-color);
  padding: 2rem 3rem;
  border-radius: 20px;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3),
    inset 0 0 15px rgba(0, 240, 255, 0.2);
  position: relative;
  padding-top: 70px;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    #e0e0e03d 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  margin: auto;
}

/* --- Section Header --- */

.services-header {
  text-align: center;
}

.services-header h2 {
  color: var(--accent-color);
  font-family: var(--font-main);
  font-size: 3.6rem;
  letter-spacing: 2px;
  margin: 0 0 0.5rem 0;
  font-family: "Madimi One", sans-serif;
  font-weight: 800;
  font-style: normal;
  font-size: 64px;
  color: #0097b2;
}

.services-header p {
  color: var(--primary-text-color);
  font-family: var(--font-main);
  font-size: 1.5rem;
  margin: 0;
  font-family: "Mina", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 32px;
}

/* --- MOBILE FIRST: Accordion Layout --- */
.services-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-item .nav-button {
  background: none;
  border: none;
  color: var(--primary-text-color);
  font-family: var(--font-main);
  font-size: 1.8rem;
  text-align: left;
  padding: 1rem 0;
  cursor: pointer;
  width: 100%;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
}

.service-item .nav-button:hover {
  opacity: 1;
}

.service-item.active .nav-button {
  opacity: 1;
  color: var(--accent-color);
}

/* Arrow for the button */
.service-item .nav-button::before {
  content: "→";
  color: var(--accent-color);
  margin-right: 1.5rem;
  font-size: 1.8rem;
  transition: transform 0.3s ease;
  transform-origin: center;
}

.service-item.active .nav-button::before {
  transform: rotate(90deg);
}

.service-card-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s ease-in-out, opacity 0.5s ease-in-out,
    padding-bottom 0.7s ease-in-out;
  padding-bottom: 0;
}

.service-item.active .service-card-wrapper {
  max-height: 500px;
  /* Should be larger than card height */
  opacity: 1;
  padding-bottom: 2rem;
  /* Space below card on mobile */
}

/* --- Service Card Styles (No Flip Animation) --- */
.service-card {
  background-color: #000;
  width: 100%;
  max-width: 350px;
  height: 420px;
  margin: 0 auto;
  border-radius: 15px;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  padding: 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.service-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  text-align: center;
}

.service-card-content h4 {
  font-family: var(--font-main);
  color: var(--accent-color);
  letter-spacing: 1px;
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

.service-card-content img {
  /* max-width: 60%; */
  height: 150px;

  object-fit: contain;
  flex-grow: 1;
  /* margin: 1rem 0; */
}

.service-card-features {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  text-align: left;
  width: 100%;
  font-size: 0.9rem;
}

.service-card-features li::before {
  content: "• ";
  color: var(--accent-color);
}

.know-more-button {
  padding: 10px 20px;
  border: 2px solid var(--accent-color);
  background: transparent;
  color: var(--accent-color);
  font-family: var(--font-main);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  margin-top: 1rem;
}

.know-more-button:hover {
  background: var(--accent-color);
  color: var(--bg-color);
  box-shadow: 0 0 10px var(--accent-color);
}

/* --- DESKTOP: Grid Layout --- */
@media (min-width: 901px) {
  .services-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
    align-items: center;
    min-height: 450px;
  }

  .service-item {
    /* Place each item in its own row in the grid */
    display: contents;
  }

  .service-item .nav-button {
    grid-column: 1;
    /* All buttons go in column 1 */
    font-size: 2.5rem;
    padding: 1rem 0;
  }

  .service-item .nav-button::before {
    font-size: 2.5rem;
    transform: none !important;
    /* Disable rotation on desktop */
  }

  .service-item.active .nav-button::before {
    opacity: 1;
  }

  .service-item .nav-button:not(.active-button-desktop)::before {
    opacity: 0;
    /* Hide arrow on non-active desktop buttons */
  }

  .service-card-wrapper {
    grid-column: 2;
    /* All cards go in column 2 */
    grid-row: 1 / 5;
    /* Stack all cards in the same grid area */

    /* Override mobile styles */
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease;
    transform: scale(0.95);
    display: block;
    /* ensure it's a block for positioning */
  }

  /* Hide all cards by default on desktop */
  .service-item:not(.active) .service-card-wrapper {
    opacity: 0;
    pointer-events: none;
    /* Make non-active cards un-hoverable */
    transform: scale(0.95);
  }

  /* Show only the active card */
  .service-item.active .service-card-wrapper {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }
}

@media (max-width: 480px) {
  .services-section {
    margin: 0px 10px;
    padding: 1.5rem;
    padding-top: 40px;
  }

  .services-header h2 {
    font-size: 2.2rem;
  }
  .services-header p {
    padding: 5px;
    font-size: 1.2rem;
  }

  .service-item .nav-button {
    font-size: 1.5rem;
  }

  .service-item .nav-button::before {
    font-size: 1.5rem;
  }
}
