/* Modul Cloud — Files app */

/* Viewport geometry is shared with the other workspaces in workspace-frame.css. */

/* VirtualList computes offsets using 44px list rows and 246x198px tiles.
 * Margins and scaled tile heights invalidate its padding and scroll anchor. */
#content-vue.app-files .files-list__row {
	margin-block: 0;
	transition: background-color var(--mt-duration-fast) var(--mt-ease-out);
}
#content-vue.app-files .files-list--grid .files-list__tbody {
	--row-height: 246px;
	--row-width: 198px;
}
#content-vue.app-files .files-list--grid .files-list__row {
	min-width: 0;
}

/* Sticky column headers must hide the rows passing underneath them. */
#content-vue.app-files .files-list__thead,
#content-vue.app-files .files-list__filters,
#content-vue.app-files .files-list__thead-overlay {
	background: var(--mt-surface);
}

/* Keep the action bar aligned to its list, including on wide monitors. */
#content-vue.app-files .files-list__header {
	max-width: 100%;
	margin-inline: calc(var(--default-clickable-area) + 2 * var(--app-navigation-padding, 4px)) var(--app-navigation-padding, 4px);
}
#content-vue.app-files .files-list {
	min-height: 0;
	scroll-behavior: auto;
	overflow-anchor: none;
}

/* Recommendations previously wrapped into a second line inside a fixed-height
 * clipped box. Bound long names to cards and keep one horizontally scrollable row. */
#content-vue.app-files #recommendations {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	height: auto;
	max-height: none;
	margin: 8px 0;
	padding: 8px 12px;
	overflow-x: auto;
	overflow-y: hidden;
}
#content-vue.app-files #recommendations .recommendation-item {
	flex: 0 0 260px;
	min-width: 0;
	max-width: 100%;
}
#content-vue.app-files #recommendations .recommendation {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
	min-height: 48px;
	padding: 4px;
	margin: 0;
}
#content-vue.app-files #recommendations .thumbnail {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	margin-inline-end: 10px;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}
#content-vue.app-files #recommendations .details {
	flex: 1 1 auto;
	min-width: 0;
}
#content-vue.app-files #recommendations .file-name,
#content-vue.app-files #recommendations .description {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.files-list__header {
	background: var(--mt-surface-panel);
	border-bottom: 1px solid var(--mt-border);
	border-radius: var(--mt-radius-card) var(--mt-radius-card) 0 0;
}

.files-list__header-grid-button,
.files-list__header-upload-button {
	border-radius: var(--mt-radius-control) !important;
}

/* List rows */
.files-list__row {
	border-radius: var(--mt-radius-control) !important;
	margin: 0;
	transition: background-color var(--mt-duration-fast) var(--mt-ease-out);
}
.files-list__row:hover {
	background-color: var(--mt-hover-bg) !important;
}
.files-list__row--active,
.files-list__row--selected {
	background-color: var(--mt-selected-bg) !important;
}
.files-list__row-icon-preview {
	border-radius: var(--mt-radius-xs) !important;
	overflow: hidden;
	}
.files-list__row-name-text {
	font-weight: 500;
}

/* Grid / tile mode: bigger cards with floating shadow */
.files-list--grid .files-list__row {
	border-radius: var(--mt-radius-card) !important;
	background: var(--mt-surface);
	box-shadow: var(--mt-shadow-sm);
	border: 1px solid var(--mt-border);
	transition: border-color var(--mt-duration-fast) var(--mt-ease), background-color var(--mt-duration-fast) var(--mt-ease);
}
.files-list--grid .files-list__row:hover {
	border-color: var(--mt-border-strong);
	background: var(--mt-surface-inset);
}
.files-list--grid .files-list__row-icon-preview {
	border-radius: var(--mt-radius-sm) var(--mt-radius-sm) 0 0 !important;
}

/* Folder color accent (relies on Nextcloud's own folder icon svg via mask;
   we simply give folder rows a soft brand-tinted icon backdrop) */
.files-list__row-icon:has(.folder-icon),
.files-list__row-icon[data-mimetype='httpd/unix-directory'] {
	position: relative;
}

/* Breadcrumbs */
.breadcrumbs, .files-list__breadcrumbs {
	padding: var(--mt-space-2) var(--mt-space-3);
}
.breadcrumbs .breadcrumb,
.breadcrumbs__crumb {
	border-radius: var(--mt-radius-xs) !important;
	transition: background-color var(--mt-duration-fast) var(--mt-ease-out);
}
.breadcrumbs .breadcrumb:hover {
	background-color: var(--mt-hover-bg-strong) !important;
}

/* Drag & drop states */
.files-list--dragover,
.app-content-drag-drop-notice {
	background: var(--mt-selected-bg) !important;
	border: 2px dashed var(--mt-primary) !important;
	border-radius: var(--mt-radius-card) !important;
	transition: background-color var(--mt-duration) var(--mt-ease-out), border-color var(--mt-duration) var(--mt-ease-out);
}

/* Upload progress */
.upload-picker__progress,
.new-file-menu, .files-list__row-status {
	border-radius: var(--mt-radius-control) !important;
}
