/**
 * Custom fixes for Next.js + Velzon theme integration
 */

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  transition: all 0.3s ease;
}

body.sidebar-enable .sidebar-overlay {
  display: block;
}

/* Smooth sidebar transitions */
.app-menu {
  transition: all 0.3s ease;
}

/* SimpleBar scrollbar height fix */
#scrollbar {
  max-height: calc(100vh - 70px);
  height: 100%;
}

#scrollbar[data-simplebar] {
  position: relative;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  align-items: flex-start;
}

/* Fix for dropdown menu positioning */
.dropdown-menu.show {
  display: block;
  position: absolute;
  z-index: 1000;
  background-color: #fff;
  /* border: 1px solid rgba(0, 0, 0, 0.15); */
  border-radius: 0.25rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.dropdown-menu li {
  padding: 0.5rem 1rem;
  cursor: pointer;
  list-style: none;
}

.dropdown-menu li:hover {
  background-color: #f8f9fa;
}

/* Password visibility toggle button fix */
.auth-pass-inputgroup {
  position: relative;
}

.auth-pass-inputgroup .password-addon {
  position: absolute;
  right: 0;
  top: 0;
  padding: 0.47rem 0.75rem;
  background: transparent;
  border: none;
  color: #878a99;
  cursor: pointer;
  z-index: 10;
}

.auth-pass-inputgroup .password-addon:hover {
  color: #495057;
}

/* Remove Bootstrap's invalid background icon on all password UI variants (text/password types) */
input.form-control.is-invalid[type="password"],
input.form-control.is-invalid[type="text"],
input.password-input.form-control.is-invalid,
.auth-pass-inputgroup .form-control.is-invalid,
.PasswordWithIcon .form-control.is-invalid {
  background-image: none !important;
  background-size: 0 !important;
  padding-right: 2.5rem; /* keep space for eye icon */
}

/* Fix for React hydration issues */
#preloader {
  display: none !important;
}

#preloader {
  display: none !important;
}

/* Responsive fixes */
@media (max-width: 991.98px) {
  .app-menu {
    transform: translateX(-100%);
  }
  
  body.sidebar-enable .app-menu {
    transform: translateX(0);
  }
}

/* Ensure proper z-index for dropdowns */
.dropdown-menu {
  z-index: 1050;
}

/* Fix for profile image upload */
.position-relative input[type="file"] {
  cursor: pointer;
}

/* Pagination improvements */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  gap: 0.25rem;
}

.pagination button {
  position: relative;
  display: block;
  padding: 0.375rem 0.75rem;
  color: #405189;
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #dee2e6;
  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;
}

.pagination button:hover {
  z-index: 2;
  color: #405189;
  background-color: #f3f6f9;
  border-color: #dee2e6;
}

.pagination button.active {
  z-index: 3;
  color: #fff;
  background-color: #405189;
  border-color: #405189;
}

/* Loading spinner improvements */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Form validation feedback */
.invalid-feedback {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.is-invalid {
  border-color: #dc3545;
}

.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

