/* Music Map - Watercolor & Parchment Aesthetic */

/* ==================================================
   POPUP STYLING - Parchment Paper Effect
   ================================================== */

.leaflet-popup-content-wrapper {
    /* Warm parchment color instead of white */
    background: #f4e4bc;
    color: #3d2817;

    /* Remove modern rounded corners for paper-like edges */
    border-radius: 2px;

    /* Add texture and depth */
    box-shadow: 0 3px 14px rgba(0,0,0,0.3);
    border: 1px solid #d4c4a4;

    /* Slightly rough paper texture */
    background-image:
        linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.02) 50%, transparent 100%),
        linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.02) 50%, transparent 100%);

    /* Padding for content */
    padding: 4px;
}

.leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.6;
    font-family: 'Merriweather', 'Georgia', serif;
    font-size: 14px;
}

/* City name styling */
.leaflet-popup-content b {
    color: #2d1810;
    font-size: 16px;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
    border-bottom: 1px solid #d4c4a4;
    padding-bottom: 4px;
}

/* Artist list styling */
.leaflet-popup-content ul {
    list-style: none;
    padding-left: 0;
    margin: 8px 0 4px 0;
}

.leaflet-popup-content li {
    padding: 4px 0 4px 18px;
    position: relative;
}

.leaflet-popup-content li:before {
    content: "♪";
    position: absolute;
    left: 0;
    color: #8b6f47;
    font-size: 14px;
}

/* Popup arrow/tip - match parchment color */
.leaflet-popup-tip {
    background: #f4e4bc;
    border: 1px solid #d4c4a4;
    box-shadow: none;
}

/* Close button styling */
.leaflet-popup-close-button {
    color: #8b6f47 !important;
    font-size: 20px !important;
    padding: 4px 8px 0 0 !important;
}

.leaflet-popup-close-button:hover {
    color: #5d4a2f !important;
}

/* ==================================================
   MARKER CLUSTER STYLING - Wax Seal Effect
   ================================================== */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(244, 228, 188, 0.7);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: #e8d5b7;
    color: #3d2817;
    font-family: 'Merriweather', 'Georgia', serif;
    font-weight: 600;
    border: 2px solid #8b6f47;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Size variations for different cluster sizes */
.marker-cluster-small div {
    width: 34px;
    height: 34px;
    line-height: 30px;
    font-size: 13px;
}

.marker-cluster-medium div {
    width: 40px;
    height: 40px;
    line-height: 36px;
    font-size: 14px;
}

.marker-cluster-large div {
    width: 46px;
    height: 46px;
    line-height: 42px;
    font-size: 15px;
}

/* Hover effect for clusters */
.marker-cluster-small:hover div,
.marker-cluster-medium:hover div,
.marker-cluster-large:hover div {
    background-color: #d4c4a4;
    border-color: #6b5637;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* ==================================================
   TOOLTIP STYLING
   ================================================== */

.leaflet-tooltip {
    background: #f4e4bc;
    border: 1px solid #8b6f47;
    color: #3d2817;
    font-family: 'Merriweather', 'Georgia', serif;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.leaflet-tooltip-bottom:before {
    border-bottom-color: #8b6f47;
}

.leaflet-tooltip-top:before {
    border-top-color: #8b6f47;
}

/* ==================================================
   SEARCH CONTROL - HIDDEN (using sidebar search instead)
   ================================================== */

.leaflet-control-search {
    display: none !important;
}

/* ==================================================
   MAP CONTAINER
   ================================================== */

.leaflet-map {
    /* Add subtle border matching the theme */
    border: 3px solid #8b6f47;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
}

/* ==================================================
   MARKER ICON ENHANCEMENTS
   ================================================== */

.leaflet-marker-icon {
    /* Add subtle drop shadow to markers */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.leaflet-marker-icon:hover {
    /* Slight grow effect on hover */
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Custom Ink Stain Markers */
.ink-marker {
    background: none !important;
    border: none !important;
}

.ink-marker svg {
    width: 100%;
    height: 100%;
    opacity: 0.85;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.ink-marker:hover svg {
    opacity: 1;
    transform: scale(1.15);
    transition: all 0.3s ease;
}

/* ==================================================
   SIDEBAR NAVIGATION (Optional Enhancement)
   ================================================== */

.music-map-sidebar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f4e4bc;
    border: 2px solid #8b6f47;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    padding: 15px;
    width: 280px;
    max-height: calc(100% - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    font-family: 'Merriweather', 'Georgia', serif;
    transition: all 0.3s ease;
}

.music-map-sidebar h3 {
    margin: 0 0 12px 0;
    padding: 0 40px 8px 0;
    border-bottom: 2px solid #8b6f47;
    color: #2d1810;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.music-map-sidebar .search-box {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 12px;
    border: 1px solid #d4c4a4;
    background: #fefdfb;
    color: #3d2817;
    border-radius: 2px;
    font-family: 'Merriweather', 'Georgia', serif;
    font-size: 13px;
}

.music-map-sidebar .location-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.music-map-sidebar .country-group {
    margin-bottom: 15px;
}

.music-map-sidebar .country-name {
    font-weight: 600;
    color: #2d1810;
    font-size: 14px;
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #d4c4a4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.music-map-sidebar .country-name:hover {
    color: #5d4a2f;
}

.music-map-sidebar .country-name .toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.music-map-sidebar .country-name.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.music-map-sidebar .city-list {
    list-style: none;
    padding-left: 12px;
    margin: 6px 0 0 0;
}

.music-map-sidebar .city-item {
    padding: 4px 8px;
    margin: 2px 0;
    cursor: pointer;
    color: #3d2817;
    font-size: 13px;
    border-radius: 2px;
    transition: background 0.2s ease;
}

.music-map-sidebar .city-item:hover {
    background: #e8d5b7;
}

.music-map-sidebar .city-item .artist-count {
    color: #8b6f47;
    font-size: 11px;
    margin-left: 4px;
}

/* Scrollbar styling for sidebar */
.music-map-sidebar::-webkit-scrollbar {
    width: 8px;
}

.music-map-sidebar::-webkit-scrollbar-track {
    background: #f4e4bc;
}

.music-map-sidebar::-webkit-scrollbar-thumb {
    background: #8b6f47;
    border-radius: 4px;
}

.music-map-sidebar::-webkit-scrollbar-thumb:hover {
    background: #6b5637;
}

/* Hide the external toggle button - we use internal toggle now */
.music-map-sidebar-toggle {
    display: none !important;
}

/* Sidebar collapsed state */
.music-map-sidebar.collapsed {
    width: 50px;
    padding: 10px;
    overflow: hidden;
}

.music-map-sidebar.collapsed h3,
.music-map-sidebar.collapsed .search-box,
.music-map-sidebar.collapsed .location-list {
    display: none;
}

/* Toggle button for collapse/expand */
.music-map-sidebar .toggle-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #8b6f47;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    line-height: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.music-map-sidebar .toggle-button:hover {
    color: #5d4a2f;
    background: rgba(139, 111, 71, 0.1);
    border-radius: 50%;
}

.music-map-sidebar.collapsed .toggle-button {
    position: static;
    margin: 0 auto;
    display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .music-map-sidebar {
        width: calc(100% - 40px);
        max-width: 320px;
        right: 10px;
    }

    .music-map-sidebar.collapsed {
        width: 50px;
    }
}

/* ==================================================
   ANIMATION ENHANCEMENTS
   ================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaflet-popup {
    animation: fadeIn 0.3s ease;
}

/* Marker pulse effect for newly added markers */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 111, 71, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(139, 111, 71, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 111, 71, 0);
    }
}

/* ==================================================
   DARK MODE SUPPORT (Optional)
   ================================================== */

@media (prefers-color-scheme: dark) {
    .leaflet-popup-content-wrapper,
    .leaflet-tooltip,
    .music-map-sidebar,
    .leaflet-control-search {
        background: #2d2419 !important;
        color: #e8d5b7 !important;
    }

    .leaflet-popup-content b,
    .music-map-sidebar h3,
    .music-map-sidebar .country-name {
        color: #f4e4bc !important;
    }

    .leaflet-popup-content li:before {
        color: #d4c4a4 !important;
    }
}
