
/* Layout Grid 3fr:1fr */
.files-layout-wrapper {
  display: grid;
  grid-template-columns: 3fr auto;
  gap: 5px;
  height: 97.8%;
  overflow: hidden;
  padding: 10px 0 0 10px;
  background: var(--surface);
  border-radius: 25px;
}

/* Left Panel */
.files-main-panel {
  display: grid;
  grid-template-rows: 35px 1fr 0px;
  gap: .25rem;
  min-width: 0;
  /* Fix grid overflow */
  overflow: auto;
  height: 89vh;
  align-content: start;
}

/* Header Styling */
.files-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(182deg, var(--primary-faded), var(--bg));
  border-radius: 12px;
  padding: 0 10px;
}

.flsync-head {
  display: flex;
  position: sticky;
  top: 0;
  gap: 2px;
  background: linear-gradient(182deg, var(--primary-faded), var(--bg));
  justify-content: space-between;
  border-radius: 12px;
  padding: 9px 5px;
  align-items: center;
  z-index: 20;
}

.flsync-head h2 {
  margin: 0;
  font-size: 15px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Expandable Search */
.search-expander {
  display: flex;
  align-items: center;
  background: var(--primary-dark);
  border-radius: 99px;
  width: 25px;
  height: 25px;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1), background 0.3s;
  position: relative;
}

.search-expander.expanded {
  width: 240px;
  background: var(--surface, #fff);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--surface-2, #ddd);
}

.search-trigger-btn {
  min-width: 25px;
  height: 25px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
}

#fileSearchInput {
  border: none;
  background: transparent;
  outline: none;
  height: 100%;
  padding-right: 15px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.search-expander.expanded #fileSearchInput {
  opacity: 1;
  pointer-events: auto;
}

/* Header Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.clean-select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted, #666);
}

/* Grid/List View Modes */
.file-grid.list-mode {
  display: flex;
  flex-direction: column;
}

.file-grid.list-mode .file-card {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 .51rem;
  flex-direction: row !important;
  justify-content: space-between;
}

.file-grid.list-mode .file-hero {
  display: none !important;
}

.file-grid.list-mode .file-card header {
  display: contents;
  /* Flattens header children into the grid */
}

/* Right Sidebar */
.files-sidebar {
  border-left: 1px solid var(--primary-dark);
  padding: 0 5px 5px 5px;
  display: grid;
  grid-template-rows: 35px auto 1fr auto;
  overflow: clip;
  overflow-y: auto !important;
  scrollbar-width: none;
  user-select: none;
}

/* Usage Gauge Canvas */
.storage-gauge-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  border-radius: 999px;
  /* Pill shape container if desired, or just layout */
  background: transparent;
  flex-direction: column;
}

.usage-overlay {
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
  pointer-events: none;
  user-select: none;
}

.usage-big-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--text, #333);
}

.usage-sub-text {
  font-size: 11px;
  color: var(--text-muted, #888);
}

/* Blobs (File Types & Cloud) */
.sidebar-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted, #999);
  margin: 0;
}

.acns {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  align-items: flex-end;
}

.blob-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blob-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.3rem;
  background: var(--bg);
  border: var(--line);
  border-radius: 12px;
}

.blob-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--muted);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.blob-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blob-title {
  font-size: 13px;
  font-weight: 600;
}

.blob-meta {
  font-size: 10px;
  color: var(--text-muted, #777);
}

/* Cloud Progress Bar */
.cloud-prog-track {
  height: 4px;
  background: var(--dots);
  border-radius: 2px;
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
}

.cloud-prog-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 2px;
}

/* --- Added: File module enhancements --- */
.blob-row.filter {
  cursor: pointer;
  position: relative;
}

.blob-row.filter.active {
  animation: glow-border 1.6s ease-in-out infinite;
}

@keyframes glow-border {
  0% {
    box-shadow: 0 0 0px rgba(99, 102, 241, 0.0);
  }

  50% {
    box-shadow: 0 0 10px var(--primary);
  }

  100% {
    box-shadow: 0 0 0px rgba(99, 102, 241, 0.0);
  }
}

/* ===== Injected: Files module UX & Vault ===== */
.drop-overlay {
  position: fixed;
  pointer-events: none;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.25);
  z-index: 9999;
}

.drop-overlay .drop-overlay-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: .4rem .6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 12px;
}

.drop-overlay[hidden] {
  display: none !important
}

.crumb-overlay {
  position: fixed;
  z-index: 10000;
  display: flex;
  gap: .25rem;
  background: var(--surface);
  border: 1px solid var(--dots);
  border-radius: 999px;
  padding: .3rem .5rem;
  box-shadow: var(--shadow);
}

.crumb-overlay .pill {
  padding: .25rem .6rem;
  border: 1px dashed var(--primary);
  border-radius: 999px;
  cursor: copy;
}

.crumb-overlay .pill.hot {
  background: var(--primary-alpha);
}

.storage-gauge-container {
  perspective: 1200px;
  position: relative;
}

.sgc-face {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s;
}

.sgc-front {
  backface-visibility: hidden;
  transform: rotateY(0deg);
  display: flex;
  flex-direction: column;
}

.sgc-back {
  backface-visibility: hidden;
  transform: rotateY(-180deg);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.storage-gauge-container.flipped .sgc-front {
  transform: rotateY(180deg);
}

.storage-gauge-container.flipped .sgc-back {
  transform: rotateY(0deg);
}

.vault-back {
  display: grid;
  gap: .5rem;
  text-align: center;
}

.vault-title {
  font-weight: 600;
}

.vault-pin {
  text-align: center;
  font-size: 20px;
  letter-spacing: .4em;
  padding: .5rem 1rem;
}

.vault-hello {
  border-radius: 999px;
  padding: .3rem 1rem;
  border: var(--line);
  border-radius: 100%;
}

.vault-hint {
  user-select: none;
  font-size: 10px;
}

.vault-pin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.vault-pin-row button {
  position: absolute;
  right: 4%;
  align-self: center !important;
}

.file-card .file-del {
  display: none !important;
}

/* remove legacy */
.icon-btn.file-menu {
  font-size: 18px;
  line-height: 1;
}

.icon-btn.drag-handle {
  cursor: grab;
}

.crumb-overlay .pill {
  position: relative;
}

.crumb-overlay .pill .subfolders {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--dots);
  border-radius: 10px;
  padding: .25rem .4rem;
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  white-space: nowrap;
}

.breadcrumbs {
  padding: .25rem .5rem;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: .1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  align-content: flex-start;
}

.breadcrumbs a {
  background: var(--bg);
  border-radius: 7px;
  padding: 0 4px;
  color: var(--primary-light);
  text-decoration: none;
  text-wrap-mode: nowrap
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* --- Split mode: separate filter blocks (App + Cloud) --- */
#fileTypeList .ft-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px dashed var(--dots);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

#fileTypeList .ft-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted, #888);
  padding: 0 4px;
}

#fileTypeList .ft-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Split hint --- */
.split-hint.is-anim {
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.25));
}

/* --- Vault reset modal animations --- */
.vault-reset-card .vault-step {
  display: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2, .8, .2, 1);
}

.vault-reset-card .vault-step.is-active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.vault-reset-card .vault-step.is-leave {
  opacity: 0;
  transform: translateX(-10px);
}

.vault-reset-success {
  display: grid;
  place-items: center;
  padding: 12px 0 8px;
}

.vault-reset-success .ok {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  animation: vr-pop .55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes vr-pop {
  from {
    transform: scale(.8);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

.modal.large .modal-card {
  width: min(900px, 90vw);
}

.modal.xl .modal-card {
  width: min(1000px, 95vw);
}

.previewer .modal-body {
  background: var(--bg);
}

.previewer textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.filemgr .fm-tree .tree {
  list-style: none;
  padding-left: 1rem;
}

.filemgr .fm-tree .tree li {
  margin: .25rem 0;
}

.filemgr .fm-tree a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  gap: .25rem;
  align-items: center;
  padding: .15rem .25rem;
  border-radius: 6px;
}

.filemgr .fm-tree a.sel {
  background: var(--muted);
}

.split-hint {
  margin-left: 1rem;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.split-hint .glow {
  font-weight: 700;
  animation: glow-text 1s ease-in-out infinite alternate;
}

@keyframes glow-text {
  0% {
    text-shadow: 0 0 0 rgba(99, 102, 241, 0.0);
  }

  100% {
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
  }
}