/**
 * Estilos para el mapa de avistamientos y componentes relacionados
 * public/css/aves.css
 */

/* Variables de colores */
:root {
    --color-primary: #2E7D32;    /* Verde principal */
    --color-secondary: #1565C0;  /* Azul */
    --color-accent: #795548;     /* Tono tierra */
    --color-light: #E8F5E9;      /* Verde claro */
    --color-dark: #1B5E20;       /* Verde oscuro */
    --color-danger: #d32f2f;     /* Rojo para especies en peligro */
    --color-warning: #f57c00;    /* Naranja para alertas */
}

/* Estilos generales para la sección de aves */
.bird-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bird-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.bird-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.bird-card .card-title {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.bird-card .scientific-name {
    font-style: italic;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.conservation-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-endangered-critical {
    background-color: var(--color-danger);
    color: white;
}

.status-endangered {
    background-color: var(--color-warning);
    color: white;
}

.status-vulnerable {
    background-color: #fbc02d;
    color: #333;
}

.status-near-threatened {
    background-color: #7cb342;
    color: white;
}

.status-least-concern {
    background-color: #388e3c;
    color: white;
}

/* Estilos para el mapa y sus componentes */
#bird-map {
    width: 100%;
    height: 700px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Estilos para marcadores de aves en el mapa */
.bird-marker-container {
    background: transparent;
    border: none;
}

.bird-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.user-location-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #4285F4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Estilos para la leyenda del mapa */
.legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

.legend h4 {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 600;
}

.legend i {
    width: 16px;
    height: 16px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
    border-radius: 50%;
}

/* Mensaje cuando no hay resultados en el mapa */
.no-results-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    min-width: 250px;
}

/* Estilos para el popup de aves en el mapa */
.bird-popup {
    min-width: 200px;
    max-width: 300px;
}

.bird-popup img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.bird-popup h5 {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.bird-popup .text-muted {
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* Estilos para el panel de filtros */
.filter-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-panel .filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

/* Estilos para la página de detalle de aves */
.bird-detail-hero {
    background-color: var(--color-light);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.bird-detail-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.bird-detail-info {
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.bird-detail-title {
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.bird-detail-scientific {
    font-style: italic;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.bird-detail-section {
    margin-bottom: 2rem;
}

.bird-detail-section h3 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.audio-player {
    width: 100%;
    margin: 1rem 0;
}

/* Estilos para el reproductor de audio */
.bird-song-player {
    display: flex;
    align-items: center;
    background-color: var(--color-light);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.bird-song-player button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 1rem;
    flex-shrink: 0;
}

.bird-song-player .player-info {
    flex-grow: 1;
}

.bird-song-player .player-info .song-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.bird-song-player .player-info .song-description {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* Estilos para la galería de imágenes */
.bird-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.bird-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
}

.bird-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bird-gallery-item:hover .bird-gallery-img {
    transform: scale(1.05);
}

/* Estilos para el formulario de reporte de avistamiento */
.report-form {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.report-form .form-title {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-light);
    padding-bottom: 0.5rem;
}

.location-preview-map {
    height: 200px;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Animaciones para carga y transiciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.card-ave {
    animation: fadeIn 0.5s ease-in-out;

    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.card-ave:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-ave .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* Panel de filtros */
.filter-card {
    position: sticky;
    top: 20px;
}

/* Estilo para el contenedor del reproductor de audio */
#audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #ddd;
    padding: 10px;
    z-index: 1000;
    text-align: center;
}

#audio-player {
    max-width: 500px;
    margin: 0 auto;
}

/* Estilos para la vista de lista */
#list-view .badge {
    white-space: normal;
}

/* Estilos responsive */
@media (max-width: 768px) {
    .bird-detail-img {
        height: 300px;
    }

    .bird-detail-info {
        margin-top: 1.5rem;
    }

    #bird-map {
        height: 500px;
    }

    .bird-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

        /* Ajustes para la tarjeta de filtros en móviles */
        .filter-card {
            position: relative;
            top: 0;
            margin-bottom: 1rem;
        }

        /* Hacer que las tarjetas ocupen el ancho completo en móviles */
        .card-ave {
            margin-bottom: 15px;
        }

        /* Ajustar el mapa para dispositivos móviles */
        #mapa-aves {
            height: 250px;
        }

        /* Estilo para el botón de alternar mapa */
        #toggle-map {
            margin-bottom: 1rem;
        }

        /* Reducir el tamaño del reproductor de audio */
        #audio-player {
            width: 100%;
        }
}

@media (max-width: 576px) {
    .bird-detail-img {
        height: 250px;
    }

    #bird-map {
        height: 400px;
    }

    .bird-song-player {
        flex-direction: column;
        align-items: flex-start;
    }

    .bird-song-player button {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* Estilos para los estados de conservación */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #212529 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Estilos para la vista activa de los botones de cambio de vista */
#view-grid.active, #view-list.active {
    background-color: var(--color-primary);
    color: white;
}

/* Estilos para el cluster de marcadores en el mapa */
.marker-cluster {
    background-color: rgba(46, 125, 50, 0.6);
}

.marker-cluster div {
    background-color: rgba(46, 125, 50, 0.8);
    color: white;
    font-weight: bold;
}

/* Estilos para la vista de lista */
#aves-container.row-cols-1 .card {
    flex-direction: row;
    align-items: center;
}

#aves-container.row-cols-1 .card-img-top {
    width: 200px;
    height: 200px;
    object-fit: cover;
}

#aves-container.row-cols-1 .card-body {
    padding: 1rem;
}

/* Estilos para los botones de vista */
.btn-group .btn.active {
    background-color: #0d6efd;
    color: white;
}

.leaflet-popup-content .btn-popup {
    color: #ffffff;
    background-color:rgb(24, 99, 31);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.leaflet-popup-content .btn-popup:hover {
    background-color: #0b5ed7;
    color: #ffffff;
}
