/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
body, html { margin: 0; padding: 0; }

/* ===== Loading Spinner Overlay ===== */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.spinner-overlay.active {
  display: flex;
}

.spinner-overlay .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-overlay .spinner-text {
  color: #fff;
  font-size: 18px;
  margin-top: 16px;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.3s ease;
  max-width: 360px;
}

.toast.success { background: #2e7d32; }
.toast.error { background: #c62828; }
.toast.info { background: #1565c0; }

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}

/* ===== Custom Modal Dialogs ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

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

.modal-box {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-message {
  color: #e5e5e5;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  background: #111;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus { border-color: #FFC627; }

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

.modal-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-btn-cancel {
  background: #333;
  color: #aaa;
}
.modal-btn-cancel:hover { background: #444; color: #fff; }

.modal-btn-confirm {
  background: #FFC627;
  color: #8C1D40;
}
.modal-btn-confirm:hover { filter: brightness(1.1); }

.modal-btn-danger {
  background: #dc2626;
  color: #fff;
}
.modal-btn-danger:hover { background: #ef4444; }