/* ==========================================================================
   PORTAL DE LOS 5 ANIMALES GUÍAS - NEXT POINT TURISMO SAN MARTÍN
   Estilos modernos con Leaflet, fichas interactivas y mascotas amazónicas
   ========================================================================== */

:root {
    --mika-color: #16a34a;
    --mika-light: #dcfce7;
    --roko-color: #059669;
    --roko-light: #ecfdf5;
    --tito-color: #0284c7;
    --tato-color: #0284c7;
    --tito-light: #e0f2fe;
    --lia-color: #d97706;
    --lia-light: #fef3c7;
    --lalo-color: #dc2626;
    --lalo-light: #fee2e2;
}

body.portal-body {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Header del Portal */
.portal-topbar {
    background: #0b3d2c;
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.portal-brand {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-user-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #ef4444;
    color: #fff;
}

/* Hero Mascot Banner */
.mascot-hero-section {
    background: linear-gradient(135deg, #092c20 0%, #0d4633 60%, #064e3b 100%);
    color: #ffffff;
    padding: 40px 0 50px;
    position: relative;
    overflow: hidden;
}

.mascot-hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #f8fafc;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
}

/* Selector de Animales (Grid de 5) */
.animals-grid-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.animal-tab-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.animal-tab-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

.animal-tab-card.active {
    background: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    transform: translateY(-7px) scale(1.02);
}

.animal-tab-card.active .animal-emoji-box {
    transform: scale(1.15);
}

.animal-avatar-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    margin-bottom: 8px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    display: inline-block;
    transition: transform 0.3s ease;
}

.animal-tab-card.active .animal-avatar-thumb {
    transform: scale(1.12);
    border-color: #16a34a;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.35);
}

.animal-emoji-box {
    font-size: 38px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
    display: block;
}

.animal-name-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 4px;
}

.animal-spec-subtitle {
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.3;
    font-weight: 500;
}

.animal-tab-card.active .animal-spec-subtitle {
    color: #475569;
    font-weight: 600;
}

/* Burbuja de Saludo del Animal Activo */
.mascot-dialogue-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 22px 26px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border-left: 6px solid #16a34a;
    margin-top: -15px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.mascot-avatar-large {
    width: 80px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid #e2e8f0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mascot-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.btn-view-poster {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.btn-view-poster:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.mascot-speech-content h4 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.mascot-speech-content p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

/* Barra de Filtros Rápidos */
.filter-bar-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.city-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-city-filter {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-city-filter:hover,
.btn-city-filter.active {
    background: #0b3d2c;
    color: #ffffff;
    border-color: #0b3d2c;
}

.search-input-wrapper {
    position: relative;
    min-width: 260px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    box-sizing: border-box;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #16a34a;
}

.search-icon-pos {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

/* Grid de Lugares Turísticos */
.places-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Card Individual de Lugar */
.place-card-item {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.place-card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.place-img-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.place-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.place-card-item:hover .place-img-wrap img {
    transform: scale(1.06);
}

.place-badge-mascot {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.place-badge-city {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.place-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.place-category-pill {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #15803d;
    margin-bottom: 6px;
}

.place-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.3;
}

.place-description-snippet {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Píldoras de Información Clave: Precio y Tiempo de Senderismo */
.place-info-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.info-pill-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
}

.info-pill-icon {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1.2;
}

.info-pill-label {
    font-weight: 700;
    color: #334155;
    margin-right: 4px;
}

.info-pill-value {
    color: #0f172a;
    font-weight: 600;
}

.pill-highlight-price {
    color: #b45309;
    font-weight: 800;
}

.pill-highlight-walk {
    color: #047857;
    font-weight: 800;
}

/* Botones de Ruta y Mapa */
.place-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.btn-route-action {
    background: #0b3d2c;
    color: #ffffff;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.btn-route-action:hover {
    background: #16a34a;
    color: #fff;
}

.btn-gmaps-action {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.btn-gmaps-action:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Sección del Mapa Interactivo */
.map-section-wrapper {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    padding: 24px;
    margin-bottom: 50px;
    border: 1px solid #e2e8f0;
}

.map-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

#map-sanmartin {
    width: 100%;
    height: 480px;
    border-radius: 16px;
    z-index: 1;
}

.btn-my-location {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-my-location:hover {
    background: #0369a1;
}

/* Marcadores personalizados en Leaflet */
.custom-animal-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #ffffff;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid #16a34a;
    transition: transform 0.2s ease;
}

.custom-animal-marker:hover {
    transform: scale(1.25);
    z-index: 999;
}

/* Responsive */
@media (max-width: 992px) {
    .animals-grid-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .animals-grid-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    .places-grid-container {
        grid-template-columns: 1fr;
    }
    .place-card-actions {
        grid-template-columns: 1fr;
    }
}
