/* ===== GLOBAL RESET ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;

  display: flex;
  flex-direction: column;
  height: 100vh; /* ✅ IMPORTANT */
}

/* ===== SHARED LAYOUT ===== */
.app-header {
  background: #202c33;
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
}

.app-header .right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-footer {
  background: #202c33;
  color: white;
  text-align: center;
  padding: 6px;
  font-size: 12px;
}

/* Pages take remaining space */
.home-wrapper,
.chat-wrapper {
  flex: 1;
  min-height: 0; /* ✅ CRITICAL for scroll layouts */
}

/* ===== HOME PAGE ONLY ===== */
.home-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.upload-card h2 {
  margin-bottom: 10px;
  color: #202c33;
}

.upload-card p {
  color: #667781;
  margin-bottom: 20px;
}

.upload-card button {
  background: #00a884;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.upload-card.dragover {
  border: 2px dashed #00a884;
  background: #f0fdf9;
}

/* ==========================
   TOASTS
========================== */

#toastContainer {
  position: fixed;
  top: 70px;
  right: 20px;

  z-index: 9999;

  display: flex;
  flex-direction: column;
  gap: 10px;

  pointer-events: none;
}

.toast {
  min-width: 240px;

  background: #202c33;
  color: #fff;

  padding: 12px 16px;

  border-radius: 10px;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);

  transform: translateX(120%);

  opacity: 0;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid #25d366;
}

.toast-info {
  border-left: 4px solid #0dcaf0;
}

.toast-warning {
  border-left: 4px solid #ffc107;
}

.toast-error {
  border-left: 4px solid #dc3545;
}

.toast-alert {
  border-left: 4px solid #6c757d;
}



/* ==========================
   IMPORT OVERLAY
========================== */

#importOverlay[hidden] {
  display: none !important;
}

#importOverlay {
  position: fixed;
  inset: 0;

  background: rgba(11,20,26,.85);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 99999;
}

.import-box {
  width: min(420px,90vw);

  background: #202c33;

  color: white;

  border-radius: 16px;

  padding: 30px;

  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;

  margin: 0 auto 20px;

  border: 4px solid rgba(255,255,255,.15);
  border-top: 4px solid #00a884;

  border-radius: 50%;

  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-wrap {
  height: 8px;

  background: #111b21;

  border-radius: 999px;

  overflow: hidden;

  margin: 20px 0;
}

#progressFill {
  width: 35%;

  background: linear-gradient(
    90deg,
    #00a884,
    #25d366,
    #00a884
  );

  background-size: 200% 100%;

  animation: loadingBar 1s linear infinite;
}

@keyframes loadingBar {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

#progressText {
  color: #00a884;
  font-size: 14px;
  font-weight: 600;
}