/* Studio Minna - Modals & Popups (Light Theme) */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(14, 20, 28, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  background-color: #FFFFFF;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 25px 60px -12px rgba(10, 18, 30, 0.4), 0 0 1px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1E2733;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 10;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.modal-close-btn:hover {
  background: var(--color-accent);
  color: var(--color-primary);
  border-color: transparent;
  transform: rotate(90deg);
}

/* Modal Content with Hero Background (Home Cards) */
.modal-header-bg {
  position: relative;
  min-height: 200px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 36px 40px;
}

.modal-header-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(20, 26, 34, 0.4) 0%, rgba(20, 26, 34, 0.88) 100%);
}

.modal-header-title {
  position: relative;
  z-index: 2;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: var(--font-weight-light);
  color: var(--color-text-white);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 8px;
}

/* Modal Body (Light Theme) */
.modal-body {
  padding: 40px;
  overflow-y: auto;
  color: #333C48;
  font-size: 1.05rem;
  line-height: 1.8;
  background-color: #FFFFFF;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #F1F5F9;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.modal-body p {
  color: #333C48;
  margin-bottom: 20px;
}

.modal-body strong {
  color: #141C26;
  font-weight: var(--font-weight-semibold);
}

.modal-body a {
  color: var(--color-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.modal-body a:hover {
  color: var(--color-teal-dark);
}

.modal-body ul {
  margin: 20px 0;
  padding-left: 20px;
}

.modal-body li {
  list-style-type: disc;
  margin-bottom: 12px;
  color: #333C48;
}

/* Team CV Modal Specifics */
.modal-cv-profile {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.modal-cv-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.modal-cv-info {
  min-width: 0;
  max-width: 100%;
  flex: 1;
}

.modal-cv-info h3 {
  font-size: 1.6rem;
  font-weight: var(--font-weight-semibold);
  color: #141C26;
  margin-bottom: 6px;
  word-break: break-word;
}

.modal-cv-role {
  color: #2D655A;
  font-weight: var(--font-weight-semibold);
  font-size: 1.05rem;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.modal-cv-info p {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.modal-cv-email {
  margin-top: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.modal-cv-email strong {
  color: #141C26;
  margin-right: 4px;
}

.modal-cv-email a,
.modal-cv-info a {
  word-break: break-all;
  overflow-wrap: anywhere;
  display: inline-block;
  max-width: 100%;
}

@media (max-width: 767px) {
  .modal-backdrop {
    padding: 16px 12px;
  }
  .modal-dialog {
    max-height: 94vh;
    border-radius: 12px;
    width: 100%;
  }
  .modal-body {
    padding: 24px 16px;
  }
  .modal-header-bg {
    padding: 24px 16px;
    min-height: 140px;
  }
  .modal-cv-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
  }
  .modal-cv-photo {
    width: 110px;
    height: 110px;
  }
  .modal-cv-info {
    width: 100%;
    max-width: 100%;
  }
  .modal-cv-info h3 {
    font-size: 1.4rem;
  }
  .modal-cv-role {
    font-size: 0.95rem;
    margin-bottom: 10px;
  }
  .modal-cv-email {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.92rem;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
  }
  .modal-cv-email a {
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    color: var(--color-teal);
    text-decoration: underline;
    text-underline-offset: 3px;
    max-width: 100%;
    text-align: center;
  }
}
