@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.btn-loading {
  position: relative !important;
  color: transparent !important;
  pointer-events: none !important;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  top: calc(50% - 0.625rem);
  left: calc(50% - 0.625rem);
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-text-long {
  display: inline;
}

@media (max-width: 768px) {
  .btn-text-long {
    display: none !important;
  }
  
  .btn-with-long-text {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    gap: 0 !important;
  }
}


.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 85vh;
  -webkit-overflow-scrolling: touch;
}

.overflow-x-auto:has(> table) {
  overflow-y: auto;
  max-height: 65vh;
}

.table-responsive thead th,
.overflow-x-auto:has(> table) thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8fafc;
}


.table-responsive table {
  min-width: 600px; /* Force minimum width to enable scrolling */
}

@media (max-width: 768px) {
  .table-responsive table {
    min-width: 500px;
  }
}

/* Nome do utilizador no header: visível em desktop, oculto em mobile */
[data-user-role] {
  display: inline;
}

@media (max-width: 767px) {
  [data-user-role] {
    display: none;
    background-color: #960606;
  }
}
