:root {
    --primary-color: #2196F3;
    --secondary-color: #FF9800;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --dark-color: #333;
    --light-color: #f5f5f5;
    --border-radius: 16px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
    background: #f0f2f5;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    padding: 20px;
}

.screen {
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    height: calc(100vh - 40px);
}

/* Login Screen */
.login-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
/*  background: white; */
}

.app-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
}

.app-header i {
    font-size: 3rem;
    color: white;
    margin: 1rem;
}

.app-header h1 {
    color: white;
    font-size: 1.8rem;
}

.app-form {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.app-footer {
	background: var(--dark-color);
	color: white;
    margin-top: auto;
	padding: 1.5rem 2rem;
	font-size: small;
}

.app-footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.sources {
	line-height: 1.8;
}
.source-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    width: 100%;
}

.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.form-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.form-links a:hover {
    text-decoration: underline;
}

/* App Screen */
.app-header {
    background: linear-gradient(to right, #4361ee, #3a0ca3);
	padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    position: relative;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    padding: 8px;
}

.btn-icon:hover {
    background: gray;
}

.language-selector select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background: white;
}

/* Main Content */
.main-content {
    display: flex;
    height: calc(100% - 60px);
}

#map-container {
    flex: 1;
    position: relative;
    min-height: 300px;
}

#map {
    width: 100%;
    height: 91%;
}

/* Map Controls */
#map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-control {
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    font-size: 1.2rem;
}

.map-control:hover {
    background: var(--light-color);
}

/* Control Panel */
#control-panel {
    width: 300px;
    background: white;
    padding: 1rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-section {
    margin-bottom: 1rem;
}

/* Accordion */
.accordion-item {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.accordion-header {
    padding: 1rem;
    background: var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.accordion-content {
    padding: 1rem;
    display: none;
}

.accordion-item.active .accordion-content {
    display: block;
}

.accordion-item.active .accordion-header .fa-chevron-down {
    transform: rotate(180deg);
}

/* Settings */
.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.setting-item input[type="range"] {
    width: 100%;
    margin-top: 0.5rem;
}

/* Status Display */
#status-display {
    margin-top: auto;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.status-message {
    align-items: flex-start;
}

.status-message #status-message {
    display: inline-block;
    line-height: 1.3;
    word-break: break-word;
}

.status-message.status-info #status-message {
    color: var(--info-color);
}

.status-message.status-success #status-message {
    color: var(--success-color);
}

.status-message.status-warning #status-message {
    color: var(--warning-color);
}

.status-message.status-error #status-message {
    color: var(--danger-color);
}

/* Collapsible Panels */
.collapsible-panel {
    position: absolute;
    background: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    z-index: 1001;
    display: none;
}

.collapsible-panel.active {
    display: block;
}

#legend-panel {
    top: 5rem;
    right: 1rem;
    width: 250px;
}

.bottom-panel {
    bottom: 1rem;
    right: 1rem;
    width: 250px;
}

.panel-header {
    padding: 1rem;
    background: var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
	border-top-left-radius: 16px;
	border-top-right-radius: 16px;
}

.panel-content {
    padding: 1rem;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.map-type-toggle {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    #control-panel {
        width: 100%;
        height: auto;
        order: -1;
    }
    
    #map-container {
        flex: 1;
        min-height: 50vh;
    }
    
    .login-container {
        padding: 0rem;
    }
}

form#login-form, 
form#register-form, 
form#reset-form {
    padding: 3rem;
}

/* Leaflet Customizations */
.leaflet-popup {
    width: 400px;
}
.leaflet-popup-content {
    max-width: 400px;
	margin: 0px;
}
.leaflet-container {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}
.leaflet-container a {
    color: black;
}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 10px;
	right: 8px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, 0.4);
    color: white;
	font-size: 14px;
	line-height: 2.3;
	cursor: pointer;
}
.leaflet-container a.leaflet-popup-close-button:hover {
	background: rgba(0, 0, 0, 0.75);
}
.leaflet-container img {
	max-width: none !important;
}
.leaflet-pane,
.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-overlay-pane,
.leaflet-popup-pane,
.leaflet-shadow-pane {
	position: absolute;
	left: 0;
	top: 0;
}
.leaflet-tile {
	max-width: none !important;
	max-height: none !important;
}
.leaflet-popup-content-wrapper {
    padding: 0px;
    text-align: left;
    border-radius: var(--border-radius);
}

.poi-popup h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.poi-popup.category {
    display: inline-block;
    padding: 2px 8px;
    background: #e0ebff;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.poi-popup.destination {
    display: inline-block;
    padding: 2px 8px;
    background: #b4f8ee;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.poi-popup.external-link {
    display: inline-block;
    color: white;
    text-decoration: none;
}

.poi-popup.external-link:hover {
    text-decoration: underline;
}

/* Custom Marker Icons */
.poi-marker {
    background: none;
    border: none;
}

/* BOP Marker Icons */
.category-filter.poi-marker.viewpoint i, 
.poi-marker.viewpoint i { 
/*	color: #FF9800; */
    background-color: #FF9800;;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
}
.category-filter.poi-marker.mountain i, 
.poi-marker.mountain i { 
/*	color: #795548; */
    background-color: #795548;;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
}
.category-filter.poi-marker.water i, 
.poi-marker.water i { 
/*	color: #2196F3; */
    background-color: #2196F3;;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
}
.category-filter.poi-marker.cultural i, 
.poi-marker.cultural i { 
/*	color: #9C27B0; */
    background-color: #9C27B0;;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
}
.category-filter.poi-marker.historical i, 
.poi-marker.historical i { 
/*	color: #F44336; */
    background-color: #F44336;;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
}
.category-filter.poi-marker.other i, 
.poi-marker.other i { 
/*	color: #4CAF50; */
    background-color: #4CAF50;;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

/* Main Menu Panel */
#main-menu-panel {
    top: 60px;
    left: 1rem;
    width: 250px;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    padding: 1rem;
    background: none;
    border: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    color: var(--dark-color);
    font-size: 16px;
    width: 100%;
}

.menu-item:hover {
    background: var(--light-color);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* Settings Panel */
#settings-panel {
    top: 60px;
    left: 1rem;
    width: 350px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-group h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.btn-block {
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-link {
    background: none;
    color: var(--primary-color);
    text-decoration: underline;
    padding: 0.5rem;
}

/* Sources Panel */
#sources-panel {
    top: 60px;
    left: 1rem;
    width: 350px;
    max-height: 80vh;
    overflow-y: auto;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-item {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.source-toggle {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.source-toggle:hover {
    background: var(--light-color);
}

.source-toggle input[type="checkbox"] {
    margin-right: 1rem;
}

.source-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.source-info h4 {
    margin: 0 0 4px 0;
    color: var(--dark-color);
}

.source-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.sources-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.sources-info i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* User Panel */
#user-panel {
    top: 60px;
    right: 1rem;
    width: 300px;
}

.user-avatar {
    text-align: center;
    margin-bottom: 1rem;
}

.user-avatar i {
    font-size: 4rem;
    color: var(--primary-color);
}

.user-details {
    text-align: center;
    margin-bottom: 1.5rem;
}

.user-details h4 {
    margin: 0 0 4px 0;
    color: var(--dark-color);
}

.user-details p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Panel Positioning Classes */
.left-panel {
    left: 1rem;
    right: auto;
}

.right-panel {
    right: 1rem;
    left: auto;
}

/* Control Panel adjustments */
#control-panel {
    width: 300px;
    background: white;
    padding: 1rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: fit-content;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .collapsible-panel {
        width: calc(100% - 4rem) !important;
        left: 1rem !important;
        right: 1rem !important;
    }
    
    #control-panel {
        width: 100%;
        order: -1;
    }
    
    .main-content {
        flex-direction: column;
    }
	
	#map {
		width: 100%;
		height: 86% !important;
	}
}

/* Animation for panel opening */
@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.left-panel.active {
    animation: slideInLeft 0.3s ease;
}

.right-panel.active {
    animation: slideInRight 0.3s ease;
}

/* Close button styling */
.close-panel {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-panel:hover {
    background: rgba(0,0,0,0.1);
}

/* Select styling */
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background: white;
    font-size: 14px;
    margin-top: 0.5rem;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Range slider styling */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* Checkbox styling */
input[type="checkbox"], input[type="radio"] {
    margin-right: 8px;
}

/* Overlay for background dimming */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.panel-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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


.btn-small {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    border-width: 0px;
}
.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-url {
    background: #6a94a8;
    color: white;
}

.btn-directions {
    background: #44a3a3;
    color: white;
}
.btn-preview {
    background: #66dede;
    color: white;
}

.btn-center {
    background: var(--warning-color);
    color: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 600px;
	width: 400px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary-color), #43526e);
    color: white;
    display: flex;
	flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-preview {
    padding: 0rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
/*	justify-content: flex-end; */
    justify-content: center;
}

/* The actual image preview */
.preview {
	visibility: hidden;
	width: 320px;
/*	position: absolute; */
}
/* Toggle this class - hide and show the popup */
.preview.show {
	visibility: visible;
}
/* Popup container - Poi image */
.btn-preview {
	cursor: pointer;
}

/* POI image modal */
.poi-image-modal {
	z-index: 4000;
}

.poi-image-content {
	position: relative;
	width: 520px;
	max-width: 90vw;
	background: #fff;
	border-radius: var(--border-radius);
	overflow: hidden;
}

.poi-image-body {
	padding: 0;
}

.poi-image-body img {
	display: block;
	width: 100%;
	height: auto;
}

.poi-image-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.poi-image-close:hover {
	background: rgba(0, 0, 0, 0.75);
}
