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

@tailwind base;
@tailwind components;
@tailwind utilities;

/* iOS Touch Support - Mejorar interacción táctil en dispositivos iOS */
button,
a[role="button"],
[data-action*="click"],
[type="button"],
[type="submit"] {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
  cursor: pointer;
  touch-action: manipulation;
  /* Prevenir zoom al hacer doble tap en iOS */
  -webkit-user-select: none;
  user-select: none;
}

/* Asegurar que los botones sean clickeables en iOS */
button:not(:disabled),
a[role="button"]:not([aria-disabled="true"]),
[data-action*="click"]:not([aria-disabled="true"]) {
  pointer-events: auto !important;
}

/* Eliminar estilos hover en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  button:hover,
  a[role="button"]:hover,
  [data-action*="click"]:hover {
    /* Mantener el estilo base, no el hover */
    background-color: inherit;
  }
  
  /* Mejorar el feedback visual en tap para iOS */
  button:active,
  a[role="button"]:active,
  [data-action*="click"]:active {
    opacity: 0.8;
    transform: scale(0.98);
    transition: all 0.1s ease-in-out;
  }
}

/* Tooltip solo en desktop (hover: hover, pointer: fine) */
@media (hover: hover) and (pointer: fine) {
  .tooltip-parent[data-tooltip] {
    position: relative;
  }
  .tooltip-parent[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
    background: #222;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  }
  .tooltip-parent[data-tooltip]:hover::after,
  .tooltip-parent[data-tooltip]:focus::after {
    opacity: 1;
  }
}
