/* ==========================================
   POPUP SYSTEM - Complete CSS
   Toast + Confirm Modal + All Messages
   ========================================== */

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: 100%;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-item.success {
  background: rgba(220, 252, 231, 0.95);
  color: #166534;
  border-color: #bbf7d0;
}
.toast-item.success .toast-icon { color: #22c55e; }

.toast-item.error {
  background: rgba(254, 226, 226, 0.95);
  color: #991b1b;
  border-color: #fecaca;
}
.toast-item.error .toast-icon { color: #dc2626; }

.toast-item.warning {
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
  border-color: #fde68a;
}
.toast-item.warning .toast-icon { color: #f59e0b; }

.toast-item.info {
  background: rgba(219, 234, 254, 0.95);
  color: #1e40af;
  border-color: #bfdbfe;
}
.toast-item.info .toast-icon { color: #3b82f6; }

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.toast-content {
  flex: 1;
  line-height: 1.4;
}
.toast-content .toast-title {
  font-weight: 700;
  font-size: 0.85rem;
}
.toast-content .toast-message {
  font-weight: 500;
  font-size: 0.85rem;
  opacity: 0.9;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: 0.2s;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; transform: rotate(90deg); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  transition: width 0.1s linear;
  opacity: 0.3;
}
.toast-progress.success { background: #22c55e; }
.toast-progress.error { background: #dc2626; }
.toast-progress.warning { background: #f59e0b; }
.toast-progress.info { background: #3b82f6; }

@media (max-width: 480px) {
  .toast-container { top: 16px; right: 16px; left: 16px; max-width: none; }
  .toast-item { padding: 12px 14px; font-size: 0.82rem; border-radius: 12px; }
  .toast-icon { font-size: 1.1rem; width: 24px; }
}

/* ==========================================
   CONFIRM MODAL
   ========================================== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 20px;
  animation: confirmFadeIn 0.25s ease;
}
.confirm-overlay.active { display: flex; }

@keyframes confirmFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(10px); }
}

.confirm-box {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 400px;
  width: 100%;
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: confirmSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes confirmSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.confirm-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: none;
  font-size: 1rem;
  color: #1f2a3a;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-close:hover { background: #d93025; color: white; transform: rotate(90deg) scale(1.05); }

.confirm-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  animation: confirmIconBounce 0.5s ease;
}
@keyframes confirmIconBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.confirm-icon.danger { color: #dc2626; }
.confirm-icon.warning { color: #f59e0b; }
.confirm-icon.success { color: #22c55e; }
.confirm-icon.info { color: #3b82f6; }

.confirm-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #0b1a2e;
}

.confirm-message {
  color: #5f6b7a;
  font-size: 0.9rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
}

.confirm-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.confirm-btn-cancel {
  background: #f1f4f8;
  color: #1f2a3a;
  border: 1px solid #d0d7e2;
}
.confirm-btn-cancel:hover { background: #e5e8ed; transform: translateY(-2px); }

.confirm-btn-confirm {
  background: #d93025;
  color: white;
  box-shadow: 0 4px 14px rgba(217, 48, 37, 0.25);
}
.confirm-btn-confirm:hover { background: #b71c1c; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(217, 48, 37, 0.35); }

.confirm-btn-confirm.danger { background: #dc2626; }
.confirm-btn-confirm.danger:hover { background: #b91c1c; }

.confirm-btn-confirm.success { background: #22c55e; }
.confirm-btn-confirm.success:hover { background: #16a34a; }

.confirm-btn-confirm.warning { background: #f59e0b; }
.confirm-btn-confirm.warning:hover { background: #d97706; }

.confirm-btn-confirm.info { background: #3b82f6; }
.confirm-btn-confirm.info:hover { background: #2563eb; }

@media (max-width: 480px) {
  .confirm-box { padding: 22px 18px; border-radius: 20px; }
  .confirm-title { font-size: 1.1rem; }
  .confirm-message { font-size: 0.85rem; }
  .confirm-buttons { flex-direction: column; }
  .confirm-btn { padding: 13px; }
  .confirm-icon { font-size: 2.5rem; }
}