/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 *
 */

/* iOS Safari zoom prevention - only on touch devices */
@media (pointer: coarse) {
  input,
  textarea {
    font-size: 16px;
  }
}

[x-cloak] {
  display: none !important;
}

.nl2br {
  white-space: pre-line;
}

/* Safe area padding for mobile navigation bars */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Message highlight for jump-to navigation */
.message-highlight {
  animation: highlight-fade 2s ease-out forwards;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

@media (min-width: 640px) {
  .message-highlight {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@keyframes highlight-fade {
  0% {
    background-color: color-mix(in oklch, var(--color-primary) 15%, transparent);
  }
  80% {
    background-color: color-mix(in oklch, var(--color-primary) 15%, transparent);
  }
  100% {
    background-color: transparent;
  }
}

/* Reusable highlight animation utility */
.animate-highlight-fade {
  animation: highlight-fade 3s ease-out forwards;
  border-radius: 0.5rem;
}

/* Offering reveal: full blur veil fades out after streaming completes */
@keyframes offering-reveal {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.animate-offering-reveal {
  animation: offering-reveal 700ms ease-out 200ms forwards;
}

/* Hide messages until JS resolves chat direction (chat-start/chat-end) to prevent layout shift.
   Only applies during initial load; removed by JS after processing so broadcast messages are unaffected. */
[data-direction-pending] [data-message-id] .chat {
  opacity: 0;
}
