* {
    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;
}

.sidebar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sidebar select {
    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;
}

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

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

.sidebar select option {
    padding: 0.5rem;
}

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

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

/* 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: 50%;
    width: 20px;
    height: 20px;
    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;
}

/* 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;
}

/* Play button */
.play-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    z-index: 1000;
    color: white;
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

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

.play-button.playing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.play-button.playing svg polygon {
    display: none;
}

.play-button.playing::after {
    content: '';
    width: 14px;
    height: 20px;
    border-left: 5px solid white;
    border-right: 5px solid white;
}

/* Airplane marker */
.airplane-marker {
    font-size: 40px;
    line-height: 1;
    transition: transform 0.1s linear;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 9999;
}

.leaflet-marker-icon.airplane-icon {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    width: 40px !important;
    height: 40px !important;
    z-index: 9999 !important;
}

.leaflet-marker-pane .airplane-icon {
    z-index: 9999 !important;
}
