/* ============================================
   Nazari - Custom styles (Tailwind + DaisyUI)
   Only styles that can't be done with utility classes
   ============================================ */

/* --- DaisyUI theme override --- */
[data-theme="light"] {
  --p: 0 74% 41%; /* #B22234 in oklch-ish — we override via CSS below */
}

/* --- Hidden utility --- */
.hidden {
  display: none !important;
}

/* --- Login animation --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* --- Loading state on buttons --- */
.loading-custom {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.loading-custom::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* --- Hours badge --- */
.hours-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.8125rem;
}

/* --- Obs text truncate --- */
.obs-text {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9ca3af;
  font-size: 0.8125rem;
  display: inline-block;
}

/* --- Delete button --- */
.btn-delete {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.btn-delete .material-icons-outlined {
  font-size: 18px;
}

/* --- Toast notifications --- */
.toast-notification {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
  animation: toastIn 0.3s ease-out;
  min-width: 280px;
  max-width: 400px;
}

.toast-notification.toast-success {
  border-left: 4px solid #27ae60;
}

.toast-notification.toast-error {
  border-left: 4px solid #e74c3c;
}

.toast-notification.toast-success .material-icons-outlined {
  color: #27ae60;
}

.toast-notification.toast-error .material-icons-outlined {
  color: #e74c3c;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* --- Mobile: hide obs column --- */
@media (max-width: 639px) {
  .obs-column {
    display: none;
  }

  .toast-notification {
    min-width: auto;
    max-width: none;
  }
}

/* --- Print --- */
@media print {
  header,
  form,
  .btn-delete,
  #toast-container {
    display: none !important;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .obs-column {
    display: table-cell;
  }
}
