/* ===== PHOTO GALLERY CSS ===== */

/* ===== BASE STYLES ===== */
body {
	font-family: Arial, sans-serif;
	background-color: #f0f0f0;
	color: #333;
	text-align: center;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	line-height: 1.6;
}

.no-scroll {
	overflow: hidden;
}

/* ===== HEADER & NAVIGATION ===== */
.header-container {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 15px;
}

.header-container h1 {
	margin: 0;
	font-size: 2rem;
	color: #2c3e50;
}

.nav-links {
	padding: 0;
	margin: 0;
	border-radius: 1rem;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
	background: linear-gradient(135deg, #f0f0f0, #ffffff);
	transition: box-shadow 0.3s ease, transform 0.2s ease;
	display: flex;
}

.nav-links a {
	text-decoration: none;
	color: #333;
	font-weight: 500;
	font-size: 1rem;
	transition: color 0.2s ease;
	padding: 0.8rem 1.2rem;
}

.nav-links:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	transform: translateY(-2px);
}

.nav-links:hover a {
	color: #0077cc;
}

/* ===== CONTROLS CONTAINER ===== */
.controls-container {
	display: flex;
	flex-direction: column;
	gap: 0;
	max-width: 1200px;
	margin: 0 auto 30px auto;
	padding: 20px;
	background: white;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.controls-title {
	font-size: 1.2rem;
	font-weight: 600;
	color: #2c3e50;
	margin: 0;
}

.collapse-toggle {
	background: none;
	border: none;
	font-size: 1.5rem;
	color: #34495e;
	cursor: pointer;
	padding: 5px;
	border-radius: 50%;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
}

.collapse-toggle:hover {
	background: #ecf0f1;
	color: #2c3e50;
}

.collapse-toggle.collapsed {
	transform: rotate(-90deg);
}

.controls-content {
	overflow: hidden;
	max-height: 1000px;
	transition: max-height 0.3s ease;
}

.controls-content.collapsed {
	max-height: 0;
	margin-top: 0;
}

.controls-container.collapsed {
	margin-bottom: 15px;
}

/* ===== FILTER SECTIONS ===== */
.filter-section {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	justify-content: center;
}

.filter-section h3 {
	margin: 0;
	font-size: 1.1rem;
	color: #34495e;
	white-space: nowrap;
}

.filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: flex-start;
}

.filter-description {
	font-size: 0.9em;
	color: #666;
	margin-bottom: 10px;
	font-style: italic;
}

/* ===== BUTTONS ===== */
.filter-btn {
	padding: 8px 16px;
	border: 2px solid #ddd;
	background: white;
	border-radius: 20px;
	cursor: pointer;
	font-size: 0.9rem;
	white-space: nowrap;
	transition: all 0.3s ease;
}

.filter-btn:hover {
	border-color: #3498db;
	background: #ecf0f1;
}

.filter-btn.active {
	background: #3498db;
	color: white;
	border-color: #2980b9;
}

.clear-search {
	background: #79a1cb;
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 15px;
	cursor: pointer;
	font-size: 0.8rem;
	transition: background 0.3s ease;
}

.clear-search:hover {
	background: #6e94bc;
}

.clear-tags-btn {
	background: #3498db !important;
	border-color: #3498db !important;
	color: white !important;
	font-weight: bold;
	margin-bottom: 4px;
	flex-basis: 100%;
}

.clear-tags-btn:hover {
	background: #2980b9 !important;
	border-color: #2980b9 !important;
}

/* ===== FORM CONTROLS ===== */
.sort-container {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sort-container label {
	font-weight: 500;
	color: #555;
}

.sort-container select {
	padding: 8px 12px;
	font-size: 1rem;
	border: 2px solid #ddd;
	border-radius: 5px;
	background: white;
	cursor: pointer;
	transition: border-color 0.3s ease;
}

.sort-container select:hover,
.sort-container select:focus {
	border-color: #3498db;
	outline: none;
}

.date-range {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.date-range input[type="date"] {
	padding: 8px;
	border: 2px solid #ddd;
	border-radius: 5px;
	font-size: 0.9rem;
	transition: border-color 0.3s ease;
}

.date-range input[type="date"]:focus {
	border-color: #3498db;
	outline: none;
}

.search-container {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 300px;
}

.search-box {
	flex: 1;
	padding: 10px 15px;
	border: 2px solid #ddd;
	border-radius: 25px;
	font-size: 1rem;
	transition: border-color 0.3s ease;
}

.search-box:focus {
	border-color: #3498db;
	outline: none;
}

/* ===== TAG SYSTEM ===== */
.tag-container {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	max-width: 800px;
	margin: 0 auto;
}

.tag {
	background: #f8f9fa;
	color: #495057;
	padding: 5px 12px;
	border-radius: 15px;
	border: 1px solid #dee2e6;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all 0.3s ease;
	user-select: none;
}

.tag:hover {
	background: #e9ecef;
	border-color: #adb5bd;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag:focus {
	outline: 2px solid #3498db;
	outline-offset: 2px;
}

.tag.selected {
	background: #28a745;
	color: white;
	border-color: #1e7e34;
}

.tag.excluded {
	background: #e74c3c !important;
	border-color: #e74c3c !important;
	color: white !important;
	text-decoration: line-through;
	opacity: 0.8;
	animation: excludeTag 0.3s ease-in-out;
}

.tag.excluded:hover {
	opacity: 1;
	background: #c0392b !important;
}

.tag.excluded::before {
	content: "✖ ";
	font-size: 0.8em;
	margin-right: 4px;
}

.tag-count {
	font-size: 0.85em;
	opacity: 0.7;
	margin-left: 4px;
}

.tag.excluded .tag-count {
	opacity: 0.9;
}

/* ===== RATING SYSTEM ===== */
.rating-filter-container {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.rating-slider-container {
	position: relative;
}

#rating-slider {
	width: 100%;
	height: 6px;
	background: #ddd;
	outline: none;
	border-radius: 3px;
	appearance: none;
	cursor: pointer;
}

#rating-slider::-webkit-slider-thumb {
	appearance: none;
	width: 20px;
	height: 20px;
	background: #f39c12;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#rating-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	background: #f39c12;
	border-radius: 50%;
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rating-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 5px;
	font-size: 0.9em;
	color: #666;
}

.rating-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.rating-btn {
	background: #f8f9fa;
	border: 2px solid #79a1cb;
	border-radius: 6px;
	padding: 8px 12px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 1em;
	color: #79a1cb;
	user-select: none;
}

.rating-btn:hover {
	background: #79a1cb;
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rating-btn:focus {
	outline: 2px solid #3498db;
	outline-offset: 2px;
}

.rating-btn.active {
	background: #79a1cb;
	color: white;
	font-weight: bold;
	animation: activateRating 0.3s ease-in-out;
}

.rating-count {
	font-size: 0.85em;
	opacity: 0.8;
	margin-left: 4px;
}

/* ===== GALLERY GRID ===== */
.gallery {
	display: grid;
	align-items: center;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 15px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0;
}

/* ===== PHOTO ITEMS ===== */
.photo-item {
	position: relative;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.photo-item img {
	width: 100%;
	height: auto;
	display: block;
	cursor: pointer;
	transition: opacity 0.3s ease;
}

.photo-item.filtered-out {
	display: none;
}

.photo-item.loading img {
	opacity: 0.5;
}

.photo-meta {
	padding: 10px;
	text-align: left;
	background: white;
}

.photo-title {
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 5px;
	color: #2c3e50;
}

.photo-date {
	font-size: 0.8rem;
	color: #7f8c8d;
	margin-bottom: 8px;
}

.photo-rating {
	font-size: 0.9em;
	color: #79a1cb;
	margin-top: 4px;
}

.photo-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.photo-tag {
	background: #ecf0f1;
	color: #34495e;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 0.7rem;
}

/* ===== LAZY LOADING ===== */
.lazy-load {
	background-color: #eee;
	min-height: 150px;
	display: block;
	position: relative;
}

.lazy-load::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 20px;
	height: 20px;
	border: 2px solid #ddd;
	border-top: 2px solid #666;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

/* ===== RESULTS & STATUS ===== */
.results-info {
	text-align: center;
	margin-bottom: 20px;
	font-size: 1rem;
	color: #666;
}

.results-count {
	font-weight: 600;
	color: #2c3e50;
}

.filter-status {
	color: #79a1cb;
	font-weight: bold;
	margin-left: 8px;
}

.no-results {
	text-align: center;
	padding: 60px 20px;
	color: #7f8c8d;
}

.no-results h3 {
	font-size: 1.5rem;
	margin-bottom: 10px;
	color: #95a5a6;
}

.no-results p {
	font-size: 1rem;
	max-width: 400px;
	margin: 0 auto;
}

/* ===== LIGHTBOX ===== */
.lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	z-index: 9999;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	backdrop-filter: blur(5px);
}

.lightbox img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	box-shadow: 0 0 0 10px #c0c0c0;
	z-index: 1000;
	transition: opacity 0.3s ease-in-out;
    touch-action: pinch-zoom;
    cursor: grab;
}

.lightbox img.zoomed {
    cursor: grabbing;
    touch-action: none;
}

.lightbox img.dragging {
    transition: none;
}

.lightbox-nav-grid {
	display: grid;
	position: absolute;
	grid-template-columns: 1fr 1fr 1fr;
	grid-template-rows: 1fr 33vh;
	height: 100vh;
	width: 100vw;
	z-index: 999;
}

.lightbox-nav-area {
	box-shadow: inset 0px 0px 120px 3px #303040, 0px 0px 30px 0 #303060;
	cursor: pointer;
}

.lightbox-nav-area::before {
	content: attr(data-indicator);
	position: absolute;
	font-size: 3rem;
	font-weight: bold;
	color: grey;
}

.lightbox-prev-area::before {
	content: "<";
	left: 10px;
	bottom: 10px;
}

.lightbox-next-area::before {
	content: ">";
	right: 10px;
	bottom: 10px;
}

.loading-spinner {
	position: absolute;
	z-index: 1010;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top: 4px solid #fff;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	animation: spin 1s linear infinite;
	display: none;
}

.lightbox .loading-active .loading-spinner {
	display: block;
}

.blocker {
	width: 100vw;
	height: 100vh;
	position: fixed;
	top: 0;
	left: 0;
	background: transparent;
	z-index: 999;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
	from {
		transform: translate(-50%, -50%) rotate(0deg);
	}

	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes slideUp {
	from {
		transform: translateY(20px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes excludeTag {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}

	100% {
		transform: scale(1);
	}
}

@keyframes activateRating {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}

	100% {
		transform: scale(1);
	}
}

/* ===== UTILITY CLASSES ===== */
.hidden {
	display: none !important;
}

.fade-in {
	animation: fadeIn 0.5s ease-in;
}

.slide-up {
	animation: slideUp 0.3s ease-out;
}

/* ===== MEDIA QUERIES ===== */
@media (min-width: 1024px) {
	.gallery {
		grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	}
}

@media (max-width: 768px) {
	body {
		padding: 10px;
	}

	.header-container h1 {
		font-size: 1.5rem;
	}

	.controls-title {
		font-size: 1.1rem;
	}

	.collapse-toggle {
		width: 28px;
		height: 28px;
		font-size: 1.3rem;
	}

	.controls-container {
		padding: 10px 20px;
	}

	.filter-btn {
		padding: 6px 12px;
		font-size: 0.8rem;
	}

	.tag,
	.rating-btn {
		font-size: 0.9em;
		padding: 6px 10px;
		margin: 2px;
	}

	.tag-count,
	.rating-count {
		font-size: 0.8em;
	}

	.filter-description {
		font-size: 0.85em;
	}

	.rating-filter-container {
		gap: 10px;
	}

	.results-info {
		font-size: 0.8rem;
	}

	.rating-buttons {
		gap: 4px;
	}

	.nav-links a {
		padding: 0.5rem 0.8rem;
	}
}