/* ==========================================================================
   AURORA GLASS — Interactive Modals & Nameserver Popups
   Deep depth layering, spring-load entrances, and OKLCH harmony
   ========================================================================== */

/* ==========================================================================
   MODAL OVERLAY & CONTAINER
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.15 0.02 255 / 0.55);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  
  /* Replaced display:none with visibility for smooth transitions */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-lg);
  
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-normal) var(--ease-standard),
              visibility var(--dur-normal) var(--ease-standard);
}

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

.modal-container {
  /* Level 3 Glass: Prominent for modals */
  background: var(--glass-3-bg);
  -webkit-backdrop-filter: var(--glass-3-blur);
  backdrop-filter: var(--glass-3-blur);
  border: 1px solid var(--glass-3-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl), var(--inset-highlight-strong);
  
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
  
  display: flex;
  flex-direction: column;
  isolation: isolate;
  position: relative;
  
  /* Entrance animation state */
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: 
    opacity var(--dur-slow) var(--ease-out-expo),
    transform var(--dur-slow) var(--ease-spring);
}

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

/* Specular highlight for modal */
.modal-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-specular);
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
  opacity: 0.8;
}

/* ==========================================================================
   MODAL HEADER
   ========================================================================== */
.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--glass-1-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: oklch(1 0 0 / 0.15);
  position: relative;
  z-index: 2;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--glass-2-bg);
  border: 1px solid var(--glass-2-border);
  color: var(--brand-600);
  display: grid;
  place-items: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm), var(--inset-highlight);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close-btn {
  background: var(--glass-2-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-2-border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  font-size: var(--text-md);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs), var(--inset-highlight);
}

.modal-close-btn:hover {
  background: oklch(0.65 0.22 18 / 0.12);
  border-color: oklch(0.65 0.22 18 / 0.35);
  color: var(--rose-600);
  transform: scale(1.05);
}

.modal-close-btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* ==========================================================================
   MODAL BODY & FOOTER
   ========================================================================== */
.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 2;
}

.modal-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--glass-1-border);
  background: oklch(1 0 0 / 0.15);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   NAMESERVER COPY BOX (Level 2 Glass)
   ========================================================================== */
.ns-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.ns-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-2-bg);
  -webkit-backdrop-filter: var(--glass-2-blur);
  backdrop-filter: var(--glass-2-blur);
  border: 1px solid var(--glass-2-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  gap: var(--space-md);
  box-shadow: var(--shadow-sm), var(--inset-highlight);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-fast) var(--ease-standard);
}

.ns-item-row:hover {
  border-color: oklch(0.68 0.17 240 / 0.4);
}

.ns-info-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0; /* Prevents flex overflow */
}

.ns-label {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
}

.ns-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.4;
}

.ns-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--glass-2-bg);
  border: 1px solid var(--glass-2-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--brand-600);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-spring);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs), var(--inset-highlight);
  position: relative;
  overflow: hidden;
}

.ns-copy-btn:hover {
  background: var(--brand-600);
  color: white;
  border-color: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--glow-brand);
}

.ns-copy-btn:active {
  transform: scale(0.95);
}

.ns-copy-btn.copied {
  background: var(--emerald-500);
  border-color: var(--emerald-500);
  color: white;
  box-shadow: var(--glow-emerald);
}

/* ==========================================================================
   LIVE VERIFICATION STATUS BOX
   ========================================================================== */
.dns-status-box {
  background: var(--glass-1-bg);
  -webkit-backdrop-filter: var(--glass-1-blur);
  backdrop-filter: var(--glass-1-blur);
  border: 1px solid var(--glass-1-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  box-shadow: var(--shadow-xs), var(--inset-highlight);
}

.dns-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text-primary);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.dns-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--glass-2-bg);
  padding: 4px var(--space-sm);
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-2-border);
}

.dns-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 8px var(--amber-500);
  animation: pulse-dot 2s ease-in-out infinite;
}

.dns-status-indicator.success .dns-status-dot {
  background: var(--emerald-500);
  box-shadow: 0 0 8px var(--emerald-500);
  animation: none;
}

.dns-status-indicator.success {
  color: var(--emerald-600);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 640px) {
  .modal-overlay {
    padding: var(--space-sm);
    align-items: flex-end; /* Bottom sheet style on mobile */
  }

  .modal-container {
    max-height: 95vh;
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%); /* Slide up from bottom */
  }

  .modal-overlay.active .modal-container {
    transform: translateY(0);
  }

  .modal-header {
    padding: var(--space-md) var(--space-lg);
  }

  .modal-body {
    padding: var(--space-lg);
  }

  .modal-footer {
    padding: var(--space-md) var(--space-lg);
    justify-content: stretch;
  }
  
  .modal-footer .btn {
    width: 100%;
  }

  .ns-item-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .ns-info-group {
    gap: 2px;
  }

  .ns-copy-btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-sm);
  }
}