/* 
========================================================================
== TỆP: CSS/WEBSITE.CSS
== CHỨC NĂNG: Giao diện nút và popup cho Website
========================================================================
*/

@keyframes border-run-website {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ================= NÚT WEBSITE TRONG KHÔNG GIAN 3D ================= */

.btn-website-hotspot {
  position: absolute;
  /* Căn giữa tâm nút HTML tại đúng tọa độ 3D (kích thước 40px thì top/left = -20px) */
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  background-color: var(--default-menu-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 15px rgba(251, 248, 236, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease;
  z-index: 1000;
}

.btn-website-hotspot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  padding: 2px;
  box-sizing: border-box;
  z-index: -1;
  background: conic-gradient(
    from 0deg,
    transparent 70%,
    rgba(251, 248, 236, 0.3) 90%,
    var(--default-menu-border) 100% var(--default-menu-border) 100%
  );
  animation: border-run-website 4s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.btn-website-hotspot:hover {
  transform: scale(1.1);
  background-color: rgba(251, 248, 236, 0.8);
  color: #c00207;
}

/* ================= POPUP WEBSITE ================= */

.website-modal-overlay {
  display: none;
  position: fixed;
  z-index: 100000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.website-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.website-modal-content {
  position: relative;
  width: 80%;
  height: 80%;
  background-color: var(--default-menu-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 2px 0 15px rgba(251, 248, 236, 0.4);
  animation: zoom-in-website 0.3s ease;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

@keyframes pulse-border {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.website-modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  box-sizing: border-box;
  z-index: -1;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    transparent 70%,
    rgba(251, 248, 236, 0.3) 90%,
    var(--default-menu-border) 100%
  );
  animation:
    rotate-border 4s linear infinite,
    pulse-border 3s ease-in-out infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

@keyframes zoom-in-website {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.website-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 2;
}

.website-modal-close:hover {
  color: #c00207;
}

.website-title {
  color: var(--default-menu-border);
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--default-menu-border);
  flex-shrink: 0;
}

.website-iframe-container {
  flex-grow: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  position: relative;
  width: 100%;
}

.website-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media screen and (max-width: 768px) {
  .website-title {
    font-size: 18px;
    margin-bottom: 15px;
  }
  .website-modal-content {
    width: 95%;
    height: 90%;
    padding: 15px;
  }
}
