/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
	--color-restaurant: #FF6B6B;
	--color-cafe: #FFE66D;
	--color-bar: #4ECDC4;
	--color-fastfood: #FFA36B;
	--color-other: #A8DADC;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body, html {
	height: 100%;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   MAP CONTAINER
   ============================================ */
#map {
	height: 100vh;
	width: 100vw;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1;
}

.leaflet-control-zoom,
.leaflet-control-layers {
	display: none;
}

.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}

/* ============================================
   APP HEADER
   ============================================ */
.app-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	padding: 12px 16px;
}

.app-header h1 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
	color: #333;
}

/* ============================================
   CUSTOM ZOOM CONTROL
   ============================================ */
.custom-zoom-control {
	position: fixed;
	bottom: 20px;
	right: 16px;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.zoom-button {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
	color: #333;
}

.zoom-button:hover {
	background: rgba(0, 123, 255, 0.1);
}

.zoom-button:active {
	transform: scale(0.95);
}

.zoom-button .material-symbols-outlined {
	font-size: 24px;
}

.zoom-divider {
	height: 1px;
	background: rgba(0, 0, 0, 0.1);
	margin: 0 8px;
}

/* ============================================
   CUSTOM LAYER CONTROL
   ============================================ */
.custom-layer-control {
	position: fixed;
	top: 70px;
	right: 16px;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 16px;
	padding: 12px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	min-width: 140px;
}

.layer-option {
	padding: 8px 12px;
	cursor: pointer;
	border-radius: 8px;
	transition: background-color 0.2s ease;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	gap: 8px;
}

.layer-option:hover {
	background: rgba(0, 123, 255, 0.1);
}

.layer-option.active {
	background: #007bff;
	color: white;
	font-weight: 500;
}

.layer-option-radio {
	width: 16px;
	height: 16px;
	border: 2px solid #ccc;
	border-radius: 50%;
	position: relative;
}

.layer-option.active .layer-option-radio {
	border-color: white;
}

.layer-option.active .layer-option-radio::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	right: 3px;
	bottom: 3px;
	background: white;
	border-radius: 50%;
}

/* ============================================
   LEGEND CONTAINER
   ============================================ */
.legend-container {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 20px;
	padding: 12px 16px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	display: flex;
	gap: 12px;
	max-width: calc(100vw - 80px);
	overflow-x: auto;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
	background: #f8f9fa;
}

.legend-item:active {
	transform: scale(0.95);
}

.legend-item.active {
	background: #007bff;
	color: white;
}

.legend-item .material-symbols-outlined {
	font-size: 20px;
}

/* ============================================
   CUSTOM MARKERS
   ============================================ */
.custom-marker {
	background: white;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 10px rgba(0,0,0,0.3);
	transition: all 0.3s ease;
	cursor: pointer;
}

.custom-marker:hover {
	transform: rotate(-45deg) scale(1.2);
	z-index: 1000;
}

.custom-marker .material-symbols-outlined {
	transform: rotate(45deg);
	font-size: 24px;
}

.marker-restaurant {
	background: var(--color-restaurant);
}

.marker-cafe {
	background: var(--color-cafe);
}

.marker-bar {
	background: var(--color-bar);
}

.marker-fastfood {
	background: var(--color-fastfood);
}

.marker-other {
	background: var(--color-other);
}

.marker-label {
	position: absolute;
	left: 50px;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(3px);
	padding: 4px 10px;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 500;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	pointer-events: none;
	color: #333;
}

.leaflet-marker-icon.active .custom-marker {
	background: #ea4335;
	color: #fff;
}
.leaflet-marker-icon.active .marker-label {
	background: #ea4335;
	color: #fff;
}

/* ============================================
   MODAL STRUCTURE
   ============================================ */
.modal-backdrop {
	background-color: #00000070;
}

.modal-dialog {
	margin: 0;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	max-width: 100%;
}

.modal-content {
	border-radius: 20px 20px 0 0;
	border: none;
	transition: transform 0.3s ease;
}

.modal-content.dragging {
	transition: none;
}

.modal-drag-handle {
	width: 40px;
	height: 4px;
	background: #ddd;
	border-radius: 2px;
	margin: 12px auto 0 auto;
	cursor: grab;
	transition: background-color 0.2s ease;
}

.modal-drag-handle:active {
	cursor: grabbing;
	background: #bbb;
}

/* ============================================
   MODAL HEADER
   ============================================ */
.modal-header {
	border-bottom: none;
	padding: 10px 20px 15px 20px;
	flex-direction: column;
	align-items: flex-start;
}

.modal-header .close {
	position: absolute;
	right: 20px;
	top: 20px;
	padding: 0;
	margin: 0;
}

.modal-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 4px;
}

/* ============================================
   MODAL BODY
   ============================================ */
.modal-body {
	padding: 10px 10px 30px 10px;
}

.modal-body:not(:has(.cover-image)) {
	padding-top: 0;
	margin-top: -15px;
	border-top: 1px solid #ddd;
}

.cover-image {
	width: calc(100% + 20px);
	height: 200px;
	object-fit: cover;
	margin: -15px -10px 0 -10px;
}

/* ============================================
   PLACE METADATA & BADGES
   ============================================ */
.place-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.type-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 500;
	color: white;
}

.type-restaurant {
	background: var(--color-restaurant);
}

.type-cafe {
	background: var(--color-cafe);
	color: #333;
}

.type-bar {
	background: var(--color-bar);
}

.type-fastfood {
	background: var(--color-fastfood);
	color: #333;
}

.type-other {
	background: var(--color-other);
	color: #333;
}

.subtype-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: #888;
	color: #fff;
	border-radius: 8px;
	font-size: 0.85rem;
}

/* ============================================
   RATING SYSTEM
   ============================================ */
.rating-container {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-basis: 100%;
	width: 100%;
}

.rating-stars {
	display: flex;
	align-items: center;
	margin-top: -5px;
	gap: 2px;
}

.rating-stars svg {
	width: 18px;
	height: 18px;
}

.star-filled {
	color: #FFC107;
}

.star-empty {
	color: #ddd;
}

.rating-value {
	font-size: 0.9rem;
	font-weight: 500;
	color: #333;
}

.review-count {
	font-size: 0.85rem;
	color: #666;
}

/* ============================================
   MENU BUTTON
   ============================================ */
.menu-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	margin: 16px 0 4px 0;
	padding: 10px 20px;
	background: #007bff;
	color: white;
	text-align: center;
	font-weight: 500;
	font-size: 0.95rem;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.menu-button:hover {
	background: #0056b3;
	color: white;
	text-decoration: none;
}

.menu-button:active {
	transform: scale(0.95);
}

.menu-button .material-symbols-outlined {
	font-size: 20px;
}

/* ============================================
   INFO ITEMS
   ============================================ */
.info-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 0;
	padding: 12px;
	padding-bottom: 0;
	border-radius: 8px;
	transition: background-color 0.2s ease;
	cursor: pointer;
	position: relative;
}

.info-item.copyable:hover {
	background-color: rgba(31, 31, 31, 0.08);
}

.info-item .material-symbols-outlined {
	color: #007bff;
	font-size: 24px;
}

.info-item-content {
	flex: 1;
	padding-right: 80px;
}

.info-item-label {
	font-size: 0.85rem;
	color: #6c757d;
	margin-bottom: 4px;
}

.info-item-value {
	font-size: 1rem;
	color: #333;
}

.info-item-value a {
	color: #007bff;
	text-decoration: none;
}

/* ============================================
   ACTION BUTTONS & TOOLTIPS
   ============================================ */
.action-buttons {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	gap: 4px;
}
.action-button {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	transition: all 0.2s ease;
	position: relative;
}
.action-button:hover {
	background: rgba(0, 123, 255, 0.1);
}
.action-button .material-symbols-outlined {
	font-size: 20px;
	color: #007bff;
}
.action-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: #333;
	color: white;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 0.85rem;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 1000;
}
.action-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	right: 12px;
	border: 5px solid transparent;
	border-top-color: #333;
}
.action-button:hover .action-tooltip {
	opacity: 1;
}
.action-tooltip.copied {
	background: #28a745;
}
.action-tooltip.copied::after {
	border-top-color: #28a745;
}

/* ============================================
   COPY BUTTON & TOOLTIP
   ============================================ */
.copy-button {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	transition: all 0.2s ease;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.info-item.copyable:hover .copy-button {
	opacity: 1;
	visibility: visible;
}

.copy-button .material-symbols-outlined {
	font-size: 20px;
	color: #007bff;
}

.copy-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: #333;
	color: white;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 0.85rem;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 1000;
}
.copy-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	right: 12px;
	border: 5px solid transparent;
	border-top-color: #333;
}

.info-item.copyable:hover .copy-tooltip {
	opacity: 1;
}

.copy-tooltip.copied {
	background: #28a745;
}
.copy-tooltip.copied::after {
	border-top-color: #28a745;
}

/* ============================================
   RESPONSIVE: MOBILE STYLES
   ============================================ */
@media (max-width: 568px) 
{
	.custom-layer-control {
		display: none;
	}
	.custom-zoom-control {
		display: none;
	}
	
	.info-item {
		margin-bottom: 0.1rem;
		padding: 6px;
	}
	.info-item-label {
		display: none;
	}
	.info-item-value {
		font-size: 0.9rem;
	}
	.info-item-value a {
		color: #333;
	}
	
	.modal-body {
		padding: 10px 15px;
	}
}

/* ============================================
   RESPONSIVE: TABLET & DESKTOP STYLES
   ============================================ */
@media (min-width: 768px) 
{
	.modal-dialog {
		position: relative;
		margin: 1.75rem auto;
		max-width: 500px;
		display: -ms-flexbox;
		display: flex;
		-ms-flex-align: center;
		align-items: center;
		min-height: calc(100% - 3.5rem);
	}
	
	.modal-content {
		border-radius: 20px;
	}
}