/* Animaux Map Styles - Premium UI/UX */

:root {
    --animaux-primary: #2c3e50;
    --animaux-accent: #3498db;
    --animaux-success: #2ecc71;
    --animaux-danger: #e74c3c;
    --animaux-bg: #f5f7fa;
    --animaux-card-bg: rgba(255, 255, 255, 0.85);
    --animaux-border: rgba(255, 255, 255, 0.3);
    --animaux-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.animaux-map-container {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 40px 0;
    width: 100% !important;
    position: relative;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    left: 0;
    right: 0;
    background: var(--animaux-bg);
    overflow: hidden;
}

/* Glassmorphism Header & Controls */
.animaux-map-controls {
    display: flex;
    justify-content: flex-start;
    padding: 10px;
    background: transparent;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

.animaux-btn-premium {
    background: white;
    color: #444;
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid #eee;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.animaux-btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Advanced Filter Overlay */
.animaux-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.animaux-overlay.active {
    display: block;
    opacity: 1;
}

.overlay-content {
    background: white;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    position: relative;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.filter-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.filter-panel.active {
    transform: translateX(0);
}

.panel-header {
    padding: 20px 30px;
    border-bottom: 2px solid #000;
    margin-bottom: 0;
}

.header-close {
    color: #f7a072;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    margin-bottom: 10px;
}

.close-x {
    background: #f7a072;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.panel-title {
    font-size: 28px;
    font-weight: 800;
    font-style: italic;
    margin: 0;
    color: #000;
    text-align: center;
}

/* Search Bar in Panel */
.panel-search {
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid #000;
}

.panel-search .search-icon {
    color: #f7a072;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-search .search-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5px;
}

.panel-search input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 18px;
    font-family: 'Comfortaa', sans-serif;
    color: #333;
}

.panel-search input:focus {
    border-color: #000;
    outline: none;
}

/* Links and Options List */
.filter-links,
.filter-options {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.link-item,
.option-item {
    padding: 25px 30px;
    border-bottom: 2px solid #000;
    font-size: 18px;
    color: #a67c52;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    /* Centered as per image */
    align-items: center;
    position: relative;
    transition: background 0.2s;
}

.link-item {
    justify-content: center;
}

.link-item .arrow-r {
    position: absolute;
    right: 30px;
    font-size: 24px;
    color: #a67c52;
}

.link-item:hover,
.option-item:hover {
    background: #fdf5f0;
}

.option-item.active {
    font-weight: 700;
    background: #fdf5f0;
}

/* Map Styling */
#animaux-leaflet-map {
    width: 100% !important;
    height: 1200px !important;
    z-index: 1;
    background: #eef2f5;
}

/* Custom Colored Pins - Refined */
.animaux-custom-pin {
    background: none !important;
    border: none !important;
}

.pin-wrapper {
    position: relative;
    width: 32px;
    height: 44px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animaux-custom-pin:hover .pin-wrapper {
    transform: scale(1.1) translateY(-5px);
}

.pin-head {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 1px;
    transform: rotate(-45deg);
    border: 3px solid white;
}

.pin-head::after {
    content: '';
    width: 12px;
    height: 12px;
    background: white;
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pin-tip {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
}

/* Premium Popup Styling */
.animaux-custom-popup .leaflet-popup-content-wrapper {
    background: white;
    border-radius: 0;
    /* Square edges like in the image */
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.animaux-custom-popup .leaflet-popup-tip-container {
    display: none;
    /* Hide the tip for a cleaner card look if desired, or keep it */
}

.premium-popup {
    padding: 20px;
    font-family: 'Outfit', sans-serif;
    color: #333;
}

.popup-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}

.popup-close-trigger {
    color: #f7a072;
    /* Peach/Orange color from image */
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.popup-close-trigger .close-icon {
    background: #f7a072;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.popup-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.popup-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 800;
    margin: 0;
    color: #000;
    font-style: italic;
    line-height: 1.2;
}

.popup-category {
    background: #76a771;
    /* Green color from image */
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
}

.popup-section {
    margin-bottom: 20px;
}

.section-header.wood-bg {
    background: #a67c52;
    /* Fallback */
    background: linear-gradient(90deg, #8b5a2b, #a67c52, #8b5a2b);
    /* Wood simulation */
    /* If we had a real wood texture URL, we'd use it here */
    color: white;
    padding: 8px 15px;
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    position: relative;
    border-radius: 2px;
}

/* Simulate wood texture with a pseudo-element overlay */
.section-header.wood-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 2px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0px, rgba(0, 0, 0, 0.05) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.grid-img img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
}

.locations-content {
    font-size: 16px;
    line-height: 1.4;
}

.locations-content strong {
    font-weight: 600;
    color: #444;
}

.locations-content p {
    margin: 5px 0 0 0;
}

.popup-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-fiche {
    background: #76a771;
    color: white !important;
    text-decoration: none !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.btn-fiche:hover {
    background: #628b5e;
}

.btn-fiche .arrow {
    font-size: 22px;
}

/* Base Leaflet overrides */
.animaux-custom-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 380px !important; /* Cap for desktop/tablet */
    max-width: 90vw !important; /* Cap for mobile */
}

@media (max-width: 480px) {
    .animaux-custom-popup .leaflet-popup-content {
        width: 280px !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .animaux-map-header {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
    }

    .animaux-search-box,
    .animaux-filter-box,
    .animaux-reset-box {
        max-width: 100%;
    }

    #animaux-leaflet-map {
        height: 700px !important;
    }

    .animaux-map-controls {
        padding: 5px;
    }

    .animaux-btn-premium {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .popup-title {
        font-size: 1.5rem;
    }

    .popup-category {
        padding: 4px 12px;
        font-size: 0.8rem;
    }

    .section-header.wood-bg {
        font-size: 1.1rem;
        padding: 6px 12px;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .grid-img img {
        height: 100px;
    }

    .btn-fiche {
        width: 100%;
        justify-content: center;
        font-size: 1rem;
    }
}