/* CPG Mind Map Style - Desktop & Mobile */

/* Wrapper handles spacing */
.cpg-mindmap-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden; /* Prevent floating elements from causing scrollbars */
}

/* MOBILE LIST VIEW (Default for small screens) */
.d-mobile-list {
  display: block;
}

.d-desktop-mindmap {
  display: none;
}

/* DESKTOP MINDMAP VIEW (Large screens) */
@media (min-width: 992px) {
  .d-mobile-list {
    display: none;
  }

  .d-desktop-mindmap {
    display: block;
    position: relative;
    width: 100%;
    height: 700px; /* Fixed height area for the map */
    margin: 0 auto;
    /* create a radial gradient background for mood */
    background: radial-gradient(
      circle at center,
      rgba(0, 86, 179, 0.03) 0%,
      rgba(255, 255, 255, 0) 70%
    );
    border-radius: 50%;
  }

  /* SVG Lines Layer */
  .mindmap-lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
  }

  .connection-line {
    stroke: #cbd5e0;
    stroke-width: 2;
    stroke-dasharray: 5, 5; /* Dashed line effect */
    opacity: 0.6;
    animation: dash-flow 60s linear infinite;
  }

  /* Central Hub */
  .mindmap-center-node {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 86, 179, 0.2);
    border: 4px solid #007bff;
    text-align: center;
    animation: pulse-glow 3s infinite ease-in-out;
  }

  .mindmap-center-text {
    font-family: "IBM Plex Sans Thai", sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #007bff;
    line-height: 1;
    margin-bottom: 5px;
  }
  .mindmap-center-sub {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  /* Orbital Nodes */
  .mindmap-node-wrapper {
    position: absolute;
    width: 180px; /* Reduced width for better fit */
    z-index: 10;
    /* Positioning will be handled by specific classes */
  }

  /* Floating Animation Container */
  .floater {
    animation: float-y 4s ease-in-out infinite;
  }

  /* Delays for natural feel */
  .delay-1 {
    animation-delay: 0s;
  }
  .delay-2 {
    animation-delay: 0.5s;
  }
  .delay-3 {
    animation-delay: 1s;
  }
  .delay-4 {
    animation-delay: 1.5s;
  }
  .delay-5 {
    animation-delay: 2s;
  }
  .delay-6 {
    animation-delay: 2.5s;
  }

  /* Node Card Styling (Modified for Mindmap) */
  .mm-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mm-card:hover {
    transform: scale(1.1);
    z-index: 30;
  }

  .mm-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    transition: border-color 0.3s;
  }

  .mm-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mm-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    width: 100%;
    transition: all 0.3s;
  }

  .mm-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    font-family: "IBM Plex Sans Thai", sans-serif;
  }

  /* Hover Colors */
  .mm-card:hover .mm-circle {
    border-color: #007bff;
  }
  .mm-card:hover .mm-info {
    background: #007bff;
    color: white;
  }
  .mm-card:hover .mm-title {
    color: white;
  }

  /* POSITIONS (Radial Layout) 
       Center is at 50% 50%.
       We use calc to offset by node width/height.
       Node is approx 180w x 180h (including text).
    */

  /* 1. Top (Breast) */
  .pos-top {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
  }

  /* 2. Top Right (Liver) */
  .pos-top-right {
    top: 20%;
    right: 10%;
  }

  /* 3. Bottom Right (Lung) */
  .pos-bottom-right {
    bottom: 20%;
    right: 10%;
  }

  /* 4. Bottom (Cervical) */
  .pos-bottom {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
  }

  /* 5. Bottom Left (Colorectal) */
  .pos-bottom-left {
    bottom: 20%;
    left: 10%;
  }

  /* 6. Top Left (Prostate) */
  .pos-top-left {
    top: 20%;
    left: 10%;
  }
}

/* Animations */
@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

@keyframes dash-flow {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* --- Keep Existing Styles for Mobile / Fallback --- */
/* Re-use relevant mobile styles from original cpg-cards if desired, 
   but for the d-mobile-list we can just use standard Bootstrap cards logic 
   or simplified versions of what we wrote above.
*/

.d-mobile-list .cpg-node {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 15px;
  text-decoration: none;
  transition: transform 0.2s;
}

.d-mobile-list .cpg-node:active {
  transform: scale(0.98);
}

.d-mobile-list .cpg-circle-mobile {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 15px;
  flex-shrink: 0;
}
.d-mobile-list .cpg-circle-mobile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.d-mobile-list .cpg-info-mobile h5 {
  font-size: 1.1rem;
  margin: 0;
  color: #333;
}
.d-mobile-list .cpg-info-mobile span {
  font-size: 0.85rem;
  color: #777;
}
