/* Stili custom oltre a Tailwind */
[x-cloak] { display: none !important; }
body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.helper { font-style: italic; color: #6e6e6e; }
.of-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Global Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sidebar items */
.of-side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 14px; margin: 0 8px;
  border-radius: 8px; font-size: 13px;
  cursor: pointer; color: #c4c4c8;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.of-side-item:hover { background: #2d2d33; color: #fff; }
.of-side-item.active { background: #E6007E; color: #fff; }
.of-side-item.danger { color: #f87171; }
.of-side-item.danger:hover { background: #2d2d33; color: #fca5a5; }
.of-side-item svg { width: 17px; height: 17px; flex-shrink: 0; }

/* Top navigation */
.of-topnav a {
  font-size: 13px; color: #6e6e6e;
  display: flex; align-items: center; height: 100%;
  border-bottom: 2px solid transparent; padding: 2px 0 0 0;
  text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.of-topnav a:hover { color: #1f1f1f; }
.of-topnav a.active { color: #1f1f1f; font-weight: 500; border-bottom-color: #E6007E; }

/* Sidebar collapsed — la larghezza è gestita inline in base.html (con transizione).
   IMPORTANTE: ogni regola "collapsed" deve coprire BOTH:
   - .of-side.collapsed         (Alpine runtime)
   - html.of-sidebar-collapsed .of-side  (pre-paint)
   altrimenti tra il primo paint e l'init di Alpine si vede uno scatto.
   Le icone svg restano a 17px in entrambi gli stati per evitare un
   resize percepito durante il toggle. */
.of-side.collapsed .of-side-item,
html.of-sidebar-collapsed .of-side .of-side-item {
  justify-content: center;
  padding: 8px 0;
  margin: 4px 8px;
}
.of-side.collapsed .of-side-section,
html.of-sidebar-collapsed .of-side .of-side-section {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}
.of-side.collapsed .w-8.h-8,
html.of-sidebar-collapsed .of-side .w-8.h-8 {
  margin: 0 auto; /* avatar profilo centrato */
}

/* Scrollbar gentile */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }

/* Custom Confirm Modal Transitions */
.custom-confirm-modal {
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-confirm-content {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Premium Visual & Interactive Tweaks */
.job-row {
  transition: background-color 0.15s ease;
}
.btn-premium {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-premium:hover {
  transform: translateY(-1px);
}
.btn-premium:active {
  transform: translateY(1px);
}

/* ============================================================
   UX SHARED — focus, skeleton, transizioni, stati
   ============================================================ */

/* Focus visibile per accessibilità (AA). Sostituisce l'outline browser
   con un ring rosa OF coerente col brand. Solo per :focus-visible
   (cioè quando l'utente naviga da tastiera). */
*:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid #E6007E;
  outline-offset: 2px;
  border-radius: 4px;
}
/* I campi form mostrano un ring + bordo rosa */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: #E6007E !important;
  box-shadow: 0 0 0 3px rgba(230,0,126,0.15);
}

/* Skeleton shimmer più premium del semplice animate-pulse */
@keyframes ofShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.of-skeleton {
  background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 50%, #eef0f3 100%);
  background-size: 200% 100%;
  animation: ofShimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

/* Empty state — illustrazione + testo coordinati */
.of-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 56px 24px; text-align: center;
}
.of-empty-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fefafc; color: #E6007E;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(230,0,126,0.06), 0 4px 16px -4px rgba(230,0,126,0.12);
}
.of-empty-title {
  font-size: 14px; font-weight: 500; color: #1f1f1f;
  margin-bottom: 4px;
}
.of-empty-desc {
  font-size: 12px; color: #6e6e6e;
  max-width: 360px; line-height: 1.5;
}

/* Card più "interattive" — hover lift sottile */
.of-card-hover {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.18s ease;
}
.of-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 12px 32px -8px rgba(0,0,0,0.08);
}

/* Table — sticky header, smooth row hover */
.of-table thead th {
  position: sticky; top: 0;
  background: #f9fafb;
  z-index: 1;
}
.of-table tbody tr {
  transition: background-color 0.12s ease;
}

/* Chip filters — affordance migliore */
.of-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid #ececec;
  border-radius: 9999px;
  font-size: 11px;
  background: #fff;
  color: #6e6e6e;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.of-chip:hover {
  background: #f5f5f7;
  color: #1f1f1f;
}
.of-chip.is-active {
  background: #fce7f3;
  border-color: #E6007E;
  color: #E6007E;
  font-weight: 500;
}

/* Input con icona e clear button */
.of-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.of-search input {
  padding-left: 32px;
  padding-right: 30px;
}
.of-search-icon {
  position: absolute; left: 10px;
  color: #9ca3af;
  pointer-events: none;
}
.of-search-clear {
  position: absolute; right: 8px;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #9ca3af;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.of-search-clear:hover {
  background: #f5f5f7;
  color: #1f1f1f;
}

/* Bottone primario / secondario riusabile (per coerenza) */
.of-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: #E6007E; color: #fff;
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  box-shadow: 0 1px 3px rgba(230,0,126,0.25);
  transition: background 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  border: 0;
}
.of-btn-primary:hover {
  background: #C70069;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(230,0,126,0.35);
}
.of-btn-primary:active { transform: translateY(0); }
.of-btn-primary:disabled,
.of-btn-primary[aria-disabled="true"] {
  background: #d4d4d8; color: #fff;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.of-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: #1f1f1f;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  border: 1px solid #ececec;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}
.of-btn-secondary:hover {
  background: #f5f5f7;
  border-color: #d4d4d8;
}

/* Sticky table header dentro container scrollabile */
.of-table-wrap {
  position: relative;
  overflow: auto;
}

/* KPI card — micro-interazione su hover */
.of-kpi {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.18s ease;
}
.of-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 12px 32px -8px rgba(0,0,0,0.08);
}

/* aria-live regions: nascoste visivamente ma lette dagli screen reader */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Riduce le animazioni se l'utente lo preferisce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

