/* =======================================================================
 * App Notifications: Modern Lightweight Toast & Modal Cards (Offline-First)
 * File: public/assets/css/app-notifications.css
 * ======================================================================= */

/* --- Toast Container --- */
.app-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 32px);
  pointer-events: none;
}

@media (max-width: 640px) {
  .app-toast-container {
    top: 12px;
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* --- Toast Card --- */
.app-toast-card {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f8fafc;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  animation: appToastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
  overflow: hidden;
  position: relative;
}

.app-toast-card.is-leaving {
  animation: appToastSlideOut 0.25s ease forwards;
}

@keyframes appToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes appToastSlideOut {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
}

/* Toast Card Types */
.app-toast-card.toast-success {
  border-left: 4px solid #10b981;
}
.app-toast-card.toast-error {
  border-left: 4px solid #ef4444;
}
.app-toast-card.toast-warning {
  border-left: 4px solid #f59e0b;
}
.app-toast-card.toast-info {
  border-left: 4px solid #3b82f6;
}

.app-toast-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.app-toast-body {
  flex: 1;
  min-width: 0;
}

.app-toast-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.app-toast-message {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}

.app-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.app-toast-close:hover {
  color: #ffffff;
}

/* Toast Progress Bar */
.app-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  width: 100%;
  animation: appToastProgress linear forwards;
}

@keyframes appToastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- Modal Overlay & Card --- */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: appModalFadeIn 0.2s ease-out forwards;
}

@keyframes appModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.app-modal-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  animation: appModalCardIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  text-align: center;
}

@keyframes appModalCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-modal-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.app-modal-icon.icon-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 2px solid rgba(245, 158, 11, 0.3);
}
.app-modal-icon.icon-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 2px solid rgba(239, 68, 68, 0.3);
}
.app-modal-icon.icon-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 2px solid rgba(16, 185, 129, 0.3);
}
.app-modal-icon.icon-question {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.app-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.app-modal-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 20px;
}

.app-modal-input-wrap {
  margin-bottom: 20px;
  text-align: left;
}

.app-modal-input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.app-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 10px;
  color: #f8fafc;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.app-modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.app-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.app-modal-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.app-modal-btn-cancel {
  background: #334155;
  color: #cbd5e1;
}
.app-modal-btn-cancel:hover {
  background: #475569;
  color: #ffffff;
}

.app-modal-btn-confirm {
  background: #2563eb;
  color: #ffffff;
}
.app-modal-btn-confirm:hover {
  background: #1d4ed8;
}

.app-modal-btn-danger {
  background: #dc2626;
  color: #ffffff;
}
.app-modal-btn-danger:hover {
  background: #b91c1c;
}
