/* Проводник (модальное окно) — в стиле основного сайта ntrip.host */

.fm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fm-fade .18s ease-out;
}
.fm-overlay.closing { animation: fm-fade-out .15s ease-in forwards; }
.fm-overlay.closing .fm-window { animation: fm-pop-out .15s ease-in forwards; }

.fm-window {
  position: relative;
  width: min(1120px, 100%);
  height: min(800px, 100%);
  display: flex;
  flex-direction: column;
  background: rgba(20, 24, 31, .98);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  overflow: hidden;
  outline: none;
  animation: fm-pop .24s cubic-bezier(.2, .9, .3, 1.1);
}

@keyframes fm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fm-fade-out { to { opacity: 0; } }
@keyframes fm-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fm-pop-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fm-slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes fm-slide-up { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes fm-open { to { transform: scale(1.07); opacity: .8; box-shadow: 0 0 0 3px var(--brand), 0 14px 44px rgba(47, 111, 237, .5); } }
@keyframes fm-menu-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.fm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.fm-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-nav { display: flex; align-items: center; gap: 8px; padding: 10px 16px 6px; }
.fm-nav .form-control { width: 180px; flex-shrink: 0; }
.fm-crumbs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}
.fm-crumb { background: none; border: 0; color: #cbd2d9; padding: 2px 6px; border-radius: 5px; white-space: nowrap; font-size: 14px; }
button.fm-crumb:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.fm-crumb.current { color: #fff; font-weight: 600; }
.fm-crumb-sep { color: #6b7280; font-size: 11px; }

.fm-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.fm-tools-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .1); margin: 0 4px; }

.fm-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; }
.fm-view { min-height: 100%; padding: 8px 16px 16px; }
.fm-view.slide-in { animation: fm-slide-in .24s ease-out; }
.fm-view.slide-up { animation: fm-slide-up .24s ease-out; }
.fm-body.dragging { outline: 2px dashed var(--brand); outline-offset: -8px; }
.fm-drop-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  background: rgba(47, 111, 237, .16);
  pointer-events: none;
}

.fm-jobs {
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  max-height: 170px;
  overflow-y: auto;
  background: rgba(255, 255, 255, .03);
}
.fm-job { padding: 4px 0; }
.fm-job-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.fm-job .progress { height: 6px; margin-top: 4px; }
.fm-foot { padding: 7px 16px; font-size: 13px; color: #8b95a5; border-top: 1px solid rgba(255, 255, 255, .06); min-height: 34px; }

/* Диски-плитки */
.fm-disks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding-top: 8px; }
.fm-disk {
  text-align: left;
  color: #e5e7eb;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.fm-disk:hover, .fm-disk:focus-visible {
  transform: translateY(-3px);
  border-color: var(--brand);
  background: rgba(47, 111, 237, .1);
  outline: none;
}
.fm-disk.selected { border-color: var(--brand); background: rgba(47, 111, 237, .16); box-shadow: 0 0 0 1px var(--brand); }
.fm-disk.opening { animation: fm-open .22s ease-in forwards; }
.fm-disk-icon { font-size: 34px; color: var(--brand); line-height: 1; margin-bottom: 10px; }
.fm-disk-name { font-weight: 600; overflow-wrap: anywhere; }
.fm-disk .progress { height: 6px; margin: 10px 0 6px; }

/* Список файлов */
.fm-table { width: 100%; margin: 0; }
.fm-table th { cursor: pointer; user-select: none; }
.fm-table th.no-sort { cursor: default; }
.fm-table td, .fm-table th { white-space: nowrap; }
.fm-table td.fm-name { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fm-row { cursor: default; user-select: none; }
.table-clean > tbody > tr.fm-row.selected > * { background-color: rgba(47, 111, 237, .24) !important; }
.fm-row .bi-folder-fill { color: #f0b429; }
.fm-row .fm-ico { margin-right: 8px; }
.fm-row.cut { opacity: .5; }
.fm-kebab { background: none; border: 0; color: #9ca3af; padding: 0 6px; border-radius: 5px; }
.fm-kebab:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.fm-empty { padding: 48px 0; text-align: center; color: #8b95a5; }

/* Просмотр / свойства */
.fm-preview {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: rgba(20, 24, 31, .99);
  animation: fm-fade .15s ease-out;
}
.fm-preview-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px; }
.fm-preview-body img { max-width: 100%; max-height: 100%; display: block; margin: 0 auto; border-radius: 6px; }
.fm-preview-body .out { margin: 0; }

/* Контекстное меню */
.fm-menu {
  position: fixed;
  z-index: 1300;
  min-width: 240px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(27, 32, 40, .99);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
  animation: fm-menu-in .12s ease-out;
}
.fm-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: #e5e7eb;
  text-align: left;
  font-size: 14px;
}
.fm-menu-item:hover:not(:disabled), .fm-menu-item:focus-visible { background: rgba(255, 255, 255, .09); outline: none; }
.fm-menu-item:disabled { opacity: .38; }
.fm-menu-item.danger { color: #f06a6a; }
.fm-menu-item kbd { margin-left: auto; padding: 0; background: none; color: #8b95a5; font-size: 12px; }
.fm-menu-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 5px 2px; }

/* Диски в карточке «Сервер» открываются в проводнике */
.disk-link {
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -8px 4px;
  transition: background .15s ease, transform .15s ease;
}
.disk-link:hover, .disk-link:focus-visible { background: rgba(47, 111, 237, .14); outline: none; transform: translateX(2px); }

@media (max-width: 767.98px) {
  .fm-overlay { padding: 0; }
  .fm-window { height: 100%; border-radius: 0; }
  .fm-nav .form-control { width: 110px; }
  .fm-tools .btn span { display: none; }
  .fm-hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-overlay, .fm-window, .fm-view, .fm-disk.opening, .fm-menu, .fm-preview { animation: none !important; }
  .fm-disk, .disk-link { transition: none; }
}
