/* Monitor Grid Enhancements */

/* Status pulse animation */
@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--tblr-success-rgb), 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(var(--tblr-success-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--tblr-success-rgb), 0);
  }
}

/* Hover effects for table rows - Dark theme compatible */
.hover-bg:hover {
  background-color: var(--tblr-bg-surface-secondary) !important;
  transition: background-color 0.15s ease-in-out;
}

/* Enhanced card styling */
.card.border-0.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(var(--tblr-body-color-rgb), 0.075) !important;
  border: 1px solid var(--tblr-border-color-translucent) !important;
}

/* Mobile card enhancements */
@media (max-width: 991.98px) {
  .card .card-body {
    padding: 1rem;
  }

  .card .card-title {
    font-size: 1rem;
    font-weight: 600;
  }

  .row.g-2 > * {
    margin-bottom: 0.5rem;
  }
}

/* Status badge enhancements */
.badge {
  font-weight: 500;
  letter-spacing: 0.025em;
}

.badge.badge-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Progress bar enhancements */
.progress {
  background-color: var(--tblr-gray-200);
  border-radius: 3px;
}

.progress .progress-bar {
  border-radius: 3px;
}

/* Button enhancements */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-list .btn {
  margin-right: 0.5rem;
}

.btn-list .btn:last-child {
  margin-right: 0;
}

/* Dropdown enhancements */
.dropdown-menu {
  border: 1px solid var(--tblr-border-color);
  box-shadow: 0 0.5rem 1rem rgba(var(--tblr-body-color-rgb), 0.15);
  border-radius: 0.375rem;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

.dropdown-item:hover {
  background-color: var(--tblr-bg-surface-secondary);
}

.dropdown-item.disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Search input enhancements */
.input-icon .input-icon-addon {
  color: var(--tblr-gray-600);
}

.input-icon .form-control {
  padding-left: 2.5rem;
}

.input-icon .form-control:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 0.125rem rgba(var(--tblr-primary-rgb), 0.25);
}

/* Table enhancements */
.table.card-table {
  margin-bottom: 0;
}

.table.card-table th {
  border-top: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--tblr-gray-700);
  padding: 1rem 0.75rem;
}

.table.card-table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-top: 1px solid var(--tblr-border-color);
}

/* Stats cards */
.text-h3 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .btn-list {
    flex-wrap: wrap;
  }

  .btn-list .btn {
    margin-bottom: 0.25rem;
  }

  .pagination {
    font-size: 0.875rem;
  }

  .pagination .page-link {
    padding: 0.375rem 0.5rem;
  }
}

/* Loading states */
.placeholder {
  background: linear-gradient(90deg, transparent, rgba(var(--tblr-body-color-rgb), 0.04), transparent);
  background-size: 200px 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Enhanced focus states */
.form-control:focus,
.form-select:focus,
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.125rem rgba(var(--tblr-primary-rgb), 0.25);
}

/* Badge indicator dots */
.badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.375rem;
}

.badge .badge-dot.bg-green {
  background-color: var(--tblr-green) !important;
}

.badge .badge-dot.bg-red {
  background-color: var(--tblr-red) !important;
}

.badge .badge-dot.bg-yellow {
  background-color: var(--tblr-yellow) !important;
}

/* Future monitoring features hover effects */
.hover-card {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.hover-card:hover {
  border-color: var(--tblr-primary) !important;
  box-shadow: 0 0.25rem 0.75rem rgba(var(--tblr-primary-rgb), 0.15);
  transform: translateY(-1px);
}

.future-monitoring-features-preview .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.future-monitoring-features-preview .avatar.bg-primary-lt {
  background-color: rgba(var(--tblr-primary-rgb), 0.1) !important;
  color: var(--tblr-primary);
}

.future-monitoring-features-preview .avatar.bg-info-lt {
  background-color: rgba(var(--tblr-info-rgb), 0.1) !important;
  color: var(--tblr-info);
}

.bg-light-subtle {
  background-color: var(--tblr-bg-surface-secondary) !important;
}

/* Notification Dropdown Enhancements */
.dropdown-menu-card {
  min-width: 350px;
  max-width: 400px;
  border: 1px solid var(--tblr-border-color);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1.5rem rgba(var(--tblr-body-color-rgb), 0.175);
  z-index: 1050;
  /* Remove conflicting overflow and height to prevent header clipping */
  padding: 0;
}

/* Apply scrolling only to the content area, not the entire card */
.dropdown-menu-card .list-group {
  max-height: 400px;
  overflow-y: auto;
}

.dropdown-menu-card .card {
  border: none;
  box-shadow: none;
  margin: 0;
}

.dropdown-menu-card .card-header {
  background-color: var(--tblr-bg-surface-secondary);
  border-bottom: 1px solid var(--tblr-border-color);
  padding: 1rem;
  border-radius: 0.375rem 0.375rem 0 0;
  margin-bottom: 0;
  /* Ensure header is visible and properly positioned */
  position: relative;
  z-index: 1;
}

.dropdown-menu-card .list-group-item {
  border-left: none;
  border-right: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
}

.dropdown-menu-card .list-group-item:first-child {
  border-top: none;
}

.dropdown-menu-card .list-group-item:last-child {
  border-bottom: none;
}

.dropdown-menu-card .card-footer {
  border-radius: 0 0 0.375rem 0.375rem;
  background-color: var(--tblr-bg-surface-secondary);
  border-top: 1px solid var(--tblr-border-color);
  padding: 0.75rem 1rem;
}

/* Responsive notification dropdown */
@media (max-width: 767.98px) {
  .dropdown-menu-card {
    min-width: 280px;
    max-width: 320px;
    right: -10px !important;
    left: auto !important;
  }
}

@media (max-width: 575.98px) {
  .dropdown-menu-card {
    min-width: 260px;
    max-width: 280px;
    right: -20px !important;
    left: auto !important;
  }
}

/* Fix dropdown positioning to prevent overflow */
.dropdown-menu-end.dropdown-menu-card {
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  /* Ensure dropdown content is not clipped */
  top: 100% !important;
}

/* Ensure dropdown stays within viewport */
@media (max-width: 991.98px) {
  .dropdown-menu-end.dropdown-menu-card {
    right: -10px !important;
    max-width: calc(100vw - 40px);
  }
}
