/* Prevent horizontal overflow globally */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Tailwind-style custom animations and utilities (used with Tailwind CDN) */
@layer utilities {
  .animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
  }
  .animate-slide-up {
    animation: slideUp 0.45s ease-out forwards;
  }
  .animate-scale-in {
    animation: scaleIn 0.35s ease-out forwards;
  }
  .transition-smooth {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger children animation delay */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* Form focus ring (Tailwind-compatible) */
input:focus, button:focus, select:focus, textarea:focus, a:focus-visible {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
}

/* Table row hover for Tailwind tables */
.table-row-hover:hover {
  background-color: rgb(248 250 252);
}

/* Bootstrap modal compatibility (no Bootstrap CSS loaded – required for data-bs-toggle="modal") */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
.modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}
.modal.fade {
  transition: opacity 0.15s linear;
}
.modal.fade .modal-dialog {
  transition: transform 0.15s ease-out;
}
.modal.fade:not(.show) {
  opacity: 0;
}
.modal.fade:not(.show) .modal-dialog {
  transform: scale(0.95);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: #000;
  opacity: 0;
  transition: opacity 0.15s linear;
}
.modal-backdrop.show {
  opacity: 0.5;
}
.modal-dialog {
  position: relative;
  width: 100%;
  margin: 0.5rem;
  max-width: 500px;
  pointer-events: none;
}
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}
.modal-dialog-centered .modal-dialog {
  margin: 1.75rem auto;
}
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}
.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid rgb(229 231 235);
}
.modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  color: rgb(30 41 59);
}
.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem 1rem;
}
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgb(229 231 235);
  background-color: rgb(248 250 252);
  border-radius: 0 0 0.5rem 0.5rem;
}
.modal-lg {
  max-width: 800px;
}
.modal.show .modal-dialog {
  margin: 0 auto;
}
body.modal-open {
  overflow: hidden;
}
body.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Bootstrap .btn-close used in modals (no Bootstrap CSS) */
.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: #000;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: 0.25rem;
  opacity: 0.6;
  cursor: pointer;
}
.btn-close:hover {
  opacity: 1;
}

/* Form/button styles only inside modals (Bootstrap class names) */
.modal .form-label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 500; color: rgb(51 65 85); }
.modal .form-control, .modal .form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: rgb(30 41 59);
  background-color: #fff;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.375rem;
}
.modal .form-control:focus, .modal .form-select:focus {
  border-color: rgb(59 130 246);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.2);
}
.modal textarea.form-control { min-height: 80px; resize: vertical; }
.modal .mb-3 { margin-bottom: 1rem; }
.modal .text-muted { color: rgb(100 116 139); font-size: 0.875rem; }
.modal .text-danger { color: rgb(220 38 38); }
.modal .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
}
.modal .btn-primary { color: #fff; background-color: rgb(37 99 235); border-color: rgb(37 99 235); }
.modal .btn-primary:hover { background-color: rgb(29 78 216); border-color: rgb(29 78 216); }
.modal .btn-secondary { color: rgb(51 65 85); background-color: #fff; border-color: rgb(203 213 225); }
.modal .btn-secondary:hover { background-color: rgb(248 250 252); }
.modal .btn-warning { color: #000; background-color: rgb(245 158 11); border-color: rgb(245 158 11); }
.modal .btn-warning:hover { background-color: rgb(217 119 6); border-color: rgb(217 119 6); }
.modal .alert { padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.375rem; }
.modal .alert-info { color: rgb(30 58 138); background-color: rgb(219 234 254); border-color: rgb(191 219 254); }
.modal .alert small { font-size: 0.875rem; }

.table-dark th {
  color: black !important;
}

/* .page-dark { background: #050915; color: #f8fafc; font-weight: 300; } */
