/* AshMaps Custom Styles */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Map Styles */
#map {
    height: calc(100vh - 56px);
    width: 100%;
}

#map.fullscreen {
    height: 100vh;
}

/* Layer Panel */
.layer-panel {
    position: fixed;
    top: 56px;
    right: -320px;
    width: 320px;
    max-height: calc(100vh - 76px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 0 8px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.layer-panel.open {
    right: 0;
}

.layer-panel-header {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.layer-panel-footer {
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}

.layer-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.layer-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.1);
}

.layer-item .form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.layer-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.layer-panel-toggle {
    position: fixed;
    top: 66px;
    right: 10px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
}

.layer-panel-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.layer-panel-toggle .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    padding: 3px 6px;
}

/* Context Menu */
.leaflet-context-menu {
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 5px 0;
    min-width: 180px;
}

.leaflet-context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.leaflet-context-menu-item:hover {
    background-color: #f0f0f0;
}

.leaflet-context-menu-separator {
    border-top: 1px solid #e0e0e0;
    margin: 5px 0;
}

/* Layer Control */
.leaflet-control-layers {
    max-height: 400px;
    overflow-y: auto;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Weather Widget */
.weather-widget {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.weather-widget .temp {
    font-size: 2rem;
    font-weight: bold;
}

.weather-widget .icon {
    width: 64px;
    height: 64px;
}

/* Route Instructions */
.route-instructions {
    max-height: 400px;
    overflow-y: auto;
}

.route-step {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.route-step:last-child {
    border-bottom: none;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-gallery img:hover {
    transform: scale(1.05);
}

/* Admin Panel */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    margin: 0;
    font-size: 2.5rem;
}

.stat-card p {
    margin: 10px 0 0;
    opacity: 0.9;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #map {
        height: calc(100vh - 56px);
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

/* Text Labels on Map */
.text-label-icon {
    background: none !important;
    border: none !important;
}

.map-text-label {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.map-text-label:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

/* Photo Albums on Map */
.photo-album-marker {
    background: none !important;
    border: none !important;
}

.map-photo-album-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.map-photo-album-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Photo Gallery in Popup */
.photo-album-popup {
    padding: 5px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin: 10px 0;
    max-height: 250px;
    overflow-y: auto;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background: #dc3545;
}

.photo-gallery-loading {
    padding: 20px;
    text-align: center;
}

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}
