body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #282a36;
    color: #f8f8f2;
}
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative; 
    background-color: #44475a;
    padding: 15px;
    border-radius: 5px;
}
.header-controls h2 {
    flex-grow: 1;
    color: #50fa7b;
    margin: 0;
}
.search-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    margin-top: 10px;
}
#searchInput {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #282a36;
    color: #f8f8f2;
    border: 1px solid #6272a4;
    border-radius: 3px;
}
#searchInput::placeholder {
    color: #6272a4;
}
#settings-btn {
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
    color: #f8f8f2;
    margin-left: 20px;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #44475a;
    color: #f8f8f2;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #6272a4;
    border-top: none;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 0 0 3px 3px;
}
.dropdown-item { padding: 10px; cursor: pointer; border-bottom: 1px solid #6272a4; }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background-color: #6272a4; }

.content-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

#map-view-wrapper, .camera-view-wrapper {
    flex: 1;
    min-width: 300px;
}

#map, .camera-container {
    height: 600px;
}

#map-view-wrapper, .camera-view-wrapper {
    display: flex;
    flex-direction: column;
}

#map, .camera-container {
    border: 2px solid #44475a;
    border-radius: 5px;
}

.camera-container {
    display: flex;
    background: #21222C;
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

#slide {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#favorites-container {
    display: none;
    flex-direction: column;
    border: 2px solid #44475a;
    background: #21222C;
    padding: 10px;
    margin-top: 20px;
    height: 250px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
}
#favorites-container h3 {
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #44475a;
    padding-bottom: 10px;
    color: #50fa7b;
}
#favorites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}
.favorite-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; margin-bottom: 5px; background: #44475a; border-radius: 4px; }
.favorite-name { cursor: pointer; flex-grow: 1; }
.favorite-name:hover .favorite-alias { text-decoration: underline; color: #8be9fd; }
.favorite-alias { font-weight: bold; }
.favorite-original-name { font-size: 0.9em; opacity: 0.8; }
.favorite-actions span { cursor: pointer; padding: 0 5px; font-size: 16px; }
.edit-favorite-btn { color: #8be9fd; }
.edit-favorite-btn:hover { color: #50fa7b; }
.remove-favorite-btn { color: #ff79c6; }
.remove-favorite-btn:hover { color: #ff5555; }

.control-btn { padding: 8px 12px; color: #f8f8f2; border: 1px solid #6272a4; border-radius: 5px; cursor: pointer; font-size: 14px; white-space: nowrap; transition: background-color 0.3s, color 0.3s; }
#add-favorite-btn { background-color: #6272a4; }
#add-favorite-btn:hover { background-color: #44475a; }
#add-favorite-btn.in-favorites { background-color: #50fa7b; color:#282a36; border-color: #50fa7b; cursor: not-allowed; }
#toggle-favorites-btn { background-color: #6272a4; display: none; }
#toggle-favorites-btn:hover { background-color: #44475a; }
#cycle-favorites-btn { background-color: #8be9fd; color: #282a36; border-color: #8be9fd; display: none; }
#cycle-favorites-btn:hover { background-color: #50fa7b; border-color: #50fa7b;}
#cycle-favorites-btn.active { background-color: #ff5555; border-color: #ff5555; }
#share-btn { background-color: #f1fa8c; color: #282a36; border-color: #f1fa8c;}
#share-btn:hover { background-color: #e0a800; border-color: #e0a800;}
#share-btn.copied { background-color: #50fa7b; color: #282a36; border-color: #50fa7b;}

#settings-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}
.settings-content {
    background-color: #44475a;
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    border: 1px solid #6272a4;
}
.settings-content h3 {
    color: #50fa7b;
    border-bottom: 1px solid #6272a4;
    padding-bottom: 10px;
    margin-top: 0;
}
.settings-content label { display: block; margin-bottom: 10px; }
.settings-content input { width: 100%; padding: 8px; margin-bottom: 20px; box-sizing: border-box; background-color: #282a36; color: #f8f8f2; border: 1px solid #6272a4; border-radius: 3px; }
.settings-buttons { display: flex; justify-content: flex-end; gap: 10px; }
#force-refresh-btn { margin-right: auto; background-color: #ff5555; border-color: #ff5555;}
#settings-cancel { background-color: #6272a4; }
#settings-save { background-color: #50fa7b; color: #282a36; border-color: #50fa7b; }

.leaflet-div-icon {
    background: transparent;
    border: none;
}
.camera-map-icon {
    color: #8be9fd;
    font-size: 18px;
    text-shadow: 0 0 3px #000;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: #44475a;
    color: #f8f8f2;
}
.leaflet-popup-close-button {
    color: #f8f8f2 !important;
}
.leaflet-control-zoom-in, .leaflet-control-zoom-out {
    background-color: #44475a !important;
    color: #f8f8f2 !important;
    border-color: #6272a4 !important;
}
.leaflet-control-zoom-in:hover, .leaflet-control-zoom-out:hover {
    background-color: #6272a4 !important;
}
.leaflet-control-attribution {
    background: rgba(68, 71, 90, 0.8) !important;
    color: #f8f8f2 !important;
}
.leaflet-control-attribution a {
    color: #8be9fd !important;
}

/* --- RESPONSIVE DESIGN --- */

@media (max-width: 800px) {
    .content-container {
        flex-direction: column;
        gap: 25px;
    }

    #map, .camera-container {
        height: 50vh;
    }

    .header-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    #settings-btn {
        position: absolute;
        top: 5px;
        right: 10px;
    }
    
    .camera-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #map, .camera-container {
        height: 65vh;
    }
    #favorites-container {
        height: 140px;
    }
}