/*itsrlabs/apps/platform/static/css/_shared/flash_messages.css*/
/* static/css/_shared/flash_messages.css */

/* ================================
   FLASH MESSAGE ZONE (below header, no layout shift)
   ================================ */

.flash-messages-zone {
  position: fixed;
  top: 6rem; /* just below pill header */
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 1rem 0;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 11060;
  pointer-events: none; /* clicks pass through when no messages */
}

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

/* In-flow below header (inside .flash-messages-zone): no min, expand up to 375px */
.flash-messages-zone .flash-messages-container {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  min-width: 0;
  width: max-content;
  max-width: 375px;
  margin: 0 auto; /* centered within full-width zone */
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  box-sizing: border-box;
}

/* Legacy: fixed top-right when not in zone (e.g. older partials) */
.flash-messages-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 11060;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  pointer-events: none;
}

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

.itsr-flash {  
  pointer-events: auto; 
  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;
  text-align: center;
  white-space: pre-line; /* newlines in message text create line breaks */
}

/* ================================
   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: zone and containers full-width with padding */
@media (max-width: 768px) {
  .flash-messages-zone {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .flash-messages-zone .flash-messages-container {
    max-width: none;
  }
}

/* Legacy fixed container (when not in zone) */
@media (max-width: 768px) {
  .flash-messages-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
    max-width: none;
  }
}
