/**
 * HMS admin — dark layout: typography, forms, integrations, shared polish
 */

/* --- Global readability in dark mode --- */
body.dark-layout {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.dark-layout .content-body {
  color: #c2c6dc;
}

body.dark-layout .content-body strong,
body.dark-layout .content-body b {
  color: #ebeefd;
  font-weight: 600;
}

/* “text-dark” on cards was meant for light surfaces; on dark cards use light ink */
body.dark-layout .card .text-dark {
  color: #ebeefd !important;
}

body.dark-layout .content-body .text-muted {
  color: #9ca3c2 !important;
}

body.dark-layout .content-body label {
  color: #d6d9e8 !important;
}

body.dark-layout .content-body .form-group label,
body.dark-layout .content-body .form-label {
  color: #d6d9e8 !important;
}

body.dark-layout .form-control,
body.dark-layout .custom-file-label,
body.dark-layout textarea.form-control {
  background-color: #10163a;
  border-color: #414561;
  color: #ebeefd;
}

body.dark-layout .form-control:focus {
  background-color: #10163a;
  border-color: #7367f0;
  color: #ebeefd;
}

body.dark-layout .form-control::placeholder {
  color: #7e86a6;
}

body.dark-layout .input-group-text {
  background-color: #262c49;
  border-color: #414561;
  color: #c2c6dc;
}

/* Outline / light buttons on dark backgrounds */
body.dark-layout .btn-light {
  background-color: #262c49 !important;
  border-color: #414561 !important;
  color: #ebeefd !important;
}

body.dark-layout .btn-light:hover,
body.dark-layout .btn-light:focus {
  background-color: #32385c !important;
  border-color: #5a5f7a !important;
  color: #fff !important;
}

body.dark-layout .btn-outline-secondary,
body.dark-layout .hms-btn-muted-outline {
  border-color: #5a6190 !important;
  color: #c2c6dc !important;
  background-color: transparent !important;
}

body.dark-layout .btn-outline-secondary:hover,
body.dark-layout .hms-btn-muted-outline:hover {
  background-color: #262c49 !important;
  border-color: #7367f0 !important;
  color: #fff !important;
}

body.dark-layout .card .card-title,
body.dark-layout .card .card-header {
  color: #ebeefd;
}

/* Links in main content */
body.dark-layout .content-body a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link) {
  color: #a9b0ff;
}

body.dark-layout .content-body a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link):hover {
  color: #c4c8ff;
}

/* Code snippets in cards (Vuexy defaults can be too dim on tinted panels) */
body.dark-layout .card-body code {
  background-color: rgba(0, 0, 0, 0.28) !important;
  color: #d8ddf5 !important;
  border: 1px solid rgba(65, 69, 97, 0.6);
}

/* Footer */
body.dark-layout .footer.footer-light,
body.dark-layout .footer.footer-light .blue-grey.lighten-2 {
  background-color: #10163a !important;
  color: #c2c6dc !important;
  border-top: 1px solid #414561;
}

body.dark-layout .footer.footer-light a {
  color: #7367f0;
}

/* Dropdown menus from navbar */
body.dark-layout .dropdown-menu {
  background-color: #10163a;
  border-color: #414561;
}

body.dark-layout .dropdown-item {
  color: #c2c6dc;
}

body.dark-layout .dropdown-item:hover,
body.dark-layout .dropdown-item:focus {
  background-color: #262c49;
  color: #fff;
}

/* Login (blank-page) */
body.dark-layout.blank-page .login-page-wrap {
  background: linear-gradient(160deg, #1a1f3a 0%, #262c49 50%, #10163a 100%);
}

body.dark-layout.blank-page .login-card {
  background: #10163a;
  border: 1px solid #414561;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

body.dark-layout.blank-page .login-card__form h1 {
  color: #ebeefd;
}

body.dark-layout.blank-page .login-card__form .subtitle,
body.dark-layout.blank-page .login-remember span {
  color: #9ca3c2;
}

body.dark-layout.blank-page .login-card__form .form-control {
  background-color: #262c49;
  border-color: #414561;
  color: #ebeefd;
}

body.dark-layout.blank-page .login-card__form .form-control::placeholder {
  color: #7e86a6;
}

/* --- Payments & integrations page --- */
body.dark-layout .integrations-hero {
  background: linear-gradient(135deg, #2d3560 0%, #232a4f 40%, #171c3a 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(115, 103, 240, 0.2);
}

body.dark-layout .integrations-hero h1 {
  color: #fff;
}

body.dark-layout .integrations-hero p {
  color: rgba(235, 238, 253, 0.92);
}

body.dark-layout .integrations-breadcrumb,
body.dark-layout .integrations-breadcrumb a {
  color: rgba(255, 255, 255, 0.88) !important;
}

body.dark-layout .feature-card {
  background-color: #10163a !important;
  border: 1px solid #414561 !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

body.dark-layout .feature-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

body.dark-layout .feature-card .card-title {
  color: #ebeefd !important;
}

body.dark-layout .feature-card .card-text {
  color: #aeb6d4 !important;
}

body.dark-layout .feature-card .card-text a {
  color: #b4b8ff !important;
  text-decoration: underline;
}

body.dark-layout .feature-card .card-text a:hover {
  color: #d0d3ff !important;
}

body.dark-layout .integrations-section-title {
  color: #8b92b5 !important;
}

body.dark-layout .integrations-page-main .card-body > .d-flex h3,
body.dark-layout .integrations-page-main h3 {
  color: #ebeefd !important;
}

body.dark-layout .integrations-page-main h3 strong {
  color: #fff !important;
}

/* Status pills */
body.dark-layout .status-pill.ok {
  background: rgba(40, 199, 111, 0.18);
  color: #7ee2a8;
  border: 1px solid rgba(40, 199, 111, 0.35);
}

body.dark-layout .status-pill.warn {
  background: rgba(255, 159, 67, 0.15);
  color: #ffca7a;
  border: 1px solid rgba(255, 159, 67, 0.35);
}

/* Stripe key panels — full dark surfaces */
body.dark-layout .stripe-key-section {
  background: #141937 !important;
  border: 1px solid #414561 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-layout .stripe-key-section.test {
  background: linear-gradient(180deg, #182044 0%, #141937 100%) !important;
  border-color: rgba(0, 207, 232, 0.35) !important;
}

body.dark-layout .stripe-key-section.live {
  background: linear-gradient(180deg, #241f18 0%, #141937 100%) !important;
  border-color: rgba(255, 159, 67, 0.4) !important;
}

body.dark-layout .stripe-key-section h5 {
  color: #ebeefd !important;
}

body.dark-layout .stripe-key-section .text-info {
  color: #5ee8fd !important;
}

body.dark-layout .stripe-key-section .text-warning {
  color: #ffc078 !important;
}

body.dark-layout .stripe-key-section label {
  color: #b8bdd9 !important;
}

body.dark-layout .stripe-key-section .form-control {
  background-color: #0f132e !important;
  border-color: #4a5078 !important;
  color: #ebeefd !important;
}

body.dark-layout .stripe-key-section .form-control:focus {
  border-color: #7367f0;
  box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.25);
}

body.dark-layout .stripe-key-section .form-control::placeholder {
  color: #6d7494;
}

/* Test-mode callout */
body.dark-layout .integrations-stripe-mode-callout {
  background: #1a1f45 !important;
  border: 1px solid #4a5080 !important;
}

body.dark-layout .integrations-stripe-mode-callout .custom-control-label {
  color: #ebeefd !important;
}

body.dark-layout .integrations-stripe-mode-hint {
  color: #aeb8d8 !important;
}

body.dark-layout .integrations-stripe-mode-hint strong {
  color: #f0f2ff !important;
}

body.dark-layout .integrations-stripe-mode-hint code {
  color: #e0e5ff !important;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(65, 69, 97, 0.8);
}

/* Legacy Connect block */
body.dark-layout .integrations-page-main hr {
  border-color: #414561 !important;
}

body.dark-layout .integrations-page-main .small.text-muted {
  color: #9ca3c2 !important;
}

/* Alerts on integrations */
body.dark-layout .alert-info {
  background-color: rgba(0, 207, 232, 0.12);
  border-color: rgba(0, 207, 232, 0.35) !important;
  color: #c8eef5;
}

body.dark-layout .alert-info .alert-link {
  color: #9ae8ff;
}

/* Theme toggle in header */
.hms-theme-toggle {
  cursor: pointer;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  transition: background-color 0.15s ease;
}

.hms-theme-toggle:hover {
  background-color: rgba(115, 103, 240, 0.12);
}

body.dark-layout .hms-theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.hms-theme-toggle .ficon {
  font-size: 1.15rem;
  vertical-align: middle;
}

/* Select2 */
body.dark-layout .select2-container--default .select2-selection--single {
  background-color: #262c49;
  border-color: #414561;
}

body.dark-layout .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #ebeefd;
}

body.dark-layout .select2-dropdown {
  background-color: #10163a;
  border-color: #414561;
}

body.dark-layout .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #7367f0;
}

body.dark-layout .select2-container--default .select2-results__option[aria-selected='true'] {
  background-color: #262c49;
}

body.dark-layout.blank-page .hms-theme-toggle.btn-outline-secondary {
  border-color: #414561;
  color: #c2c6dc;
  background-color: rgba(16, 22, 58, 0.6);
}

body.dark-layout.blank-page .hms-theme-toggle.btn-outline-secondary:hover {
  background-color: #262c49;
  color: #fff;
}

/* DataTables / list views — helper text */
body.dark-layout .dataTables_info,
body.dark-layout .dataTables_length label,
body.dark-layout .dataTables_filter label {
  color: #9ca3c2 !important;
}

/* --- Dashboard (#dashboard-analytics) — filter bar & charts --- */
body.dark-layout #dashboard-analytics .hms-dashboard-filter {
  background-color: #141937 !important;
  border: 1px solid #414561 !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35) !important;
}

body.dark-layout #dashboard-analytics .hms-dashboard-filter label {
  color: #ebeefd !important;
}

body.dark-layout #dashboard-analytics .hms-dashboard-filter input[type='date'] {
  color-scheme: dark;
  min-height: 2.714rem;
  padding-right: 0.5rem;
}

/* Native calendar icon is dark-on-dark in many browsers — invert for visibility (Chrome, Safari, Edge) */
body.dark-layout #dashboard-analytics .hms-dashboard-filter input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.15);
  opacity: 0.92;
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.15rem;
  margin-left: 0.35rem;
}

body.dark-layout #dashboard-analytics .hms-dashboard-filter input[type='date']::-webkit-datetime-edit,
body.dark-layout #dashboard-analytics .hms-dashboard-filter input[type='date']::-webkit-datetime-edit-fields-wrapper,
body.dark-layout #dashboard-analytics .hms-dashboard-filter input[type='date']::-webkit-datetime-edit-text {
  color: #ebeefd;
}

/* All admin date inputs in dark mode (consistent picker icon) */
body.dark-layout input.form-control[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.15);
  opacity: 0.92;
  cursor: pointer;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0.15rem;
}

body.dark-layout #dashboard-analytics .hms-dashboard-subscription-alert {
  background-color: #161b3d !important;
  border-color: #414561 !important;
  color: #c2c6dc !important;
}

body.dark-layout #dashboard-analytics .hms-dashboard-subscription-alert strong {
  color: #ebeefd !important;
}

body.dark-layout #dashboard-analytics .hms-dashboard-subscription-alert .text-muted {
  color: #9ca3c2 !important;
}

body.dark-layout #dashboard-analytics .hms-dashboard-chart-card h5 {
  color: #ebeefd !important;
}
