html, body {
	width: 100%;
	height: 100vh;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.app-layout {
	display: flex;
	width: 100%;
	height: 100vh;
}

.sidebar {
	width: 300px;
	min-width: 300px;
	max-width: 300px;
	height: 100%;
	background-color: #f8f9fa;
	border-left: 1px solid #e0e0e0;
	display: flex;
	flex-direction: column;
	box-shadow: -2px 0 10px rgba(0,0,0,0.05);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#map {
	flex: 1;
	min-width: 0;
	height: 100%;
}

.sidebar-header {
	display: flex !important;
	flex-direction: row !important;
	justify-content: space-between !important;
	align-items: center !important;
	padding: 12px 15px !important;
	border-bottom: 1px solid #eee !important;
	background-color: #fff !important;
	box-sizing: border-box !important;
	width: 100% !important;
}

.sidebar-header .sidebar-title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	display: inline-block !important;
	color: #333;
}

.rescan-btn {
	background: none !important;
	border: 1px solid #e0e0e0 !important;
	color: #555 !important;
	cursor: pointer !important;
	padding: 5px !important;
	border-radius: 6px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.2s ease !important;
	box-sizing: border-box !important;
}

.rescan-btn:hover {
	background-color: #f5f5f5 !important;
	border-color: #ff3344 !important;
	color: #ff3344 !important;
}

.rescan-btn:active { 
	transform: scale(0.95); 
}

.rescan-btn.loading .rescan-icon {
	animation: spinRotate 1s linear infinite;
	color: #ff3344;
}

@keyframes spinRotate {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.file-list {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
}

.file-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	padding-right: 80px !important;
	margin-bottom: 8px;
	background: #fff;
	border: 1px solid #eef0f2;
	border-radius: 8px;
	position: relative !important;
	padding-right: 55px !important;
	cursor: default !important;
}

.file-item:hover,
.file-item.highlighted {
	border-color: #ff3344;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	background-color: #fffdfd;
}

.file-item-thumb {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 4px;
	background-color: #eee;
	cursor: pointer !important;
}

.file-item-info {
	flex: 1;
	min-width: 0;
	cursor: pointer !important;
}

.file-item-name {
	font-size: 13px;
	font-weight: 500;
	color: #333;
	margin: 0 0 2px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.file-item-desc {
	font-size: 11px;
	color: #777;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.file-item-delete {
	position: absolute !important;
	right: 10px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	background: none !important;
	color: #ccc !important;
	border: none !important;
	font-size: 22px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	z-index: 999 !important;
	padding: 0 4px !important;
	transition: color 0.2s, transform 0.2s !important;
}

.file-item-delete:hover {
	color: #ff3344 !important;
	transform: translateY(-50%) scale(1.2) !important;
}

.map-dot {
	width: 9px;
	height: 9px;
	background-color: #ff3344;
	border: 3px solid white;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0,0,0,0.3);
	cursor: grab;
	position: absolute;
	transform: translate(-50%, -50%);
}

.map-dot:active { 
	cursor: grabbing; 
}

.map-dot:hover { 
	background-color: #00cc66; 
	transform: translate(-50%, -50%) scale(1.2); 
}

.hover-balloon {
	background: white;
	padding: 10px;
	padding-bottom: 25px;
	margin-bottom: -15px;
	border-radius: 12px;
	box-shadow: 0 4px 25px rgba(0,0,0,0.25);
	width: 220px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	position: absolute;
	transform: translate(-50%, -115%);
	z-index: 1000;
	pointer-events: auto; 
}

.balloon-photo {
	width: 100%;
	height: 130px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 6px;
	cursor: pointer;
	transition: opacity 0.2s;
}

.balloon-photo:hover { 
	opacity: 0.9; 
}

.balloon-caption { 
	font-size: 13px; 
	line-height: 1.4; 
	color: #333; 
	margin: 0 0 6px 0; 
}

.balloon-date { 
	font-size: 11px; 
	color: #888; 
	margin: 0; 
	border-top: 1px solid #eee; 
	padding-top: 4px; 
}

.modal-overlay {
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background-color: rgba(0, 0, 0, 0.85);
	display: flex; justify-content: center; align-items: center;
	z-index: 9999; opacity: 0; pointer-events: none;
	transition: opacity 0.3s ease;
}

.modal-overlay.active { 
	opacity: 1; 
	pointer-events: auto; 
}

.modal-content { 
	position: relative; 
	max-width: 90%; 
	max-height: 90%; 
}

.modal-image { 
	max-width: 100%; 
	max-height: 85vh; 
	display: block; 
	border-radius: 8px; 
	box-shadow: 0 4px 30px rgba(0,0,0,0.5); 
}

.modal-close { 
	position: absolute; 
	top: -40px; 
	right: 0; 
	color: white; 
	font-size: 35px; 
	background: none; 
	border: none; 
	cursor: pointer; 
	line-height: 1; 
	transition: transform 0.2s; 
}

.modal-close:hover { 
	transform: scale(1.1); 
	color: #ff3344; 
}

.toast-notification {
	position: fixed;
	bottom: 20px;
	left: 20px;
	background: rgba(30, 30, 30, 0.95);
	color: #fff;
	padding: 12px 18px;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.4;
	z-index: 10000;
	width: 320px;
	max-height: 160px;
	overflow-y: auto;
	border-left: 4px solid #00cc66;
	animation: toastFadeIn 0.3s ease-out;
	white-space: pre; 
	overflow-x: hidden;
}

.upload-section {
	padding: 10px;
	background-color: #fff;
	border-top: 1px solid #eee;
}

.drop-zone {
	border: 2px dashed #ccc;
	border-radius: 8px;
	padding: 15px;
	text-align: center;
	background-color: #fbfbfb;
	cursor: pointer;
	position: relative;
	transition: all 0.2s ease;
}

.drop-zone.dragover {
	border-color: #00cc66;
	background-color: #f0fbf5;
	color: #00cc66;
}

.drop-zone-text {
	font-size: 12px;
	color: #666;
	pointer-events: none;
}

.file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.modal-content {
	position: relative;
	min-height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-loader {
	display: none;
	position: absolute;
	width: 40px;
	height: 40px;
	border: 4px solid rgba(0, 0, 0, 0.1);
	border-left-color: #fc0;
	border-radius: 50%;
	animation: modal-spin 1s linear infinite;
	z-index: 10;
}

@keyframes modal-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.modal-image {
	opacity: 0;
	transition: opacity 0.3s ease;
}

.modal-image.loaded {
	opacity: 1;
}

.hover-balloon {
	width: 150px;
	height: auto;
	padding: 8px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.balloon-photo-container {
	width: 100%;
	height: auto;
	overflow: hidden;
	border-radius: 4px;
	background: #f5f5f5;
}

.balloon-caption {
	margin: 6px 0 2px 0;
	font-size: 12px;
	word-wrap: break-word;
}

.toast-notification.toast-error {
	border-left: 4px solid #ff3344 !important;
}

.file-item.no-coordinates {
	background-color: #f1f3f5;
	opacity: 0.65;
}

.file-item.no-coordinates:hover {
	background-color: #ebedf0;
	border-color: #ccc;
	box-shadow: none;
}

.file-item-add-coords {
	position: absolute !important;
	right: 32px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	background: none !important;
	color: #999 !important;
	border: none !important;
	font-size: 20px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	z-index: 999 !important;
	padding: 0 4px !important;
	transition: color 0.2s, transform 0.2s !important;
}

.file-item-add-coords:hover {
	color: #00cc66 !important;
	transform: translateY(-50%) scale(1.2) !important;
}

@media (max-width: 768px) {
	.app-layout {
		position: relative;
		overflow: hidden;
	}

	.sidebar {
		position: absolute !important;
		right: 0;
		top: 0;
		z-index: 9999;
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important;
		box-shadow: -5px 0 25px rgba(0,0,0,0.15) !important;
	}

	.sidebar.sidebar-collapsed {
		transform: translateX(100%);
		box-shadow: none !important;
	}

	.sidebar-toggle-trigger {
		position: absolute;
		top: 50%;
		left: -24px;
		transform: translateY(-50%);
		width: 24px;
		height: 48px;
		background: #fff;
		border: 1px solid #e0e0e0;
		border-right: none;
		border-radius: 8px 0 0 8px;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #555;
		font-size: 12px;
		box-shadow: -2px 0 8px rgba(0,0,0,0.05);
		z-index: 10000;
	}
	
	.sidebar-toggle-trigger:hover {
		color: #ff3344;
	}
}
