/* ==========================================================================
   15. Modals & Notifications
   ========================================================================== */
@layer components {
  /* --------------------------------------------------------------------------
     15. Modals & Notifications
     -------------------------------------------------------------------------- */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 27, 43, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;

    &.active {
      display: flex;
      animation: modalFadeIn 0.25s ease-out;
    }
  }

  @keyframes modalFadeIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  .modal-container {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes modalSlideUp {
    from {
      transform: translateY(20px);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 1.2rem;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #F1F5F9;

    &:hover {
      background: #E2E8F0;
      color: var(--navy-dark);
    }
  }

  .modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy-dark);
    margin-bottom: 6px;
  }

  .modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
  }

  .modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;

    label {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--navy-dark);
      margin-bottom: 4px;
      display: block;
    }
  }

  /* Doctor Modal Specifics */
  .doctor-modal-content {
    max-width: 600px;
  }

  .doctor-modal-flex {
    display: flex;
    gap: 24px;
    align-items: flex-start;
  }

  .doctor-modal-avatar {
    width: 160px;
    height: 180px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .doctor-modal-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy-dark);
    margin-bottom: 4px;
  }

  .doctor-modal-role {
    font-size: 0.85rem;
    color: var(--primary-teal);
    font-weight: 700;
    margin-bottom: 8px;
  }

  .doctor-modal-badge {
    display: inline-block;
    background: var(--gold-light);
    color: var(--gold-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 14px;
  }

  .doctor-modal-bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
  }

  /* Video Modal */
  .video-modal-content {
    max-width: 800px;
    padding: 24px;
    background: #000000;
  }

  .video-responsive-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;

    iframe {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
  }

  /* Toast */
  .toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary-teal);
    color: #FFFFFF;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-bounce);

    &.show {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
  }
}
