/* ASIMOV Files — calm glass interface for the SFTPGo WebClient */

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  color-scheme: dark;
  --asimov-bg: #050607;
  --asimov-surface: rgba(19, 20, 23, 0.68);
  --asimov-surface-strong: rgba(24, 25, 29, 0.82);
  --asimov-surface-soft: rgba(255, 255, 255, 0.045);
  --asimov-border: rgba(255, 255, 255, 0.105);
  --asimov-border-hover: rgba(255, 255, 255, 0.18);
  --asimov-text: #f5f5f6;
  --asimov-muted: #9b9da5;
  --asimov-radius: 18px;
  --bs-body-bg: var(--asimov-bg);
  --bs-body-color: var(--asimov-text);
  --bs-primary: #f5f5f5;
  --bs-primary-rgb: 245, 245, 245;
  --bs-link-color: #f5f5f5;
  --bs-link-hover-color: #ffffff;
  --bs-border-color: var(--asimov-border);
  --bs-card-bg: transparent;
}

html,
body,
.app-root,
.app-page,
.app-wrapper,
.app-main,
.app-content,
.app-blank {
  background-color: var(--asimov-bg) !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--asimov-text) !important;
  background-image:
    radial-gradient(900px 620px at 7% -12%, rgba(255, 255, 255, 0.075), transparent 68%),
    radial-gradient(780px 520px at 98% 8%, rgba(116, 122, 138, 0.055), transparent 72%),
    linear-gradient(145deg, #090a0c 0%, #050607 46%, #07080a 100%) !important;
  background-repeat: no-repeat !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Header and sidebar */
#kt_app_header {
  background: rgba(7, 8, 10, 0.74) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  backdrop-filter: blur(20px) saturate(125%);
  box-shadow: none !important;
}

#kt_app_sidebar {
  background: rgba(7, 8, 10, 0.72) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.075) !important;
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%);
  box-shadow: none !important;
}

#kt_app_sidebar_header {
  margin-inline: 1.35rem !important;
  padding-top: 1.45rem !important;
}

.app-sidebar-logo {
  display: flex !important;
  width: 100%;
  align-items: center;
}

.app-sidebar-logo img.app-sidebar-logo-default {
  width: 198px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 58px !important;
  object-fit: contain;
  object-position: left center;
}

.app-sidebar-logo .text-sidebar {
  display: none !important;
}

#kt_app_sidebar_mobile_toggle + span img {
  width: 150px !important;
  max-width: 46vw !important;
  height: auto !important;
  object-fit: contain;
}

#kt_app_sidebar .menu-link {
  min-height: 46px;
  margin-block: 3px;
  border: 1px solid transparent;
  border-radius: 13px !important;
  color: #a8abb4 !important;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

#kt_app_sidebar .menu-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.052) !important;
  border-color: rgba(255, 255, 255, 0.075) !important;
}

#kt_app_sidebar .menu-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.085) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055) !important;
}

#kt_app_sidebar .menu-link .menu-title,
#kt_app_sidebar .menu-link .menu-icon i {
  color: inherit !important;
}

.asimov-projects-nav {
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.asimov-projects-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.85rem 0.5rem;
  color: #777a84;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.asimov-projects-link .menu-icon i {
  color: #c4c6cc !important;
}

.asimov-project-list {
  margin-top: 0.25rem;
}

.asimov-project-list .menu-link {
  min-height: 38px !important;
  padding-left: 1rem !important;
  font-size: 0.9rem;
}

.asimov-project-dot {
  width: 7px;
  height: 7px;
  margin-right: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.asimov-project-empty,
.asimov-project-loading {
  padding: 0.45rem 0.9rem;
  color: #6f727b;
  font-size: 0.82rem;
}

.asimov-trash-nav {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.asimov-drop-target {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  outline: 1px solid rgba(255, 255, 255, 0.16);
  outline-offset: -1px;
}

#file_manager_list tbody tr.asimov-dragging {
  opacity: 0.42;
}

/* Glass surfaces */
.card,
.modal-content,
.menu-sub-dropdown,
.toast {
  color: #eeeeef !important;
  background: var(--asimov-surface) !important;
  border: 1px solid var(--asimov-border) !important;
  border-radius: var(--asimov-radius) !important;
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  backdrop-filter: blur(22px) saturate(130%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 14px 42px rgba(0, 0, 0, 0.2) !important;
}

.card-header {
  overflow: visible !important;
  border-bottom-color: rgba(255, 255, 255, 0.075) !important;
}

.badge-light-primary {
  color: #f7f7f8 !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.text-primary,
.link-primary,
.text-hover-primary:hover,
.menu-state-color .menu-link:hover,
.menu-state-color .menu-link.active {
  color: #ffffff !important;
}

.text-gray-900,
.text-gray-800,
.text-gray-700 {
  color: #f0f0f1 !important;
}

.text-gray-600,
.text-gray-500,
.text-muted {
  color: var(--asimov-muted) !important;
}

/* Milk-glass controls */
.btn {
  border-radius: 12px !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease !important;
}

.btn-primary,
.btn-light-primary,
.btn-light,
.btn-secondary,
.btn-active-light-primary:hover,
.btn-active-light-primary.show {
  color: #f8f8f9 !important;
  background: rgba(255, 255, 255, 0.105) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  backdrop-filter: blur(14px) saturate(135%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.085) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-light-primary:hover,
.btn-light:hover,
.btn-secondary:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.165) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
}

.btn i,
.btn-primary i,
.btn-light i,
.btn-light-primary i {
  color: currentColor !important;
}

.form-control,
.form-select,
.form-control-solid,
.form-select-solid,
.select2-selection {
  color: #f4f4f5 !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.115) !important;
  border-radius: 13px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.075) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.055) !important;
}

.form-control::placeholder {
  color: #777a84 !important;
}

.form-check-input {
  background-color: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.form-check-input:checked {
  background-color: #e9e9eb !important;
  border-color: #e9e9eb !important;
}

/* Global search */
.asimov-global-search {
  width: min(560px, 42vw);
  z-index: 20;
}

.asimov-global-search > i {
  color: #9ea1aa !important;
}

#asimov_global_search {
  width: 100% !important;
  min-height: 48px;
  padding-right: 3rem !important;
  background: rgba(255, 255, 255, 0.065) !important;
}

.asimov-search-clear {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  z-index: 2;
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #a7a9b1;
  background: transparent;
  border: 0;
  border-radius: 9px;
  transform: translateY(-50%);
}

.asimov-search-clear:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.075);
}

.asimov-search-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  z-index: 110;
  width: min(680px, calc(100vw - 2rem));
  max-height: min(520px, 62vh);
  overflow: auto;
  padding: 0.55rem;
  background: rgba(17, 18, 21, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.asimov-search-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  color: #92959e;
  font-size: 0.82rem;
}

.asimov-search-refresh {
  padding: 0;
  color: #d8d9dc;
  background: transparent;
  border: 0;
  font-size: 0.82rem;
}

.asimov-search-result {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 56px;
  padding: 0.65rem 0.75rem;
  color: #f3f3f4;
  border: 1px solid transparent;
  border-radius: 12px;
}

.asimov-search-result:hover,
.asimov-search-result:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.08);
}

.asimov-search-result-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #d9dade;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.asimov-search-result-copy {
  min-width: 0;
}

.asimov-search-result-name,
.asimov-search-result-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asimov-search-result-name {
  font-weight: 650;
}

.asimov-search-result-path {
  margin-top: 0.1rem;
  color: #858892;
  font-size: 0.78rem;
}

/* File manager */
#kt_app_content_container {
  padding-top: 1.25rem !important;
}

#file_manager_list_container {
  overflow-x: auto;
}

#file_manager_list {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

#file_manager_list thead th {
  color: #7e818a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-block: 0.85rem !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.69rem !important;
}

#file_manager_list tbody tr {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  transition: background-color 130ms ease;
}

#file_manager_list tbody tr:hover {
  background: rgba(255, 255, 255, 0.045) !important;
}

#file_manager_list tbody td {
  padding-block: 0.95rem !important;
  border: 0 !important;
}

#file_manager_list tbody a.text-gray-800 {
  color: #f2f2f3 !important;
  font-size: 0.96rem;
  font-weight: 620;
}

#file_manager_list .ki-folder,
#file_manager_list .ki-file,
#file_manager_list .ki-file-right {
  color: #dfe0e3 !important;
}

.asimov-download-action {
  min-width: 108px;
}

.asimov-trash-action {
  color: #d8d9dc !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.asimov-trash-action:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

.asimov-keyboard-toast {
  position: fixed;
  right: 1.35rem;
  bottom: 1.35rem;
  z-index: 2200;
  padding: 0.8rem 1rem;
  color: #f6f6f7;
  background: rgba(24, 25, 29, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.asimov-keyboard-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dataTables_wrapper .dataTables_length {
  display: none !important;
}

.dataTables_wrapper .row:last-child {
  min-height: 44px;
  margin-top: 0.35rem;
  align-items: center;
}

.dataTables_wrapper .dataTables_info {
  padding-top: 0 !important;
  color: #777a84 !important;
  font-size: 0.8rem;
}

.pagination .page-link {
  color: #d8d9dc !important;
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.pagination .page-item.active .page-link {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.dropzone {
  color: #f0f0f1 !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px dashed rgba(255, 255, 255, 0.22) !important;
  border-radius: 16px !important;
}

.dropzone:hover {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(255, 255, 255, 0.34) !important;
}

.app-footer {
  display: none !important;
}

/* Login */
body.app-blank > #app_root > div {
  background: transparent !important;
}

body.app-blank .w-lg-500px,
body.app-blank .w-md-450px,
body.app-blank .w-sm-400px {
  width: min(500px, calc(100vw - 2rem)) !important;
  max-width: 500px !important;
  background: rgba(18, 19, 22, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 22px !important;
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  backdrop-filter: blur(24px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 18px 55px rgba(0, 0, 0, 0.3) !important;
}

body.app-blank #sign_in_form > .container.mb-10 {
  margin-bottom: 2.15rem !important;
  padding: 0 !important;
}

body.app-blank #sign_in_form > .container .row {
  display: block;
  margin: 0;
}

body.app-blank #sign_in_form > .container .col-5 {
  width: 100%;
  padding: 0;
}

body.app-blank #sign_in_form > .container .col-7 {
  display: none !important;
}

body.app-blank #sign_in_form > .container img {
  display: block;
  width: 300px !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain;
  object-position: left center;
}

body.app-blank #sign_in_submit {
  min-height: 50px;
}

@media (max-width: 991.98px) {
  #kt_app_sidebar {
    width: min(300px, 88vw) !important;
  }

  .card-header {
    gap: 1rem;
  }

  .card-title,
  .card-toolbar,
  .card-toolbar > div {
    width: 100%;
  }

  .asimov-global-search {
    width: 100%;
  }

  .card-toolbar .btn {
    flex: 1;
    justify-content: center;
  }

  .asimov-download-action {
    min-width: 38px;
  }

  .asimov-download-action span {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  body.app-blank .w-lg-500px,
  body.app-blank .w-md-450px,
  body.app-blank .w-sm-400px {
    padding: 1.5rem !important;
    border-radius: 18px !important;
  }

  #file_manager_list tbody td {
    padding-block: 0.78rem !important;
  }

  .asimov-search-panel {
    position: fixed;
    top: 5.25rem;
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
