/* =========================================
   public/src/components/notifications/notifications.css
   Unified Notification System
  Logic in notifications.js
   ========================================= */

/* =========================
   Container Configuration
   ========================= */
#notification-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  z-index: var(--z-notification);
  pointer-events: none;
}

/* =========================
     Glass Notification Base
     ========================= */
.notification.glass-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 16px;
  min-width: 320px;
  max-width: 400px;
  color: #333;
  animation: toastSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  transition: all 0.3s ease;
}

/* =========================
     Inner Content Styling
     ========================= */
.notification-content {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.notification-icon {
  font-size: 2rem;
  line-height: 1;
}

.notification-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

/* Typography */
.notification-content div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.notification-content strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.notification-content p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* =========================
     Close Button
     ========================= */
.close-btn-notification {
  position: absolute;
  top: -8px;
  right: -8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s,
    background 0.2s;
  padding: 0;
}

.close-btn-notification:hover {
  transform: scale(1.1);
  background: #fff;
}

/* =========================
     Type-Specific Accents
     (Optional: Adds subtle border color)
     ========================= */
.notification.success {
  border-left: 4px solid #4caf50;
}

.notification.error {
  border-left: 4px solid #f44336;
}

.notification.warning {
  border-left: 4px solid #ff9800;
}

.notification.info {
  border-left: 4px solid #2196f3;
}

/* =========================
     Animations
     ========================= */
@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

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

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* =========================
     Responsive (Mobile)
     ========================= */
@media (max-width: 480px) {
  #notification-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    /* Constrain container to viewport width */
  }

  .notification.glass-toast {
    min-width: 0;
    /* Let the toast shrink instead of forcing 320px */
    max-width: 100%;
    /* Never exceed the container/viewport */
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
  }

  .notification-content {
    gap: 12px;
  }

  .notification-image {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  .notification-icon {
    font-size: 1.6rem;
  }

  .notification-content strong,
  .notification-content p {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* ===========================
     Confirmation Modal Styles
     =========================== */

.confirmation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-top);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.confirmation-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.confirmation-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirmation-modal.show {
  transform: scale(1);
  opacity: 1;
}

.confirmation-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.confirmation-message {
  font-size: 1.1rem;
  color: var(--color-text-primary);
  text-align: center;
  line-height: 1.5;
  margin: 0;
  white-space: pre-line;
}

.prompt-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.prompt-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.confirmation-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirmation-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.confirmation-btn.confirm {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.confirmation-btn.confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.confirmation-btn.confirm:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Disabled state for the typed-confirmation step's confirm button (see
   _confirmTyped in notifications.js) — stays disabled until the typed text
   exactly matches the required phrase, so it needs a visibly "not usable
   yet" look distinct from its normal enabled gradient, with no hover/focus
   affordances that would suggest it's clickable. */
.confirmation-btn.confirm:disabled {
  background: var(--color-background-secondary);
  color: var(--color-text-tertiary, var(--color-text-secondary));
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

.confirmation-btn.confirm:disabled:hover {
  filter: none;
  transform: none;
  box-shadow: none;
}

.confirmation-btn.cancel {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.confirmation-btn.cancel:hover {
  background: var(--color-background-secondary);
}

/* Dark Mode specific overrides if needed (though vars handle most) */
[data-theme="dark-slate"] .confirmation-overlay,
[data-theme="dark"] .confirmation-overlay {
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .notification.glass-toast {
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

[data-theme="dark-slate"] .notification.glass-toast {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

[data-theme="dark"] .close-btn-notification {
  background: rgba(50, 50, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

[data-theme="dark-slate"] .close-btn-notification {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ===========================
     Typed-Confirmation Modal (double verification)
     Second step of _confirmTyped() in notifications.js — shows the exact
     phrase the user must retype, styled as a distinct, monospaced "chip"
     so it visually reads as literal text to copy/match rather than as part
     of the sentence above it (same idea as GitHub's repo-name confirmation
     chip on its delete-repo dialog).
     =========================== */

.typed-confirmation-phrase {
  margin: -8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-background-secondary);
  border: 1px dashed var(--color-border);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-error, #dc2626);
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
}