/*
 * 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.
 */

/*@import './railsblocks_phlex.css';
@import './tw-animate.css'; */
/* @import './markdown.css'; - Removed: Propshaft doesn't support @import */
/* Note: All CSS files are included directly in application.html.erb via stylesheet_link_tag */

/* Thinking indicator animation for AI chat */
@keyframes thinking-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.thinking-dot {
  animation: thinking-bounce 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(1) { animation-delay: 0s; }
.thinking-dot:nth-child(2) { animation-delay: 0.16s; }
.thinking-dot:nth-child(3) { animation-delay: 0.32s; }

/* PDF.js text layer */
.text-layer {
  opacity: 0.25;
  line-height: 1.0;
  pointer-events: all;
}

.text-layer span {
  position: absolute;
  white-space: pre;
  color: transparent;
  pointer-events: all;
  cursor: text;
}

.text-layer span::selection {
  background: rgba(0, 0, 255, 0.3);
}

/* Mobile apps (mobile/CONTRACT.md): when the native app draws a control for a
   bridge component, hide the web version. The bridge sets
   data-bridge-components on <html> with the components the app supports. */
[data-bridge-components~="form"] [data-bridge--form-target~="submit"] {
  display: none;
}

/* The inverse: "Escanear documento" exists only in the apps that support the
   `scanner` component (never on the web, nor in older app builds). */
.bridge-scanner {
  display: none;
}
[data-bridge-components~="scanner"] .bridge-scanner {
  display: block;
}
/* Same for "Escribir en etiqueta NFC" on Mi tarjeta (Android app, `nfc-card`). */
.bridge-nfc-card {
  display: none;
}
[data-bridge-components~="nfc-card"] .bridge-nfc-card {
  display: block;
}

/* "Iniciar cronómetro" (case page): only in apps that support `time-tracker`. */
.bridge-time-tracker {
  display: none;
}
[data-bridge-components~="time-tracker"] .bridge-time-tracker {
  display: contents;
}

/* Same for "Nota de voz" (`voice-note`). */
.bridge-voice-note {
  display: none;
}
[data-bridge-components~="voice-note"] .bridge-voice-note {
  display: block;
}

/* "Firmar o anotar" (`pdf-sign`, iOS app only today). */
.bridge-pdf-sign {
  display: none;
}
[data-bridge-components~="pdf-sign"] .bridge-pdf-sign {
  display: block;
}
[data-bridge-components~="pdf-sign"] .bridge-pdf-sign--compact {
  display: inline-flex;
}

/* "Escanear radicado" (`radicado-scan`). */
.bridge-radicado-scan {
  display: none;
}
[data-bridge-components~="radicado-scan"] .bridge-radicado-scan {
  display: block;
}

/* Same for the native "Continuar con Apple" (iOS `apple-sign-in` component). */
.bridge-apple-sign-in {
  display: none;
}
[data-bridge-components~="apple-sign-in"] .bridge-apple-sign-in {
  display: block;
}

/* Phones: inputs under 16px make iOS zoom the page on focus. */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="image"]),
  select,
  textarea {
    font-size: max(16px, 1em);
  }
}

/* Inside the mobile apps (body.native-app, set by the layout). */
.native-app {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no double-tap zoom */
}
.native-app a,
.native-app button {
  -webkit-touch-callout: none;
}
