html {
  min-height: 100vh !important;
}

body {
  min-height: 100vh !important;
}
body.dark-mode,
body.dark-mode #root {
  background-color: #1a1d23 !important;
}

body:not(.dark-mode),
body:not(.dark-mode) #root {
  background-color: #ffffff !important;
}

body.bm-dashboard-dark {
  background-color: #1a1d23 !important;
  color: #ffffff !important;
  min-height: 100vh !important;
}


/* public/index.css */

/* Global Dark Mode Styles */
body.dark-mode,
body.bm-dashboard-dark {
  background-color: #1a1d23 !important;
  color: #ffffff !important;
}

body.dark-mode #root,
body.bm-dashboard-dark #root {
  background-color: #1a1d23 !important;
  color: #ffffff !important;
}
/* Enhanced text visibility for dark mode */
body.dark-mode *,
body.bm-dashboard-dark * {
  color: #ffffff !important;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6,
body.bm-dashboard-dark h1, body.bm-dashboard-dark h2, body.bm-dashboard-dark h3,
body.bm-dashboard-dark h4, body.bm-dashboard-dark h5, body.bm-dashboard-dark h6 {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Error/validation messages must stay red even in dark mode */
label.bm-error-red,
div.bm-error-red {
  color: #dc3545 !important;
}

body.dark-mode:not(.no-global-theme) label.bm-error-red,
body.dark-mode:not(.no-global-theme) div.bm-error-red,
body.bm-dashboard-dark:not(.no-global-theme) label.bm-error-red,
body.bm-dashboard-dark:not(.no-global-theme) div.bm-error-red {
  color: #dc3545 !important;
}

/* Headings */
body.dark-mode:not(.no-global-theme) h1,
body.dark-mode:not(.no-global-theme) h2,
body.dark-mode:not(.no-global-theme) h3,
body.dark-mode:not(.no-global-theme) h4,
body.dark-mode:not(.no-global-theme) h5,
body.dark-mode:not(.no-global-theme) h6,
body.bm-dashboard-dark:not(.no-global-theme) h1,
body.bm-dashboard-dark:not(.no-global-theme) h2,
body.bm-dashboard-dark:not(.no-global-theme) h3,
body.bm-dashboard-dark:not(.no-global-theme) h4,
body.bm-dashboard-dark:not(.no-global-theme) h5,
body.bm-dashboard-dark:not(.no-global-theme) h6 {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Muted text */
body.dark-mode:not(.no-global-theme) .text-muted,
body.bm-dashboard-dark:not(.no-global-theme) .text-muted {
  color: #b8c5d1 !important;
}

/* ========================= */
/* LAYOUT CONTAINERS (DARK)  */
/* ========================= */

body.dark-mode:not(.no-global-theme) .container,
body.dark-mode:not(.no-global-theme) .container-fluid,
body.bm-dashboard-dark:not(.no-global-theme) .container,
body.bm-dashboard-dark:not(.no-global-theme) .container-fluid {
  background-color: #1b2a41;
  color: #ffffff;
}

/* Cards */
body.dark-mode:not(.no-global-theme) .card,
body.bm-dashboard-dark:not(.no-global-theme) .card {
  background-color: #2e5061;
  border-color: #3a506b;
  color: #ffffff;
}

/* ========================= */
/* TABLES (DARK)             */
/* ========================= */

body.dark-mode:not(.no-global-theme) .table,
body.bm-dashboard-dark:not(.no-global-theme) .table {
  color: #ffffff !important;
}

body.dark-mode:not(.no-global-theme) .table th,
body.dark-mode:not(.no-global-theme) .table td,
body.bm-dashboard-dark:not(.no-global-theme) .table th,
body.bm-dashboard-dark:not(.no-global-theme) .table td {
  color: #ffffff !important;
  border-color: #3a506b;
}

body.bm-dashboard-dark:not(.no-global-theme) .table th {
  background-color: #2e5061 !important;
}

/* ========================= */
/* BUTTONS (DARK)            */
/* ========================= */

body.dark-mode:not(.no-global-theme) .btn,
body.bm-dashboard-dark:not(.no-global-theme) .btn {
  color: #ffffff !important;
}

body.dark-mode:not(.no-global-theme) .btn-primary,
body.bm-dashboard-dark:not(.no-global-theme) .btn-primary {
  background-color: #3a506b;
  border-color: #3a506b;
}

/* ========================= */
/* FORMS (DARK + LIGHT)      */
/* ========================= */

/* Dark-mode form controls (SAFE: does not touch checkbox/radio/switch) */
body.dark-mode:not(.no-global-theme) .form-control,
body.bm-dashboard-dark:not(.no-global-theme) .form-control,
body.dark-mode:not(.no-global-theme) select.form-control,
body.bm-dashboard-dark:not(.no-global-theme) select.form-control {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid #334155 !important;
}

/* Dark-mode placeholders */
body.dark-mode:not(.no-global-theme) .form-control::placeholder,
body.bm-dashboard-dark:not(.no-global-theme) .form-control::placeholder {
  color: #94a3b8 !important;
}

/* Dark-mode select arrow styling (Bootstrap selects) */
body.dark-mode:not(.no-global-theme) select.form-control,
body.bm-dashboard-dark:not(.no-global-theme) select.form-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  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='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
}

/* Dark-mode option colors (browser-dependent, but helps) */
body.dark-mode:not(.no-global-theme) option,
body.bm-dashboard-dark:not(.no-global-theme) option {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* Light-mode form controls (Option B): Bootstrap `.form-control` only */
body:not(.dark-mode):not(.bm-dashboard-dark) .form-control,
body:not(.dark-mode):not(.bm-dashboard-dark) textarea.form-control,
body:not(.dark-mode):not(.bm-dashboard-dark) select.form-control {
  background-color: #ffffff !important;
  color: #212529 !important;
  border-color: #ced4da !important;
}

/* ========================= */
/* MODALS (DARK)             */
/* ========================= */

body.dark-mode:not(.no-global-theme) .modal-content,
body.bm-dashboard-dark:not(.no-global-theme) .modal-content {
  background-color: #1b2a41 !important;
  border: 1px solid #2e3d55 !important;
  color: #ffffff !important;
}

body.dark-mode:not(.no-global-theme) .modal-header,
body.dark-mode:not(.no-global-theme) .modal-body,
body.dark-mode:not(.no-global-theme) .modal-footer,
body.bm-dashboard-dark:not(.no-global-theme) .modal-header,
body.bm-dashboard-dark:not(.no-global-theme) .modal-body,
body.bm-dashboard-dark:not(.no-global-theme) .modal-footer {
  background-color: #1b2a41 !important;
  color: #ffffff !important;
  border-color: #2e3d55 !important;
}

body.dark-mode:not(.no-global-theme) .modal-header,
body.bm-dashboard-dark:not(.no-global-theme) .modal-header {
  background-color: #24344d !important;
  border-bottom: 1px solid #334155 !important;
  color: #ffffff !important;
  padding: 1rem 1.5rem;
}

body.dark-mode:not(.no-global-theme) .modal-title,
body.bm-dashboard-dark:not(.no-global-theme) .modal-title {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Modal table header */
body.dark-mode:not(.no-global-theme) .modal-content .table thead th,
body.bm-dashboard-dark:not(.no-global-theme) .modal-content .table thead th {
  background-color: #2d3d5a !important;
  color: #ffffff !important;
  border-bottom: 2px solid #334155 !important;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* ========================= */
/* DROPDOWNS (DARK)          */
/* ========================= */

body.dark-mode:not(.no-global-theme) .dropdown-menu,
body.bm-dashboard-dark:not(.no-global-theme) .dropdown-menu {
  background-color: #2e5061;
  border-color: #3a506b;
}

/* ========================= */
/* PAGINATION (DARK)         */
/* ========================= */

body.dark-mode:not(.no-global-theme) .page-link,
body.bm-dashboard-dark:not(.no-global-theme) .page-link {
  background-color: #2e5061;
  border-color: #3a506b;
  color: #ffffff !important;
}

/* ========================= */
/* UTILITIES                 */
/* ========================= */

/* container scrolling */
.container-fluid {
  overflow-x: auto;
}

.container-fluid::-webkit-scrollbar {
  display: none;
}

/* back-to-top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2a1b3d;
  color: #ffffff;
  border-radius: 50%;
  font-size: 22px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  z-index: 1000;
}

.back-to-top:hover {
  transform: translateY(-4px);
  opacity: 0.9;
}

/* Pagination */
body.dark-mode .page-link,
body.bm-dashboard-dark .page-link {
  background-color: #2e5061;
  border-color: #3a506b;
  color: #ffffff !important;
}

body.dark-mode .page-item.active .page-link,
body.bm-dashboard-dark .page-item.active .page-link {
  background-color: #3a506b;
  border-color: #4a6072;
  color: #ffffff !important;
}

/* Fix the position of the header at the top */
.top {
    position: fixed;
    right: 10px;
    bottom: 10px;
  }
  

  /* TinyMCE "Get all features" button - force dark text */
.tox-promotion-link,
.tox-promotion a {
  color: #000000 !important;
  background-color: #f0f0f0 !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

body.dark-mode .tox-promotion-link,
body.dark-mode .tox-promotion a {
  color: #ffffff !important;
  background-color: #374151 !important;
}
body.dark-mode.bm-dashboard-dark > #root > .bg-oxford-blue {
  background-color: #1a1d23 !important;
}

/* Fix orange/beige side panels */
body.dark-mode.bm-dashboard-dark {
  background-color: #1a1d23 !important;
}

body.dark-mode.bm-dashboard-dark > #root {
  background-color: #1a1d23 !important;
}
/* Fix tab-pane side background */
body.dark-mode .tab-pane.active {
  background-color: #1a1d23 !important;
}

body:not(.dark-mode) .tab-pane.active {
  background-color: #f8f9fa !important;
}

/* ===== EMAIL TEMPLATES PAGE FIXES ===== */

/* Fix beige thead */
body.dark-mode .email-template-list table thead tr th {
  background-color: #374151 !important;
  color: #e9ecef !important;
  border-color: #4a5568 !important;
}

/* Fix action buttons - all 3 on one row */
body.dark-mode .email-template-list .action-buttons,
body:not(.dark-mode) .email-template-list .action-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
}

body.dark-mode .email-template-list .action-buttons .btn,
body:not(.dark-mode) .email-template-list .action-buttons .btn {
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
/* Fix search icon inside search box */
body .email-template-list .search-container {
  position: relative !important;
}

body .email-template-list .search-container svg {
  position: absolute !important;
  left: 0.65rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

body .email-template-list .search-container input {
  padding-left: 2.25rem !important;
}

/* Fix info button - purple */
body .email-template-list .action-btn.info-btn {
  background-color: #6f42c1 !important;
  color: #ffffff !important;
  border-color: #6f42c1 !important;
}

/* Fix edit button - orange */
body .email-template-list .action-btn.edit-btn {
  background-color: #fd7e14 !important;
  color: #ffffff !important;
  border-color: #fd7e14 !important;
}

/* Fix delete button - red */
body .email-template-list .action-btn.delete-btn {
  background-color: #dc3545 !important;
  color: #ffffff !important;
  border-color: #dc3545 !important;
}

/* Fix validation error text in dark mode */
body.dark-mode .invalid-feedback,
body.dark-mode .text-danger {
  color: #ff6b6b !important;
}

/* Fix alert-danger in dark mode */
body.dark-mode .alert-danger {
  background-color: #7f1d1d !important;
  border-color: #991b1b !important;
  color: #fecaca !important;
}

body.dark-mode .alert-danger * {
  color: #fecaca !important;
}
