/* Ubuntu Web — Files (Nautilus) styles. All selectors scoped under .app-files. */

.app-files .files-root {
  flex: 1;
  min-height: 0;
  display: flex;
  outline: none;
}

/* ---------- headerbar ---------- */

.app-files .files-headleft {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.app-files .files-navbox {
  display: flex;
  gap: 2px;
  flex: none;
}
.app-files .files-headright { display: flex; align-items: center; gap: 4px; }

.app-files .files-crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  background: var(--btn-bg);
  border-radius: 8px;
  padding: 2px 4px;
}
.app-files .crumb {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.app-files .crumb:hover { background: var(--hover); color: var(--fg); }
.app-files .crumb.current { color: var(--fg); font-weight: 700; }
.app-files .crumb-sep { color: var(--fg-faint); font-size: 12px; flex: none; }

.app-files .files-search {
  display: none;
  width: 220px;
  padding: 5px 10px;
  font-size: 13px;
}
.app-files .files-headleft.searching .files-crumbs { display: none; }
.app-files .files-headleft.searching .files-search { display: block; }

.app-files .files-headleft .btn:disabled { opacity: 0.35; }

/* ---------- sidebar ---------- */

.app-files .files-side {
  width: 184px;
  flex: none;
  background: var(--win-bg2);
  border-right: 1px solid var(--border);
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.app-files .side-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--fg);
  text-align: left;
  flex: none;
}
.app-files .side-row:hover { background: var(--hover); }
.app-files .side-row.active {
  background: rgba(var(--accent-rgb), 0.16);
}
.app-files .side-row.active .side-icon { color: var(--accent); }
.app-files .side-icon { display: inline-flex; color: var(--fg-dim); flex: none; }
.app-files .side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-files .side-badge {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--btn-bg);
  color: var(--fg-dim);
}
.app-files .side-sep { height: 1px; background: var(--border); margin: 6px 4px; flex: none; }

/* ---------- main view ---------- */

.app-files .files-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--view-bg);
}
.app-files .files-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  position: relative;
}

/* ---------- grid view ---------- */

.app-files .fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 2px;
  align-content: start;
}
.app-files .fitem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 8px;
  border-radius: 9px;
  cursor: default;
  min-width: 0;
}
.app-files .fitem:hover { background: var(--hover); }
.app-files .fitem.selected {
  background: rgba(var(--accent-rgb), 0.18);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.45);
}
.app-files .fitem-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.app-files .fitem-icon > svg { width: 64px; height: 64px; }
.app-files .fitem-frame {
  max-width: 62px;
  max-height: 58px;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  display: flex;
}
.app-files .fitem-thumb {
  max-width: 54px;
  max-height: 48px;
  object-fit: cover;
  border-radius: 1px;
  display: block;
}
.app-files .fitem-name {
  font-size: 12.5px;
  line-height: 1.25;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  max-width: 100%;
}

/* rename entry (both views) */
.app-files .fitem-rename {
  width: 100%;
  max-width: 150px;
  font-size: 12.5px;
  padding: 3px 6px;
  text-align: center;
}
.app-files .flist-row .fitem-rename { text-align: left; max-width: 240px; }
.app-files .fitem-rename.error { outline-color: #c01c28; }

/* ---------- list view ---------- */

.app-files .flist { display: flex; flex-direction: column; min-width: 460px; }
.app-files .flist-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 130px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: -10px;               /* counter view padding so it truly sticks */
  background: var(--view-bg);
  z-index: 2;
}
.app-files .flist-col {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-dim);
  text-align: left;
}
.app-files .flist-col:hover { background: var(--hover); }
.app-files .flist-col.sorted { color: var(--fg); }
.app-files .sort-arrow { display: inline-flex; }

.app-files .flist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 130px;
  align-items: center;
  border-radius: 6px;
  cursor: default;
}
.app-files .flist-row:hover { background: var(--hover); }
.app-files .flist-row.selected {
  background: rgba(var(--accent-rgb), 0.18);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.45);
}
.app-files .flist-name {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  min-width: 0;
}
.app-files .flist-icon { flex: none; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; }
.app-files .flist-icon svg { width: 24px; height: 24px; }
.app-files .flist-icon .fitem-frame { max-width: 24px; max-height: 24px; padding: 1px; border-radius: 2px; box-shadow: none; }
.app-files .flist-icon .fitem-thumb { max-width: 20px; max-height: 20px; }
.app-files .flist-label {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-files .flist-size, .app-files .flist-date {
  font-size: 12.5px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* ---------- empty states ---------- */

.app-files .files-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.app-files .files-empty-icon {
  width: 110px;
  height: 110px;
  opacity: 0.22;
  color: var(--fg-faint);
}
.app-files .files-empty-icon svg { width: 110px; height: 110px; }
.app-files .files-empty-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--fg-dim);
}
.app-files .files-empty-sub { font-size: 13px; color: var(--fg-faint); }

/* ---------- trash bar ---------- */

.app-files .trash-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--win-bg2);
  border: 1px solid var(--border);
}
.app-files .trash-bar-text { font-size: 12.8px; color: var(--fg-dim); }
.app-files .trash-bar .btn { font-size: 12.8px; padding: 4px 12px; flex: none; }
.app-files .trash-empty-btn { color: #c01c28; }
:root[data-scheme="dark"] .app-files .trash-empty-btn { color: #ff7b63; }

/* ---------- other locations ---------- */

.app-files .other-view { padding: 18px 22px; }
.app-files .other-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-faint);
  margin-bottom: 10px;
}
.app-files .drive-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  text-align: left;
}
.app-files .drive-row:hover { background: var(--hover); }
.app-files .drive-icon { flex: none; color: var(--fg-dim); }
.app-files .drive-icon svg { width: 34px; height: 34px; }
.app-files .drive-text { flex: 1; min-width: 0; }
.app-files .drive-title { font-weight: 600; font-size: 14px; }
.app-files .drive-sub { font-size: 12.5px; color: var(--fg-dim); margin-bottom: 7px; }
.app-files .drive-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--btn-bg);
  overflow: hidden;
}
.app-files .drive-bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.app-files .drive-free { font-size: 11.5px; color: var(--fg-faint); margin-top: 5px; }

/* ---------- dialogs (properties / preferences) ---------- */

.app-files.files-props {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  padding: 4px 2px;
}
.app-files.files-props .files-prop-row { display: flex; gap: 12px; font-size: 13px; }
.app-files.files-props .files-prop-key { flex: none; width: 84px; color: var(--fg-faint); text-align: right; }
.app-files.files-props .files-prop-val { flex: 1; min-width: 0; word-break: break-word; color: var(--fg); }

.app-files.files-prefs { display: flex; flex-direction: column; gap: 4px; padding: 2px 4px; }
.app-files.files-prefs .files-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 6px;
  font-size: 13.5px;
  color: var(--fg);
}
