/* ========================= */
/* FINDER — macOS style      */
/* ========================= */

/* Rimuove padding dal window-body */
.finder-body {
	padding: 0 !important;
	overflow: hidden !important;
	height: calc(100% - 40px);
}

.finder {
	display: flex;
	height: 100%;
	background: #1e1e1e;
	overflow: hidden;
}


/* ========================= */
/* SIDEBAR                   */
/* ========================= */

.finder-sidebar {
	width: 200px;
	min-width: 200px;
	background: #242424;
	border-right: 1px solid rgba(255,255,255,0.06);
	display: flex;
	flex-direction: column;
	padding: 12px 0;
	overflow-y: auto;
	user-select: none;
}

.finder-sidebar-section {
	margin-bottom: 8px;
}

.finder-sidebar-label {
	font-size: 11px;
	font-weight: 600;
	color: rgba(255,255,255,0.3);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 6px 16px 4px;
}
.finder-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px;
	margin: 1px 8px;
	border-radius: 6px;
	color: rgba(255,255,255,0.75);
	font-size: 13px;
	cursor: default;
	transition: background 0.1s;
}
.finder-item:hover {
	background: rgba(255,255,255,0.07);
}
.finder-item.active {
	background: #9A6AFF;
	color: white;
}
.finder-item-icon {
	width: 18px;
	height: 18px;
	object-fit: contain;
	flex-shrink: 0;
}
.finder-sidebar .finder-item span {
	font-size: 14px;
	font-weight: 500;
	width: 100%;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}


/* ========================= */
/* MAIN (toolbar + content)  */
/* ========================= */

.finder-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}


/* TOOLBAR INTERNA */
.finder-toolbar {
	height: 38px;
	background: #1e1e1e;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	display: flex;
	align-items: center;
	padding: 0 16px;
	flex-shrink: 0;
}

.finder-current-title {
	font-size: 13px;
	font-weight: 600;
	color: rgba(255,255,255,0.85);
}


/* CONTENT */
.finder-content {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.finder-content::-webkit-scrollbar { width: 6px; }
.finder-content::-webkit-scrollbar-track { background: transparent; }
.finder-content::-webkit-scrollbar-thumb {
	background: rgba(255,255,255,0.15);
	border-radius: 3px;
}


/* GRIGLIA */
.finder-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, 100px);
	gap: 8px;
	align-content: start;
}


/* FILE */
.finder-file {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 8px 4px;
	border-radius: 8px;
	cursor: default;
	user-select: none;
	transition: background 0.1s;
}

.finder-file:hover {
	background: rgba(255,255,255,0.06);
}

.finder-file.selected {
	background: rgba(154, 106, 255, 0.25);
}

.finder-file.selected span {
	background: #9A6AFF;
	color: white;
	border-radius: 4px;
	padding: 1px 5px;
}
.finder-file-icon {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
}

.finder-file-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.finder-file span {
	color: white;
	font-size: 14px;
	font-weight: 400;
	text-align: center;
	line-height: 1.3;
	padding: 1px 5px;
	max-width: 82px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
}


/* STATUSBAR */
.finder-statusbar {
	height: 24px;
	background: #1a1a1a;
	border-top: 1px solid rgba(255,255,255,0.06);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#finder-file-count {
	font-size: 11px;
	color: rgba(255,255,255,0.35);
}


/* LOADING */
.finder-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
}

.finder-spinner {
	width: 24px;
	height: 24px;
	border: 2px solid rgba(255,255,255,0.1);
	border-top-color: rgba(255,255,255,0.5);
	border-radius: 50%;
	animation: finder-spin 0.7s linear infinite;
}

@keyframes finder-spin {
	to { transform: rotate(360deg); }
}


/* EMPTY STATE */
.finder-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
	color: rgba(255,255,255,0.25);
	font-size: 13px;
}



/* ========================= */
/* RESPONSIVE — MOBILE       */
/* ========================= */

@media (max-width: 768px) {
	.finder-sidebar {
		width: 140px;
		min-width: 140px;
	}
	.finder-grid {
		grid-template-columns: 1fr 1fr;
	}
}