/* ===== BASE STYLES ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#map {
    height: 100vh;
    width: 100%;
    z-index: 1;
    cursor: default !important;
}

/* ===== BUTTON STYLES ===== */
/* Button container - holds all three buttons */
.button-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 3px 5px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    border: 2px solid rgb(255, 255, 255);
}

/* Popup close button */
.popup-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 24px;
}

.popup-close-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.popup-close-btn i {
    color: #333;
    font-size: 18px;
}

/* Random Pin Button */
.random-pin-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.random-pin-btn:hover {
    background-color: #5a6268;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.random-pin-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.random-pin-btn.loading {
    animation: pulse 1.5s infinite;
}

/* Floating action button */
.fab {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.fab:hover {
    background-color: #0b5ed7;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* ===== MODAL STYLES ===== */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
}

.toast {
    min-width: 250px;
}

/* ===== MAP STYLES ===== */
/* Marker cluster custom styling */
.marker-cluster {
    background-color: rgba(13, 110, 253, 0.6);
    border-radius: 50%;
    text-align: center;
    color: white;
    font-weight: bold;
}

.marker-cluster div {
    background-color: rgba(13, 110, 253, 0.8);
    border-radius: 50%;
    margin: 5px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 14px;
}

/* Leaflet popup container styling */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 350px !important;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 250px;
    width: auto !important;
}

.leaflet-popup-tip {
    background: white;
}

/* Reposition zoom controls to middle left */
.leaflet-control-zoom {
    top: 70px !important;
    z-index: 1 !important;
}

/* ===== POPUP STYLES ===== */
/* Custom popup styles */
.custom-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 15px;
    min-width: 250px;
}

.popup-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.popup-title {
    font-weight: 600;
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.platform-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.platform-badge.tiktok {
    background-color: #000000;
}

.platform-badge.youtube {
    background-color: #FF0000;
}

.platform-badge.instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
}

.platform-badge.twitter {
    background-color: #1DA1F2;
}

.platform-badge.default {
    background-color: #0d6efd;
}

.popup-content {
    margin-bottom: 15px;
}

.popup-link {
    font-size: 14px;
    color: #666;
    word-break: break-all;
    margin-bottom: 10px;
    line-height: 1.4;
}

.popup-date {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
}

.popup-date i {
    margin-right: 5px;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.popup-button {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Platform-specific button styles */
.popup-button.tiktok {
    background-color: #000000;
    color: white;
}

.popup-button.tiktok:hover {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-button.youtube {
    background-color: #FF0000;
    color: white;
}

.popup-button.youtube:hover {
    background-color: #CC0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-button.instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
}

.popup-button.instagram:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-button.twitter {
    background-color: #1DA1F2;
    color: white;
}

.popup-button.twitter:hover {
    background-color: #0c85d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-button.default {
    background-color: #0d6efd;
    color: white;
}

.popup-button.default:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-button i {
    margin-right: 8px;
}

/* ===== EMBED STYLES ===== */
/* Embed container styles */
.embed-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
}

.youtube-embed {
    height: 400px;
}

.tiktok-embed {
    height: 560px; 
    max-width: 325px;
    margin: 0 auto; 
}

.instagram-embed {
    height: 400px;
}

.twitter-embed {
    height: 300px;
}

/* Embed fallback styles */
.embed-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.embed-fallback-message {
    color: #495057;
}

.embed-fallback-message i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #6c757d;
}

.embed-fallback-message p {
    margin: 5px 0;
    font-size: 14px;
}

/* Platform-specific colors for fallback icons */
.youtube-embed .embed-fallback-message i {
    color: #FF0000;
}

.tiktok-embed .embed-fallback-message i {
    color: #000000;
}

.instagram-embed .embed-fallback-message i {
    color: #E4405F;
}

.twitter-embed .embed-fallback-message i {
    color: #1DA1F2;
}

/* ===== SEARCH STYLES ===== */
/* Search Bar Styles */
.search-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500; /* Lower z-index to be behind other elements */
    width: 300px;
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Add transition */
    opacity: 1;
    visibility: visible;
}

.search-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevent interaction when hidden */
}

.search-bar {
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    outline: none;
    color: #333;
    backdrop-filter: blur(5px); /* Adds a subtle blur effect */
    transition: all 0.3s ease;
}

#searchInput:focus {
    background-color: rgba(255, 255, 255, 0.9); /* More opaque when focused */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#searchInput::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95); /* Semi-transparent background */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    margin-top: 5px;
    display: none;
    backdrop-filter: blur(10px); /* Adds a subtle blur effect */
}

.search-result-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* ===== FORM STYLES ===== */
/* Location options styling */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    cursor: pointer;
}

#selectedLocationInfo {
    font-style: italic;
    margin-top: 0.25rem;
}

/* ===== ZOOM LEVEL INDICATOR ===== */
.zoom-level-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.zoom-level-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.zoom-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.zoom-progress {
    width: 150px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.zoom-progress-bar {
    height: 100%;
    background-color: #0d6efd;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== RESPONSIVE STYLES ===== */
/* Mobile adjustments */
@media (max-width: 768px) {
    .button-container {
        bottom: 15px;
        gap: 10px;
    }
    
    .fab {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .random-pin-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .popup-close-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .modal-dialog {
        margin: 15px;
    }
    
    .custom-popup {
        padding: 12px;
        min-width: 220px;
    }
    
    .popup-title {
        font-size: 16px;
    }
    
    .popup-link {
        font-size: 13px;
    }
    
    .popup-button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .agreement-content {
        max-height: 50vh;
    }

    .search-container {
        width: 85%; 
        max-width: 350px;
        top: 10px;
    }
    
    #searchInput {
        padding: 12px 15px; 
        font-size: 16px; 
    }
    
    .search-results {
        max-height: 250px; 
    }
    
    .search-result-item {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .search-container {
        width: 90%;
        top: 5px;
    }
    
    #searchInput {
        padding: 10px 12px;
        font-size: 14px;
    }
}
