/*
 * Shared modal styles for image lightbox (index + about me).
 */

.modal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  /* backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); */
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  max-height: 80%;
  max-width: 50%;
  width: auto;
  height: auto;
  border-radius: 2vw;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.modal.active .modal-content {
  transform: scale(1);
}

@media (max-width: 920px) {
  .modal-content {
    max-height: 85%;
    max-width: 90%;
    border-radius: 12px;
  }
}

/* Work case study modals (cantrace, timeline, applemusic) */
.work-modal {
  display: flex;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); */
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.work-modal.active {
  opacity: 1;
  visibility: visible;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
}

.work-modal-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 80vh;
  max-height: 900px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 1;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-modal.active .work-modal-container {
  transform: scale(1);
}

.work-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: gray;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: 0.3s ease;
}

.work-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  transition: 0.3s ease;
}

.work-modal-close:focus,
.work-modal-close:active {
  outline: none;
  border: none;
}

.work-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 920px) {
  .work-modal-container {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .work-modal-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}
