/* Custom styles for Unfold admin interface */

/* Specific Unfold overrides */
/* .\@container {
  padding-inline: 0 !important;
  padding-bottom: 0 !important;
}

div#content {
  margin-inline: 0 !important;
  max-width: 100%;
} */

/* div#main > div:first-child {
  padding: 0;
  margin: 0;
} */

nav.absolute {
    position: absolute;
    bottom: 80px;
}

/* Utility classes that replace Tailwind functionality */
.d-flex {
  display: flex;
}
.flex-column {
  flex-direction: column;
}
.flex-grow-1 {
  flex-grow: 1;
}
.justify-content-between {
  justify-content: space-between;
}
.justify-content-center {
  justify-content: center;
}
.align-items-center {
  align-items: center;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.text-muted {
  color: #6c757d;
}
.fw-bold {
  font-weight: bold;
}
.fw-semibold {
  font-weight: 600;
}

/* Spacing utilities */
.p-3 {
  padding: 1rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-4 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.mb-3 {
  margin-bottom: 1rem;
}
.me-2 {
  margin-right: 0.5rem;
}
.ms-2 {
  margin-left: 0.5rem;
}
.mx-2 {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}
.mt-2 {
  margin-top: 0.5rem;
}

/* Border utilities */
.border-top {
  border-top: 1px solid #dee2e6;
}

/* Background utilities */
.bg-light {
  background-color: #f8f9fa;
}

/* Button utilities */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

.btn-outline-primary {
  color: #0d6efd;
  border-color: #0d6efd;
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-danger {
  color: #dc3545;
  border-color: #dc3545;
}

.btn-outline-danger:hover {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Badge utilities */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.badge-success {
  background-color: #198754;
}
.badge-danger {
  background-color: #dc3545;
}
.badge-warning {
  background-color: #ffc107;
  color: #000;
}
.badge-info {
  background-color: #0dcaf0;
  color: #000;
}
.badge-secondary {
  background-color: #6c757d;
}

/* Text color utilities */
.text-success {
  color: #198754;
}
.text-danger {
  color: #dc3545;
}
.text-primary {
  color: #0d6efd;
}

/* Font utilities */
.font-mono {
  font-family: "Courier New", Courier, monospace;
}

/* Spinner utilities */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.125em;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

/* Visibility utilities */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Card utilities */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.375rem;
}

.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

/* Alert utilities */
.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

/* Table utilities */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #212529;
  vertical-align: top;
  border-color: #dee2e6;
}

.table > :not(caption) > * > * {
  padding: 0.5rem 0.5rem;
  background-color: var(--bs-table-bg);
  border-bottom-width: 1px;
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  --bs-table-accent-bg: rgba(0, 0, 0, 0.05);
  color: var(--bs-table-color);
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  --bs-table-accent-bg: rgba(0, 0, 0, 0.075);
  color: var(--bs-table-color);
}

.table-sm > :not(caption) > * > * {
  padding: 0.25rem 0.5rem;
}

/* Text truncation */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive utilities */
@media (min-width: 768px) {
  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

/* Custom pagination styles */
.pagination-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  min-height: 60px;
}

.pagination-info {
  font-size: 0.875rem;
  color: #6c757d;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Ensure table container takes full height */
.results {
  flex: 1;
  overflow-y: auto;
}

/* Sticky table header */
.table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: #f8f9fa;
}

/* Row styling based on balanced status */
tr[data-balanced="true"] {
  background-color: #d4edda;
  border-left: 3px solid #28a745;
}

tr[data-balanced="false"] {
  background-color: #f8d7da;
  border-left: 3px solid #dc3545;
}

tr[data-balanced="true"]:hover {
  background-color: #c3e6cb;
}

tr[data-balanced="false"]:hover {
  background-color: #f5c6cb;
}
