/* Mapa de Experiências - Estilos Principais */

/* Ocultar título da página */
.page .entry-title,
.page h1.page-title,
.page h1.entry-title,
body.page h1:first-of-type {
    display: none !important;
}

/* Variáveis CSS - Paleta Tríade */
:root {
    --primary-blue: #4A90E2;
    --primary-green: #7ED321;
    --primary-yellow: #F5A623;
    --gradient-blue: linear-gradient(135deg, #4A90E2, #357ABD);
    --gradient-green: linear-gradient(135deg, #7ED321, #6BB71A);
    --gradient-yellow: linear-gradient(135deg, #F5A623, #E6951C);
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --border-light: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

/* Reset e Base */
#mapa-experiencias-container * {
    box-sizing: border-box;
}

.mapa-experiencias-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 90vh;
    background: var(--bg-light);
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    z-index: 9999;
    margin-bottom: 0;
}

/* Filtros */
.mapa-filtros {
    background: white;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    z-index: 10000;
    position: relative;
}

.filtros-container {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10001;
}

.filtros-linha {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.filtro-grupo {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filtro-grupo label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin: 0;
}

.filtro-grupo select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.tags-filtros {
    margin-top: 15px;
}

.tags-filtros h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.tags-list h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.tags-counter {
    background: #4A90E2;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    display: none;
}

.tags-counter.active {
    display: inline-block;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Layout mobile para tags e filtros */
@media (max-width: 768px) {
    .tags-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .tag-button {
        width: 100%;
        justify-content: flex-start;
        margin: 0;
    }
    
    /* Filtros em coluna no mobile */
    .filtros-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .filtros-linha {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .filtro-grupo {
        width: 100%;
    }
}

.filtros-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 0;
}

.filtros-normais {
    flex: 1;
    min-width: 300px;
}

.filtros-tags {
    flex: 2;
    min-width: 400px;
}

.tag-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    margin: 2.5px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    color: white;
    position: relative;
}

.tag-button.selected {
    border: 2px solid #333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.2);
    transform: scale(1.02);
}

.tag-button.selected::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #333;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.tag-button .tag-icon {
    color: var(--tag-text-color, white);
}

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

.tag-button.selected {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transform: scale(0.98);
}

.tag-button input[type="checkbox"] {
    display: none;
}

.tag-icon {
    margin-right: 8px;
    font-size: 16px;
}

.filtros-sidebar {
    width: 300px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: 70vh;
}

.btn-limpar-filtros.card-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-align: center;
    display: block;
    width: 100%;
}

.limpar-filtros:hover {
    background: #357abd;
}

/* Loading */
.mapa-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Layout Principal */
.mapa-content {
    display: flex;
    height: calc(90vh - 80px);
    width: 100%;
    overflow: hidden;
    margin-bottom: 0;
}

.tags-sidebar {
    width: 20%;
    background: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #e9ecef;
    height: 100%;
    overflow-y: auto;
    z-index: 10000;
    position: relative;
    box-sizing: border-box;
}

.tags-sidebar h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Cards Desktop */
.mapa-cards {
    width: 40%;
    background: white;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.cards-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-content: start;
}

.mapa-container {
    width: 40%;
    position: relative;
    height: 100%;
}

.cards-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cards-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 18px;
}

#cards-count {
    color: var(--text-light);
    font-size: 14px;
}

.cards-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    z-index: 10000;
    position: relative;
}

/* Card Individual */
.experiencia-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
    height: fit-content;
}

.experiencia-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.experiencia-card.highlighted {
    border-color: var(--primary-yellow);
    background: rgba(245, 166, 35, 0.05);
}

.card-image {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.3;
}

.card-location {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-location i {
    color: var(--primary-blue);
    font-size: 16px;
}

.card-resumo {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: white;
}

.card-tag i {
    font-size: 12px;
}

.card-btn {
    background: var(--gradient-yellow);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
    text-align: center;
}

.card-btn:hover {
    transform: translateY(-1px);
}

/* Mapa */
.mapa-container {
    flex: 1;
    position: relative;
    z-index: 10000;
}

#mapa {
    width: 100%;
    height: 100%;
}

/* Customização Leaflet com cores da tríade */
.leaflet-container {
    background: var(--bg-light);
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: inherit;
}

/* Pin customizado amarelo */
.custom-pin {
    background: var(--primary-yellow);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Botão Filtros Mobile */
.btn-filtros-mobile {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--gradient-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cards Mobile (Bottom Sheet) */
.mapa-cards-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transform: translateY(calc(100% - 80px));
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: 70vh;
}

.mapa-cards-mobile.expanded {
    transform: translateY(0);
}

.cards-mobile-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.drag-handle {
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.cards-mobile-container {
    overflow-y: auto;
    padding: 10px 15px;
    max-height: calc(70vh - 80px);
}

/* Modal Filtros Mobile */
.modal-filtros-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.btn-fechar {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: center;
    flex-shrink: 0;
}

.btn-aplicar {
    background: var(--gradient-green);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    width: 100%;
    font-size: 16px;
}

/* Loading */
.mapa-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Botões de filtros mobile estilo Airbnb */
.mobile-filter-buttons {
    display: none;
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    gap: 10px;
}

@media (max-width: 768px) {
    .mobile-filter-buttons {
        display: flex;
    }
}

.mobile-filter-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-filter-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-limpar {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
}

.btn-limpar:hover {
    background: #ff3838;
    border-color: #ff3838;
}

.mobile-filter-btn.active {
    background: #333;
    color: white;
}

/* Responsivo Tablet - 768px a 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .cards-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .experiencia-card {
        padding: 12px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-location {
        font-size: 13px;
    }
    
    .card-resumo {
        font-size: 12px;
    }
    
    .card-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .card-tags {
        gap: 4px;
        margin-bottom: 8px;
    }
}

/* Responsivo Desktop Pequeno - 1024px a 1200px */
@media (min-width: 1025px) and (max-width: 1200px) {
    .cards-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Responsivo Desktop Médio - 1200px a 1530px */
@media (min-width: 1201px) and (max-width: 1530px) {
    .cards-list {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .experiencia-card {
        padding: 12px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Desktop Grande - acima de 1530px (sem scroll horizontal) */
@media (min-width: 1531px) {
    .cards-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
        overflow-x: hidden;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .mobile-filter-buttons {
        display: flex;
    }
    
    /* Garante que modais não abram automaticamente */
    .modal-filtros-mobile {
        display: none;
    }
    
    .modal-filtros-mobile.show {
        display: flex;
    }
    
    .mapa-filtros {
        display: none;
    }
    
    .mapa-experiencias-container {
        width: 100vw;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        height: 100vh;
        position: relative;
        z-index: 1;
    }
    
    .mapa-content {
        flex-direction: column;
        height: 100vh;
        padding-top: 70px;
        position: relative;
        z-index: 1;
    }
    
    .tags-sidebar {
        display: none;
    }
    
    .mapa-cards {
        display: none;
    }
    
    .mapa-container {
        width: 100%;
        height: 50vh;
        order: 1;
        position: relative;
        z-index: 1;
    }
    
    .cards-list {
        display: none;
    }
    
    /* Cards mobile - 1 por linha */
    .mapa-cards-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        transform: translateY(calc(100% - 80px));
        transition: transform 0.3s ease;
        z-index: 999;
        max-height: 50vh;
        order: 2;
        display: block;
    }
    
    .mapa-cards-mobile.expanded {
        transform: translateY(0);
    }
    
    .cards-mobile-container {
        padding: 15px;
        overflow-y: auto;
        max-height: calc(50vh - 80px);
    }
    
    .cards-mobile-header {
        padding: 10px 20px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }
    
    .drag-handle {
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 0 auto 10px;
    }
    
    .card-mobile {
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        margin-bottom: 15px;
        overflow: hidden;
        width: 100%;
    }
    
    .card-mobile:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .mobile-filter-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
