/* =========================================================
   DESCRIPTION MODAL
   ========================================================= */

.description-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: none;

  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  padding: 20px;

  box-sizing: border-box;
}

.description-modal.active {
  display: flex;
}


/* =========================================================
   DARK OVERLAY
   ========================================================= */

.description-modal-overlay {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  background: rgba(15, 23, 42, 0.65);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  animation: modalOverlayIn 0.3s ease;
}


/* =========================================================
   MODAL BOX
   ========================================================= */

.description-modal-box {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: 620px;

  max-height: 92vh;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 12px;

  box-sizing: border-box;

  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #f5f8ff 20%,
    #b6bbf2 55%,
    #3b82f6 100%
  );

  border: 1px solid rgba(255, 255, 255, 0.8);

  border-radius: 26px;

  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.35),
    0 10px 30px rgba(59, 130, 246, 0.18);

  animation:
    modalBoxIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}


/* =========================================================
   MODAL SCROLLBAR
   ========================================================= */

.description-modal-box::-webkit-scrollbar {
  width: 6px;
}

.description-modal-box::-webkit-scrollbar-track {
  background: transparent;
}

.description-modal-box::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.45);
  border-radius: 10px;
}

.description-modal-box::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.7);
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.description-modal-close {
  position: fixed;

  top: 22px;
  right: 22px;

  z-index: 50;

  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.9);

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.82);

  color: #0f172a;

  font-size: 25px;
  font-weight: 600;

  line-height: 1;

  cursor: pointer;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.15);

  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.description-modal-close:hover {
  transform: rotate(90deg) scale(1.08);

  background: #1d4ed8;

  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.22);
}

.description-modal-close:active {
  transform: rotate(90deg) scale(0.95);
}


/* =========================================================
   CATEGORY
   Learning Session 01
   ========================================================= */

.modal-course-category {
  display: inline-flex;
  align-items: center;

  margin-top: 4px;
  margin-left: 4px;
  margin-bottom: 14px;

  padding: 7px 13px;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.82);

  border: 1px solid rgba(255, 255, 255, 0.9);

  color: #1d4ed8;

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.6px;

  text-transform: uppercase;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  box-shadow:
    0 5px 15px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   MODAL IMAGE AREA
   ========================================================= */

.modal-image {
  position: relative;

  width: 100%;
  height: auto;

  margin: 0;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.28);

  border-radius: 19px;

  line-height: 0;

  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.18);

  isolation: isolate;
}


/* =========================================================
   FULL IMAGE
   NO CROP
   ========================================================= */

.modal-image img {
  display: block;

  width: 100%;
  height: auto;

  max-width: 100%;
  max-height: none;

  margin: 0 auto;

  object-fit: contain;
  object-position: center;

  border-radius: inherit;

  transition:
    transform 0.4s ease;
}


/* =========================================================
   IMAGE HOVER
   ========================================================= */

.description-modal-box:hover .modal-image img {
  transform: scale(1.01);
}


/* =========================================================
   IMAGE SHINE
   ========================================================= */

.modal-image::after {
  content: "";

  position: absolute;
  inset: 0;

  z-index: 2;

  pointer-events: none;

  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.15),
    transparent 35%,
    transparent 70%,
    rgba(255, 255, 255, 0.05)
  );
}


/* =========================================================
   MODAL TITLE
   ========================================================= */

.description-modal-box h2 {
  margin: 18px 4px 14px;

  color: #0f172a;

  font-size: 32px;
  font-weight: 800;

  line-height: 1.15;

  letter-spacing: -0.6px;

  word-break: break-word;
}


/* =========================================================
   DESCRIPTION BOX
   ========================================================= */

.modal-description {
  margin: 0 4px;

  min-height: 180px;
  max-height: 360px;

  padding: 20px;

  overflow-y: auto;

  box-sizing: border-box;

  background: rgba(255, 255, 255, 0.58);

  border: 1px solid rgba(255, 255, 255, 0.78);

  border-radius: 17px;

  color: #334155;

  font-size: 15px;
  font-weight: 450;

  line-height: 1.8;

  white-space: pre-line;

  overflow-wrap: anywhere;
  word-break: break-word;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 7px 22px rgba(15, 23, 42, 0.07);
}


/* =========================================================
   DESCRIPTION SCROLLBAR
   ========================================================= */

.modal-description::-webkit-scrollbar {
  width: 6px;
}

.modal-description::-webkit-scrollbar-track {
  background: transparent;
}

.modal-description::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.45);
  border-radius: 10px;
}

.modal-description::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.7);
}


/* =========================================================
   JOIN GROUP BUTTON
   ========================================================= */

.modal-join-btn {
  display: flex;

  align-items: center;
  justify-content: center;

  width: calc(100% - 8px);

  min-height: 52px;

  margin: 20px 4px 4px;

  padding: 14px 22px;

  box-sizing: border-box;

  border-radius: 14px;

  background: #1d4ed8;

  color: #ffffff;

  text-decoration: none;

  font-size: 15px;
  font-weight: 700;

  letter-spacing: 0.2px;

  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.22);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.modal-join-btn:hover {
  transform: translateY(-3px);

  background: #ffffff;
color:#1d4ed8;
  box-shadow:
    0 15px 30px rgba(15, 23, 42, 0.3);
}

.modal-join-btn:active {
  transform: translateY(-1px);
}


/* =========================================================
   BODY LOCK
   ========================================================= */

body.modal-open {
  overflow: hidden;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes modalOverlayIn {

  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }

}


@keyframes modalBoxIn {

  from {
    opacity: 0;

    transform:
      translateY(25px)
      scale(0.96);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 700px) {

  .description-modal {
    padding: 15px;
  }


  .description-modal-box {
    width: 100%;
    max-width: 100%;

    max-height: 92vh;

    padding: 10px;

    border-radius: 22px;
  }


  .modal-course-category {
    margin-top: 3px;
    margin-bottom: 12px;

    padding: 7px 12px;

    font-size: 11px;
  }


  /* FULL IMAGE */

  .modal-image {
    width: 100%;
    height: auto;

    border-radius: 16px;
  }


  .modal-image img {
    width: 100%;
    height: auto;

    max-width: 100%;
    max-height: none;

    object-fit: contain;
  }


  .description-modal-close {
    top: 18px;
    right: 18px;

    width: 38px;
    height: 38px;

    font-size: 22px;
    position: fixed;
  }


  .description-modal-box h2 {
    margin-top: 15px;

    font-size: 27px;
  }


  .modal-description {
    min-height: 180px;
    max-height: 330px;

    padding: 17px;

    font-size: 14px;

    line-height: 1.75;
  }


  .modal-join-btn {
    min-height: 50px;

    font-size: 14px;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 480px) {

  .description-modal {
    padding: 10px;
  }


  .description-modal-box {
    width: 100%;

    max-height: 94vh;

    padding: 8px;

    border-radius: 20px;
  }


  /* CATEGORY */

  .modal-course-category {
    margin-top: 20px;
    margin-left: 2px;
    margin-bottom: 10px;

    padding: 6px 11px;

    font-size: 10px;

    letter-spacing: 0.5px;
  }


  /* IMAGE */

  .modal-image {
    width: 100%;
    height: auto;

    border-radius: 15px;
  }


  .modal-image img {
    display: block;

    width: 100%;
    height: auto;

    max-width: 100%;
    max-height: none;

    object-fit: contain;
    object-position: center;
  }


  /* CLOSE BUTTON */

  .description-modal-close {
    top: 15px;
    right: 15px;

    width: 36px;
    height: 36px;

    font-size: 21px;
  }


  /* TITLE */

  .description-modal-box h2 {
    margin: 14px 2px 11px;

    font-size: 24px;

    line-height: 1.2;

    letter-spacing: -0.3px;
  }


  /* DESCRIPTION */

  .modal-description {
    margin: 0 2px;

    min-height: 190px;
    max-height: 320px;

    padding: 16px;

    border-radius: 14px;

    font-size: 13.5px;

    line-height: 1.7;
  }


  /* JOIN BUTTON */

  .modal-join-btn {
    width: calc(100% - 4px);

    min-height: 48px;

    margin: 16px 2px 16px;

    padding: 16px 18px;

    border-radius: 12px;

    font-size: 14px;
  }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

  .description-modal {
    padding: 7px;
  }


  .description-modal-box {
    max-height: 95vh;

    padding: 7px;

    border-radius: 18px;
  }


  .modal-course-category {
    font-size: 9px;

    padding: 5px 9px;
  }


  .description-modal-close {
    top: 12px;
    right: 12px;

    width: 34px;
    height: 34px;

    font-size: 19px;
  }


  .modal-image img {
    width: 100%;
    height: auto;

    max-width: 100%;
    max-height: none;
  }


  .description-modal-box h2 {
    margin-top: 12px;

    font-size: 21px;
  }


  .modal-description {
    min-height: 180px;

    max-height: 290px;

    font-size: 13px;

    padding: 13px;

    line-height: 1.65;
  }


  .modal-join-btn {
    min-height: 46px;

    font-size: 13px;
    background: #1d4ed8;
  }

}