/* Custom Typography Overrides */

/* Make all text darker/black by default */
body {
  color: #212529 !important;
  background-color: #f8f9fc;
  min-height: 100vh !important;
}

/* Ensure full height layout */
html, body {
  height: 100% !important;
  min-height: 100vh !important;
}

#root {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #212529 !important;
  font-weight: 600;
}

/* Footer h3 exception - Pink color */
footer h3 {
  color: #E91E63 !important;
}

/* Section headers with better spacing */
.h3 {
  letter-spacing: -0.5px;
}

/* Paragraphs and general text */
p, span, div, td, th, li {
  color: #212529;
}

/* Override SB Admin gray text classes */
.text-gray-800 {
  color: #212529 !important;
}

.text-gray-900 {
  color: #000000 !important;
}

/* Card improvements */
.card {
  border: none;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.card-body {
  color: #212529;
}

/* Stats card specific */
.stats-card {
  border-radius: 0.5rem;
  overflow: hidden;
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12) !important;
}

/* Card header improvements */
.card-header {
  background-color: #fff;
  border-bottom: 1px solid #e3e6f0;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Table improvements */
.table {
  color: #212529;
}

.table td, .table th {
  color: #212529;
  vertical-align: middle;
  padding: 1rem 0.75rem;
}

.table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  border-bottom: 2px solid #e3e6f0;
}

.table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.table thead th.sortable:hover {
  background-color: #f8f9fc;
  color: #4e73df;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fc;
  transform: scale(1.01);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Form labels and inputs */
label, .form-label {
  color: #212529 !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control {
  color: #212529 !important;
  border: 1px solid #d1d3e2;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
}

/* Keep muted text slightly gray but readable */
.text-muted {
  color: #6c757d !important;
}

/* Small text */
small, .small {
  color: #6c757d !important;
}

/* Sidebar improvements */
.sidebar {
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.1);
}

.sidebar * {
  color: #fff !important;
}

.sidebar .nav-link {
  padding: 1rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-left-color: rgba(255, 255, 255, 0.5);
  color: #fff !important;
}

.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  border-left-color: #fff;
  font-weight: 600;
  color: #fff !important;
}

.sidebar .nav-link span,
.sidebar .nav-link i,
.sidebar .sidebar-brand-text,
.sidebar .sidebar-brand-icon,
.sidebar .sidebar-brand,
.sidebar a {
  color: #fff !important;
}

.sidebar .sidebar-divider {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Topbar improvements */
.topbar {
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.topbar .nav-link {
  color: #212529 !important;
  transition: all 0.2s ease;
}

.topbar .nav-link:hover {
  color: #4e73df !important;
}

/* Dropdown improvements */
.dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
}

.dropdown-item {
  color: #212529 !important;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fc;
  color: #4e73df !important;
}

/* Button improvements */
.btn {
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0.35rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

/* Badge improvements */
.badge {
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  color: #d1d3e2;
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: #5a5c69;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #858796;
  margin-bottom: 1.5rem;
}

/* Chart container improvements */
.chart-container {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #d1d3e2;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b7b9cc;
}


/* Sidebar Support Card */
.sidebar-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 0 1rem 1rem 1rem;
  backdrop-filter: blur(10px);
  text-align: center;
}

.sidebar-card .support-btn {
  background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
  color: #1a1a1a;
  font-weight: 600;
  border: none;
  transition: all 0.3s;
  padding: 0.5rem 1rem;
  width: 100%;
}

.sidebar-card .support-btn:hover {
  background: linear-gradient(135deg, #FFC700 0%, #FFB700 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  color: #000;
}

/* Sidebar Text - Force White */
.sidebar .nav-link,
.sidebar .nav-link span,
.sidebar .nav-link i,
.sidebar .sidebar-brand-text {
  color: #fff !important;
}

.sidebar .nav-item.active .nav-link {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Logout Button - Red Filled Style */
.sidebar .logout-link {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  border: 1px solid rgba(220, 53, 69, 0.5);
  transition: all 0.3s;
  margin: 0 1rem;
  border-radius: 0.35rem;
  padding: 0.75rem 1rem !important;
  display: block;
  max-width: calc(100% - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .logout-link:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
  border-color: #bd2130;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.sidebar .logout-link i,
.sidebar .logout-link span {
  color: #fff !important;
}

/* Sidebar Brand */
.sidebar-brand {
  background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-brand-text {
  font-weight: 700;
  letter-spacing: 1px;
}


/* Avatar Circle */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  color: white;
  font-weight: 600;
  border-radius: 50%;
  text-transform: uppercase;
}

/* Topbar Avatar */
.topbar .avatar-circle {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dropdown Logout Item */
.dropdown-item .text-danger {
  color: #dc3545 !important;
  font-weight: 600;
}

.dropdown-item:hover {
  background-color: #dc3545 !important;
}

.dropdown-item:hover .text-danger,
.dropdown-item:hover i {
  color: #fff !important;
}


/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-top: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid #f1f1f1;
  display: flex;
  align-items: center;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #f8f9fc;
  padding-left: 1.25rem;
}

.search-result-item i {
  width: 20px;
}

.navbar-search {
  position: relative;
}

.navbar-search .form-control {
  border-radius: 2rem;
  padding-left: 1rem;
}

.navbar-search .input-group-append .btn {
  border-radius: 0 2rem 2rem 0;
}


/* Mobile Sidebar Search */
.sidebar-search {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  margin: 0 0.5rem;
}

.sidebar-search .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.sidebar-search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-mobile-item {
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.search-mobile-item:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
  /* Keep sidebar visible in collapsed state on mobile */
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    z-index: 1050;
    height: 100vh;
    overflow-y: auto;
    width: 6.5rem !important;
    min-width: 6.5rem;
  }
  
  /* Hide text in sidebar on mobile, show only icons */
  .sidebar .sidebar-brand-text {
    display: none;
  }
  
  .sidebar .nav-link span {
    display: none;
  }
  
  .sidebar .sidebar-card {
    display: none !important;
  }
  
  .sidebar .logout-link {
    margin: 0 0.5rem;
    padding: 0.75rem 0 !important;
    text-align: center;
    max-width: calc(100% - 1rem);
  }
  
  .sidebar .logout-link span {
    display: none;
  }
  
  .sidebar .logout-link i {
    margin: 0;
  }
  
  .sidebar .sidebar-search {
    display: none !important;
  }
  
  .sidebar .nav-link {
    text-align: center;
    padding: 0.75rem 0;
    border-left: none;
  }
  
  .sidebar .nav-link i {
    margin-right: 0;
  }
  
  .sidebar .nav-link.active {
    border-left: none;
    border-bottom: 3px solid #fff;
  }
  
  /* Remove overlay - no need for it */
  body.sidebar-toggled::before {
    display: none !important;
  }
  
  /* Adjust content wrapper to account for collapsed sidebar */
  #content-wrapper {
    width: calc(100% - 6.5rem) !important;
    margin-left: 6.5rem !important;
  }
  
  #content {
    padding: 1rem !important;
    min-height: calc(100vh - 2rem) !important;
  }
  
  /* Fix topbar positioning - remove all top spacing */
  .topbar {
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
  }
  
  /* Remove any top margin/padding from main content */
  #page-top {
    padding-top: 0 !important;
    margin-top: 0 !important;
    min-height: 100vh !important;
  }
  
  #wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
  }
  
  #content-wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Make main content area fill available space */
  .container-fluid {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 120px !important;
  }
  
  /* Cards and content should expand to fill space */
  .card {
    flex: 1 !important;
  }
  
  .card-body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
  }
  
  /* Tables should expand */
  .table-responsive {
    flex: 1 !important;
  }
  
  /* Sidebar mobile behavior - collapsed by default */
  @media (max-width: 768px) {
    .sidebar {
      position: fixed !important;
      left: -14rem !important;
      transition: left 0.3s ease-in-out !important;
      z-index: 1050 !important;
      height: 100vh !important;
      overflow-y: auto !important;
    }
    
    .sidebar.toggled {
      left: 0 !important;
    }
    
    body.sidebar-toggled .sidebar {
      left: 0 !important;
    }
    
    /* Overlay when sidebar is open on mobile */
    body.sidebar-toggled::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 1040;
    }
    
    /* Content should take full width on mobile */
    #content-wrapper {
      margin-left: 0 !important;
      width: 100% !important;
    }
  }
  
  /* Hide desktop search, show mobile search */
  .navbar-search {
    display: none !important;
  }
  
  /* Make topbar items stack better */
  .topbar .navbar-nav {
    flex-direction: row;
  }
  
  /* Adjust avatar size on mobile */
  .topbar .avatar-circle {
    width: 35px !important;
    height: 35px !important;
    font-size: 14px !important;
  }
  
  /* Hide user name on small screens */
  .topbar .d-none.d-lg-inline {
    display: none !important;
  }
  
  /* Better dropdown positioning */
  .topbar .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    min-width: 200px;
  }
  
  /* Make cards stack properly */
  .row > [class*='col-'] {
    margin-bottom: 1rem;
  }
  
  /* Adjust table for mobile */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better button sizing */
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  /* Adjust page title */
  .h3 {
    font-size: 1.5rem !important;
  }
  
  /* Ensure no body overflow */
  body {
    overflow-x: hidden;
    min-height: 100vh !important;
  }
  
  /* Fix container padding */
  .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Force minimum height for all pages */
  .main-content {
    min-height: calc(100vh - 120px) !important;
  }
}

@media (min-width: 769px) {
  /* Hide mobile search on desktop */
  .sidebar-search {
    display: none !important;
  }
  
  /* Ensure sidebar is visible and positioned correctly on desktop */
  .sidebar {
    position: relative !important;
    left: 0 !important;
    margin-left: 0 !important;
    width: 14rem !important;
  }
  
  /* Ensure content wrapper has proper margin */
  #content-wrapper {
    margin-left: 0;
    width: 100%;
  }
  
  /* Desktop Sidebar Collapse */
  body.sidebar-toggled .sidebar {
    width: 6.5rem !important;
    overflow: visible;
    min-width: 6.5rem;
  }
  
  body.sidebar-toggled .sidebar .sidebar-brand-text {
    display: none;
  }
  
  body.sidebar-toggled .sidebar .nav-link span {
    display: none;
  }
  
  body.sidebar-toggled .sidebar .sidebar-card {
    display: none !important;
  }
  
  body.sidebar-toggled .sidebar .logout-link {
    margin: 0 0.5rem;
    padding: 0.75rem 0 !important;
    text-align: center;
    max-width: calc(100% - 1rem);
  }
  
  body.sidebar-toggled .sidebar .logout-link span {
    display: none;
  }
  
  body.sidebar-toggled .sidebar .logout-link i {
    margin: 0;
  }
  
  body.sidebar-toggled .sidebar .sidebar-search {
    display: none !important;
  }
  
  /* Adjust content when sidebar is collapsed */
  body.sidebar-toggled #content-wrapper {
    margin-left: 0;
    width: calc(100% - 6.5rem);
  }
  
  /* Show tooltips on hover for collapsed items */
  body.sidebar-toggled .sidebar .nav-link {
    text-align: center;
    padding: 0.75rem 0;
    border-left: none;
  }
  
  body.sidebar-toggled .sidebar .nav-link i {
    margin-right: 0;
  }
  
  body.sidebar-toggled .sidebar .nav-link.active {
    border-left: none;
    border-bottom: 3px solid #fff;
  }
}

/* Sidebar toggle animation */
.sidebar {
  transition: left 0.3s ease-in-out;
}

/* Ensure page wrapper uses flexbox properly */
#wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

#wrapper #content-wrapper {
  overflow-x: hidden;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#wrapper #content {
  flex: 1;
}


/* Ensure sidebar content doesn't overflow */
.sidebar {
  overflow-x: hidden !important;
}

.sidebar .nav-item {
  overflow: hidden;
}

.sidebar .nav-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Support Card Setting Dropdown - Industry Standard */
.support-card-dropdown {
  position: relative;
}

.support-card-dropdown .form-select {
  background: #ffffff;
  border: 1px solid #d1d3e2;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: #212529;
  transition: all 0.2s ease;
  cursor: pointer;
}

.support-card-dropdown .form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
  outline: 0;
}

.support-card-dropdown .form-select:hover {
  border-color: #4e73df;
}

/* Status indicators for different states */
.support-card-dropdown .form-select[data-value="global"] {
  border-left: 3px solid #6c757d;
}

.support-card-dropdown .form-select[data-value="on"] {
  border-left: 3px solid #28a745;
}

.support-card-dropdown .form-select[data-value="off"] {
  border-left: 3px solid #dc3545;
}

/* Label styling */
.support-card-dropdown .form-label {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.5rem;
}

.support-card-dropdown .text-muted {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Form section styling - Industry Standard */
.user-settings-section {
  background: #ffffff;
  border: 1px solid #e3e6f0;
  border-radius: 0.375rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.user-settings-section h6 {
  color: #4e73df;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Contact fields styling */
.support-contact-fields {
  background: #f8f9fc;
  border: 1px solid #e3e6f0;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.support-contact-fields.hidden {
  opacity: 0.6;
  background: #f1f3f4;
  border-color: #dee2e6;
}

.support-contact-fields h6 {
  color: #495057;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.support-contact-fields .form-control {
  border: 1px solid #ced4da;
  background: #ffffff;
}

.support-contact-fields .form-control:focus {
  border-color: #4e73df;
  background: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
}

/* Status preview - Clean design */
.support-status-preview {
  background: #f8f9fc;
  border: 1px solid #e3e6f0;
  border-radius: 0.25rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #495057;
}

.support-status-preview.status-global {
  background: #f8f9fc;
  border-color: #dee2e6;
  color: #6c757d;
}

.support-status-preview.status-on {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.support-status-preview.status-off {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-settings-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .support-card-dropdown .form-select {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .support-card-dropdown .form-label {
    font-size: 0.875rem;
  }
  
  .support-contact-fields {
    padding: 0.75rem;
  }
  
  .support-status-preview {
    padding: 0.5rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 576px) {
  .user-settings-section {
    padding: 0.75rem;
    border-radius: 0.25rem;
  }
  
  .support-card-dropdown .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .user-settings-section h6 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }
  
  .support-contact-fields h6 {
    font-size: 0.8125rem;
  }
}
/* Responsive Modal Styling */
.modal-responsive {
  max-width: 95vw;
  width: auto;
}

/* Modal responsive behavior */
@media (max-width: 576px) {
  /* Mobile: Full width, minimal padding */
  .modal-dialog {
    max-width: 95vw;
    margin: 0.5rem;
  }
  
  .modal-content {
    border-radius: 0.25rem;
  }
  
  .modal-body {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
  
  /* Form adjustments for mobile */
  .user-settings-section {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .support-contact-fields {
    padding: 0.75rem;
  }
}

@media (min-width: 576px) and (max-width: 768px) {
  /* Tablet: 2/3 width */
  .modal-dialog {
    max-width: 75vw;
    margin: 1rem auto;
  }
  
  .modal-body {
    padding: 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
  }
  
  .modal-footer {
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

@media (min-width: 768px) and (max-width: 992px) {
  /* Small desktop: 60% width */
  .modal-dialog {
    max-width: 60vw;
  }
  
  .modal-body {
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
  }
}

@media (min-width: 992px) {
  /* Large desktop: Standard width */
  .modal-dialog {
    max-width: 600px;
  }
  
  .modal-body {
    padding: 1.5rem;
    max-height: 85vh;
    overflow-y: auto;
  }
}

/* Form grid system for responsive layout */
.modal-form-grid {
  display: grid;
  gap: 1rem;
}

@media (max-width: 576px) {
  /* Mobile: 1 column */
  .modal-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 576px) and (max-width: 768px) {
  /* Tablet: 1-2 columns based on content */
  .modal-form-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-form-grid.two-column {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  /* Desktop: 2-3 columns */
  .modal-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .modal-form-grid.three-column {
    grid-template-columns: 1fr 1fr 1fr;
  }
  
  .modal-form-grid .full-width {
    grid-column: 1 / -1;
  }
}

/* Scrollable modal body */
.modal-body-scrollable {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.modal-body-scrollable::-webkit-scrollbar {
  width: 6px;
}

.modal-body-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modal-body-scrollable::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.modal-body-scrollable::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Modal header improvements */
.modal-header {
  border-bottom: 1px solid #e3e6f0;
  background: #f8f9fc;
}

.modal-title {
  font-weight: 600;
  color: #212529;
}

.modal-footer {
  border-top: 1px solid #e3e6f0;
  background: #f8f9fc;
}

/* Responsive button sizing */
@media (max-width: 576px) {
  .modal-footer .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}
/* Form Select Styling - Bootstrap 5 Compatible */
.form-select {
  background: #ffffff;
  border: 1px solid #d1d3e2;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: #212529;
  transition: all 0.2s ease;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 0.875rem;
  line-height: 1.5;
}

.form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
  outline: 0;
}

.form-select:hover {
  border-color: #4e73df;
}

.form-select:disabled {
  background-color: #f8f9fc;
  border-color: #e3e6f0;
  color: #6c757d;
  cursor: not-allowed;
}

/* Status dropdown color coding */
.form-select[data-value="active"] {
  border-left: 4px solid #28a745;
}

.form-select[data-value="inactive"] {
  border-left: 4px solid #ffc107;
}

.form-select[data-value="suspended"] {
  border-left: 4px solid #dc3545;
}

/* Support card dropdown color coding */
.support-card-dropdown .form-select {
  background: #ffffff;
  border: 1px solid #d1d3e2;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: #212529;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.5;
}

.support-card-dropdown .form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
  outline: 0;
}

.support-card-dropdown .form-select:hover {
  border-color: #4e73df;
}

/* Support card status indicators */
.support-card-dropdown .form-select[data-value="global"] {
  border-left: 4px solid #6c757d;
}

.support-card-dropdown .form-select[data-value="on"] {
  border-left: 4px solid #28a745;
}

.support-card-dropdown .form-select[data-value="off"] {
  border-left: 4px solid #dc3545;
}

/* Responsive form-select */
@media (max-width: 768px) {
  .form-select {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    padding-right: 2.25rem;
    line-height: 1.4;
  }
  
  .support-card-dropdown .form-select {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.4;
  }
}

@media (max-width: 576px) {
  .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    padding-right: 2rem;
    line-height: 1.3;
  }
  
  .support-card-dropdown .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.3;
  }
}
/* Filter Panel Component */
.filter-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.filter-panel-open {
  right: 0;
}

.filter-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  transition: opacity 0.3s ease-in-out;
}

.filter-panel-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e3e6f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fc;
  flex-shrink: 0;
}

.filter-panel-header h5 {
  color: #4e73df;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.filter-panel-header .btn-link {
  color: #6c757d;
  text-decoration: none;
}

.filter-panel-header .btn-link:hover {
  color: #4e73df;
}

.filter-panel-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.filter-panel-footer {
  padding: 1.5rem;
  border-top: 1px solid #e3e6f0;
  background: #f8f9fc;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Filter Group Styling */
.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.5rem;
  display: block;
}

.filter-group .form-control,
.filter-group .form-select {
  border: 1px solid #d1d3e2;
  border-radius: 0.375rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.filter-group .form-control:focus,
.filter-group .form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Custom Range Fields */
.custom-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* Filter Panel Button */
.filter-toggle-btn {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 1030;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.filter-toggle-btn.active {
  background: #4e73df;
  border-color: #4e73df;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .filter-panel {
    width: 100%;
    right: -100%;
  }
  
  .filter-toggle-btn {
    right: 15px;
    width: 45px;
    height: 45px;
    top: auto;
    bottom: 80px;
    transform: none;
  }
  
  .filter-toggle-btn:hover {
    transform: scale(1.1);
  }
  
  .filter-panel-header,
  .filter-panel-body,
  .filter-panel-footer {
    padding: 1rem;
  }
  
  .custom-range-fields {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  /* Make filter panel body shorter on mobile */
  .filter-panel-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }
  
  /* Sticky footer on mobile */
  .filter-panel-footer {
    position: sticky;
    bottom: 0;
    background: #f8f9fc;
    border-top: 2px solid #e3e6f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 576px) {
  .filter-toggle-btn {
    right: 10px;
    width: 40px;
    height: 40px;
    bottom: 70px;
  }
  
  .filter-panel-header,
  .filter-panel-body,
  .filter-panel-footer {
    padding: 0.75rem;
  }
  
  /* Even shorter on small screens */
  .filter-panel-body {
    max-height: calc(100vh - 180px);
  }
  
  /* Smaller buttons on mobile */
  .filter-panel-footer .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Ensure filter button doesn't interfere with content */
@media (max-width: 768px) {
  /* Add bottom padding to main content to avoid overlap with filter button */
  #content {
    padding-bottom: 120px !important;
  }
  
  /* Adjust for pages with pagination */
  .pagination {
    margin-bottom: 2rem !important;
  }
}

/* Animation for filter count badge */
.filter-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Filter Panel Scrollbar */
.filter-panel-body::-webkit-scrollbar {
  width: 6px;
}

.filter-panel-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-panel-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.filter-panel-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Column Visibility Grid */
.column-visibility-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.column-visibility-grid .form-check {
  margin-bottom: 0;
}

.column-visibility-grid .form-check-input {
  margin-top: 0.125rem;
}

.column-visibility-grid .form-check-label {
  font-size: 0.875rem;
  color: #495057;
  cursor: pointer;
  margin-left: 0.25rem;
}

.column-visibility-grid .form-check-input:checked + .form-check-label {
  color: #4e73df;
  font-weight: 500;
}

@media (max-width: 768px) {
  .column-visibility-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Landing Page Footer Headers - Pink Color Override */
footer h3,
footer .h3 {
  color: #E91E63 !important;
}

/* Override global h3 rule specifically for footer */
footer h3[style*="color"] {
  color: #E91E63 !important;
}
