/* static/css/_shared/flash_messages.css */

/* ================================
   FLASH MESSAGE CONTAINER
   ================================ */

/* Position: classic top-right stack */
.flash-messages-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
  pointer-events: none; /* children will re-enable */
}

/* ================================
   BASE ALERT CARD
   ================================ */

.itsr-flash {
  pointer-events: auto; /* clickable inside the container */
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  padding: 0.65rem 0.85rem;
  color: #111827;
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

/* Layout: message + close button */
.itsr-flash-inner {
  display: flex;
  align-items: center; /* true vertical centering */
  gap: 0.75rem;
}

/* No icon in classic style */
.itsr-flash-icon {
  display: none;
}

/* Main text block */
.itsr-flash-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.itsr-flash-message {
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ================================
   CLOSE BUTTON (BASE STYLE)
   ================================ */

/* Base class for the close button */
.itsr-flash-close {
  cursor: pointer;
  width: 18px;
  height: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0.65;
  transition: opacity 0.15s ease-out;
}

.itsr-flash-close:hover {
  opacity: 1;
}

/* × glyph for non-Bootstrap cases (kept for completeness) */
.itsr-flash-close::before {
  content: "×";
  font-size: 18px;
  line-height: 1; /* vertical consistency */
  display: block;
}

/* ==========================================
   HARD OVERRIDE FOR BOOTSTRAP .btn-close
   ========================================== */

/* When used as: <button class="btn-close itsr-flash-close"> */
button.btn-close.itsr-flash-close {
  /* Completely wipe Bootstrap's defaults */
  all: unset !important;
  box-sizing: border-box !important;
  padding: 0 !important;

  cursor: pointer;

  width: 18px;
  height: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0.65;
  transition: opacity 0.15s ease-out;
}

button.btn-close.itsr-flash-close:hover {
  opacity: 1;
}

button.btn-close.itsr-flash-close::before {
  content: "×";
  font-size: 18px;
  line-height: 1;
  display: block;
}

/* ================================
   VARIANTS
   ================================ */

/* SUCCESS */
.itsr-flash-success {
  background-color: #ecfdf3;
  border-color: #4ade80;
  color: #166534;
}

/* INFO / SECONDARY */
.itsr-flash-info,
.itsr-flash-secondary {
  background-color: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

/* WARNING */
.itsr-flash-warning {
  background-color: #fffbeb;
  border-color: #facc15;
  color: #92400e;
}

/* DANGER */
.itsr-flash-danger {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* CUSTOM */
.itsr-flash-dev {
  background-color: #f0f9ff;
  border-color: #1b96ca;
  color: #02476d;
}

/* ================================
   ANIMATION
   ================================ */

.itsr-flash.fade {
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out;
}

.itsr-flash.show {
  opacity: 1;
  transform: translateY(0);
}

/* ================================
   RESPONSIVE
   ================================ */

/* Mobile: full-width top block */
@media (max-width: 768px) {
  .flash-messages-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
    max-width: none;
  }
}
