.fbum-manager {
	display: flex;
	gap: 20px;
	min-height: 600px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
}

.fbum-sidebar {
	width: 30%;
	min-width: 250px;
	border-right: 1px solid #ddd;
	background: #f9f9f9;
	display: flex;
	flex-direction: column;
}

.fbum-sidebar-header {
	padding: 20px;
	border-bottom: 1px solid #ddd;
	background: #fff;
}

.fbum-sidebar-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.fbum-folder-tree {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
}

.fbum-loading {
	text-align: center;
	padding: 20px;
	color: #666;
}

.fbum-folder {
	padding: 8px 12px;
	margin: 2px 0;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.2s;
	user-select: none;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.fbum-folder:hover {
	background: #e9ecef;
}

.fbum-folder.fbum-folder-selected {
	background: #007cba;
	color: #fff;
}

.fbum-folder.fbum-folder-drag-over {
	background: #d4edda;
	border: 2px dashed #28a745;
}

.fbum-folder-icon {
	font-size: 14px;
	width: 16px;
	text-align: center;
}

.fbum-folder-toggle {
	font-size: 12px;
	cursor: pointer;
	transition: transform 0.2s;
	width: 12px;
	text-align: center;
}

.fbum-folder-toggle.fbum-expanded {
	transform: rotate(90deg);
}

.fbum-folder-name {
	flex: 1;
}

.fbum-folder-count {
	font-size: 12px;
	color: #666;
	margin-left: auto;
	padding-left: 8px;
}

.fbum-folder.fbum-folder-selected .fbum-folder-count {
	color: rgba(255, 255, 255, 0.8);
}

.fbum-folder-children {
	margin-left: 24px;
	padding-left: 8px;
	border-left: 2px solid #e0e0e0;
	margin-top: 4px;
	margin-bottom: 4px;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease-out;
}

.fbum-folder-children.fbum-expanded {
	max-height: 5000px;
}

/* Nested subfolder styling - adds visual hierarchy */
.fbum-folder-children .fbum-folder-children {
	border-left-color: #d0d0d0;
}

.fbum-folder-children .fbum-folder-children .fbum-folder-children {
	border-left-color: #c0c0c0;
}

.fbum-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 20px;
	overflow-y: auto;
}

/* Breadcrumbs */
.fbum-breadcrumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	background: #f8f9fa;
	border-radius: 6px;
	margin-bottom: 20px;
	border: 1px solid #e0e0e0;
	font-size: 14px;
}

.fbum-breadcrumb-item {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

.fbum-breadcrumb-link {
	color: #007cba;
	cursor: pointer;
	transition: all 0.2s;
	padding: 4px 8px;
	border-radius: 4px;
}

.fbum-breadcrumb-link:hover {
	color: #0056b3;
	background: #e3f2fd;
	text-decoration: underline;
}

.fbum-breadcrumb-current {
	color: #333;
	font-weight: 600;
	padding: 4px 8px;
}

.fbum-breadcrumb-separator {
	color: #999;
	font-size: 11px;
	margin: 0 4px;
	display: inline-flex;
	align-items: center;
}

.fbum-upload-zone {
	margin-bottom: 20px;
}

.fbum-upload-area {
	border: 2px dashed #ccc;
	border-radius: 8px;
	padding: 40px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s;
	background: #fafafa;
}

.fbum-upload-area:hover {
	border-color: #007cba;
	background: #f0f8ff;
}

.fbum-upload-area.fbum-drag-over {
	border-color: #007cba;
	background: #e3f2fd;
	transform: scale(1.02);
}

.fbum-upload-area i {
	font-size: 48px;
	color: #007cba;
	margin-bottom: 10px;
}

.fbum-upload-area p {
	margin: 10px 0 0;
	color: #666;
	font-size: 14px;
}

.fbum-upload-progress {
	margin-top: 20px;
}

.fbum-progress-bar {
	height: 30px;
	background: #e9ecef;
	border-radius: 15px;
	overflow: hidden;
	position: relative;
}

.fbum-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #007cba, #00a0d2);
	transition: width 0.3s;
	width: 0;
}

.fbum-progress-text {
	text-align: center;
	margin-top: 10px;
	font-weight: 600;
	color: #333;
}

.fbum-file-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 20px;
	flex: 1;
}

.fbum-empty-state {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: #999;
}

.fbum-empty-state i {
	font-size: 64px;
	margin-bottom: 20px;
	display: block;
}

.fbum-empty-state p {
	font-size: 16px;
	margin: 0;
}

.fbum-file-item {
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
	background: #fff;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.fbum-file-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.fbum-file-item.fbum-dragging {
	opacity: 0.5;
	cursor: move;
}

.fbum-file-thumbnail {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 8px;
	background: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.fbum-file-thumbnail img,
.fbum-file-thumbnail canvas {
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	object-fit: contain;
}

.fbum-file-thumbnail i {
	font-size: 48px;
	color: #999;
}

.fbum-file-name {
	font-size: 12px;
	color: #333;
	word-wrap: break-word;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	width: 100%;
}

/* Folder item styling in file grid */
.fbum-folder-item {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 2px solid #007cba;
}

.fbum-folder-item:hover {
	background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
	border-color: #0056b3;
}

.fbum-folder-thumbnail {
	background: transparent !important;
}

.fbum-folder-thumbnail i {
	font-size: 64px !important;
	color: #007cba;
}

.fbum-folder-item:hover .fbum-folder-thumbnail i {
	color: #0056b3;
}

.fbum-folder-file-count {
	font-size: 11px;
	color: #666;
	margin-top: 4px;
	font-weight: 500;
}

.fbum-modal {
	display: none;
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	animation: fadeIn 0.2s;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.fbum-modal-content {
	background: #fff;
	margin: 10% auto;
	padding: 30px;
	border-radius: 8px;
	max-width: 500px;
	position: relative;
	animation: slideIn 0.3s;
}

@keyframes slideIn {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.fbum-modal-close {
	position: absolute;
	right: 15px;
	top: 15px;
	font-size: 28px;
	font-weight: bold;
	color: #aaa;
	cursor: pointer;
	line-height: 20px;
}

.fbum-modal-close:hover {
	color: #000;
}

.fbum-modal-content h3 {
	margin: 0 0 20px;
	font-size: 20px;
	color: #333;
}

.fbum-modal-body {
	margin-bottom: 20px;
}

.fbum-modal-body input[type="text"],
.fbum-modal-body select {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.fbum-modal-body label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
}

.fbum-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.fbum-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.2s;
}

.fbum-btn-primary {
	background: #007cba;
	color: #fff;
}

.fbum-btn-primary:hover {
	background: #006ba1;
}

.fbum-btn-secondary {
	background: #f0f0f0;
	color: #333;
}

.fbum-btn-secondary:hover {
	background: #e0e0e0;
}

.fbum-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.fbum-folder-tree-select {
	max-height: 300px;
	overflow-y: auto;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 10px;
	background: #f9f9f9;
}

.fbum-folder-tree-select .fbum-folder {
	margin: 2px 0;
}

.fbum-warning {
	padding: 12px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
	margin-bottom: 15px;
}

.fbum-warning i {
	margin-right: 8px;
}

@media (max-width: 768px) {
	.fbum-manager {
		flex-direction: column;
	}

	.fbum-sidebar {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #ddd;
		max-height: 300px;
	}

	.fbum-file-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 15px;
	}

	.fbum-file-thumbnail {
		height: 100px;
	}

	.fbum-upload-area {
		padding: 30px 20px;
	}

	.fbum-upload-area i {
		font-size: 36px;
	}

	.fbum-modal-content {
		margin: 20% auto;
		padding: 20px;
		max-width: 90%;
	}
}

.fbum-context-menu {
	position: fixed;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 10000;
	min-width: 180px;
	padding: 4px 0;
}

.fbum-context-menu-item {
	padding: 10px 16px;
	cursor: pointer;
	transition: background-color 0.2s;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: #333;
}

.fbum-context-menu-item i {
	width: 16px;
	text-align: center;
	color: #666;
}

.fbum-context-menu-item:hover {
	background: #f5f5f5;
}

.fbum-toast-container {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 400px;
}

.fbum-toast {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 300px;
	animation: fbumToastSlideIn 0.3s ease-out;
	position: relative;
	overflow: hidden;
}

.fbum-toast.fbum-toast-success {
	border-left: 4px solid #28a745;
}

.fbum-toast.fbum-toast-error {
	border-left: 4px solid #dc3545;
}

.fbum-toast-icon {
	font-size: 20px;
	flex-shrink: 0;
}

.fbum-toast-success .fbum-toast-icon {
	color: #28a745;
}

.fbum-toast-error .fbum-toast-icon {
	color: #dc3545;
}

.fbum-toast-message {
	flex: 1;
	color: #333;
	font-size: 14px;
	line-height: 1.4;
}

.fbum-toast-close {
	cursor: pointer;
	font-size: 20px;
	color: #999;
	line-height: 1;
	padding: 0;
	background: none;
	border: none;
	flex-shrink: 0;
}

.fbum-toast-close:hover {
	color: #333;
}

.fbum-toast.fbum-toast-removing {
	animation: fbumToastSlideOut 0.3s ease-out forwards;
}

@keyframes fbumToastSlideIn {
	from {
		transform: translateX(400px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes fbumToastSlideOut {
	from {
		transform: translateX(0);
		opacity: 1;
	}
	to {
		transform: translateX(400px);
		opacity: 0;
	}
}

@media (max-width: 768px) {
	.fbum-toast-container {
		bottom: 10px;
		right: 10px;
		left: 10px;
		max-width: none;
	}

	.fbum-toast {
		min-width: auto;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.fbum-file-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
		gap: 10px;
	}

	.fbum-file-thumbnail {
		height: 80px;
	}

	.fbum-file-name {
		font-size: 11px;
	}

	.fbum-toast {
		padding: 12px 16px;
		font-size: 13px;
	}
}
