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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#map {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Bottom Right Controls */
.bottom-right-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.location-dropdown {
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: #333;
}

.location-dropdown:hover {
    background: white;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}

.location-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.location-dropdown option {
    padding: 0.5rem;
}

.location-dropdown option[data-type="country"] {
    font-weight: bold;
    color: #333;
    background: #f5f5f5;
}

.location-dropdown option[data-type="city"] {
    padding-left: 0.5rem;
    color: #555;
}

.fab-container {
    display: flex;
    gap: 15px;
}

.action-fab {
    width: 60px;
    height: 60px;
    background: rgba(102, 126, 234, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
}

.action-fab:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.action-fab:active {
    transform: scale(0.95);
}

.action-fab svg {
    width: 28px;
    height: 28px;
}

/* Layers Modal */
.layers-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.layers-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.layers-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layers-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.layers-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.layers-close:hover {
    color: #333;
}

.layers-list {
    padding: 10px 0;
    overflow-y: auto;
    flex: 1;
}

.layer-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-item:hover {
    background: #f5f7ff;
}

.layer-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.layer-label {
    flex: 1;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
}

.layer-count {
    font-size: 0.85rem;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.layers-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.text-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.text-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.apply-btn {
    margin-left: auto;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.apply-btn:hover {
    background: #5a6fe0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Remove old sidebar and fab styles */

/* Layer control styling */
.leaflet-control-layers {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border: none;
    z-index: 1001 !important;
}

.leaflet-control-layers-expanded {
    padding: 1rem;
}

.leaflet-control-layers-toggle {
    background-image: none;
    width: 40px;
    height: 40px;
}

.leaflet-control-layers-toggle::before {
    content: '🗺️';
    font-size: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.leaflet-control-layers label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.leaflet-control-layers label:hover {
    background: #f0f2ff;
}

.leaflet-control-layers input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.leaflet-control-layers-base {
    margin-bottom: 0;
}

/* Custom marker styles */
.photo-marker-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
}

.photo-marker {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
    will-change: transform;
}

.photo-marker:hover {
    transform: scale(1.1);
}

.photo-marker img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.photo-marker-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #667eea;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
    white-space: nowrap;
}

/* Modal styles */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #667eea;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s, opacity 0.5s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 1;
}

.carousel-prev {
    left: 2rem;
}

.carousel-next {
    right: 2rem;
}

.carousel-nav.hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav:disabled:hover {
    transform: translateY(-50%);
}

.carousel-nav svg {
    color: #667eea;
}

.photo-counter {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.5s;
    opacity: 1;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.photo-counter.hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-thumbnails {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    overflow-x: auto;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    transition: opacity 0.5s, transform 0.5s;
    opacity: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 50;
    max-width: 90%;
}

.carousel-thumbnails.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.carousel-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.carousel-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.carousel-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    flex-shrink: 0;
}

.carousel-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-thumbnail.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.modal-sidebar {
    width: 400px;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s, transform 0.3s;
}

.photo-info-overlay {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
    transition: opacity 0.5s;
    opacity: 1;
}

.photo-info-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.info-bubble {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    transition: all 0.3s;
}

.info-bubble:empty {
    display: none;
}

.info-bubble:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translateX(5px);
}

#modalSidebarInfo h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#modalSidebarInfo p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

#modalSidebarInfo strong {
    display: block;
    color: #667eea;
    margin-bottom: 0.25rem;
}

#modalSidebarInfo .location-name {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.photo-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.photo-grid-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #f5f5f5;
    border: 2px solid transparent;
}

.photo-grid-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.photo-grid-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.photo-grid-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-grid-title {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #333;
    background: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timeline container */
.timeline-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s;
}

.timeline-container:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

#timelineLabel {
    font-weight: 600;
    color: #667eea;
}

#timelineRange {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.timeline-slider-wrapper {
    position: relative;
    height: 30px;
    margin: 0.5rem 0;
}

.timeline-track {
    position: absolute;
    top: 11px;
    left: 0;
    right: 0;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    pointer-events: none;
}

.timeline-slider {
    position: absolute;
    width: 100%;
    height: 8px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    cursor: pointer;
    pointer-events: none;
    top: 11px;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
    pointer-events: all;
    position: relative;
    z-index: 10;
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.6);
}

.timeline-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
    pointer-events: all;
    position: relative;
    z-index: 10;
}

.timeline-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.6);
}

.timeline-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.timeline-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.timeline-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
}

