/* Território do Bem - Estilos CSS */

:root {
    /* Safe areas para dispositivos com notch */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    
    /* Touch targets mínimos (WCAG 2.1) */
    --touch-target-min: 44px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Melhorar tap highlight */
* {
    -webkit-tap-highlight-color: rgba(47, 108, 132, 0.15);
}

/* Acessibilidade: elementos apenas para leitores de tela */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #EAE7E2;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* Safe areas para dispositivos com notch */
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    /* Prevenir elastic scroll no iOS */
    overscroll-behavior-y: none;
    /* Melhorar performance de scroll */
    -webkit-overflow-scrolling: touch;
}

/* Prevenir zoom em inputs no iOS */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

#map {
    position: absolute;
    top: 80px;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}

/* Ocultar atribuição do Leaflet */
.leaflet-control-attribution {
    display: none !important;
}

/* Controls Panel - iOS 18 Flat */
.controls-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(234, 231, 226, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    z-index: 1000;
    overflow: visible;
}

.controls-header {
    padding: calc(12px + var(--safe-top)) 16px 12px;
    border-bottom: 1px solid #E6D2B5;
    background: linear-gradient(135deg, #2F6C84 0%, #2F6C84 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.controls-header .controls-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.controls-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.controls-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.controls-link:hover::before {
    width: 300px;
    height: 300px;
}

.controls-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

.controls-link:active {
    transform: translateY(-1px) scale(1.02);
}

.download-button {
    border-color: transparent;
    background: linear-gradient(135deg, #C44C2D 0%, #A03A25 100%);
    box-shadow: 0 4px 16px rgba(196, 76, 45, 0.3);
}

.download-button:hover {
    background: linear-gradient(135deg, #A03A25 0%, #8B2E1E 100%);
    box-shadow: 0 6px 24px rgba(196, 76, 45, 0.5);
}

.about-button {
    border-color: rgba(230, 210, 181, 0.5);
    background: linear-gradient(135deg, rgba(230, 210, 181, 0.4) 0%, rgba(230, 210, 181, 0.3) 100%);
}

.about-button:hover {
    background: linear-gradient(135deg, rgba(230, 210, 181, 0.6) 0%, rgba(230, 210, 181, 0.4) 100%);
    border-color: rgba(230, 210, 181, 0.8);
}

.button-icon {
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.button-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.button-icon svg path {
    fill: currentColor;
}

.controls-link:hover .button-icon {
    transform: scale(1.2);
}

.button-text {
    font-weight: 700;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 1;
}
.controls-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.controls-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.controls-content {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #E6D2B5;
    border-radius: 6px;
    font-size: 14px;
    background: #EAE7E2;
    width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #2F6C84;
    background: white;
}

/* Year Selector - iPhone Style */
.year-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.year-button-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.year-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1000;
}

.year-button:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.year-button:active {
    transform: translateY(0);
}

.year-label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.year-value {
    font-size: 16px;
    color: #2F6C84;
    font-weight: 600;
}

.year-arrow {
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.3s ease;
    display: inline-block;
}

.year-button:hover .year-arrow {
    transform: translateY(2px);
}

.year-separator {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.search-container {
    position: relative;
}

.categories-container {
    position: relative;
    z-index: 2000;
}

.categories-button {
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #2F6C84;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.categories-button:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.categories-button svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    transition: transform 0.2s ease;
}

.categories-button svg path {
    fill: #2F6C84;
}

.categories-button:hover svg {
    transform: scale(1.1);
}

/* Categories Dropdown - iOS 18 Style */
.categories-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(234, 231, 226, 0.96);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999999; /* Acima do botão de acessibilidade */
    min-width: 280px;
    max-width: 320px;
    max-height: 500px;
    overflow: hidden;
    margin-top: 16px;
    animation: dropdownFadeIn 0.25s ease;
    display: flex;
    flex-direction: column;
}

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

.categories-list {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
}

.categories-list::-webkit-scrollbar {
    width: 6px;
}

.categories-list::-webkit-scrollbar-track {
    background: transparent;
}

.categories-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.category-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.category-item:active {
    background: rgba(0, 0, 0, 0.1);
}

/* iOS Style Checkbox */
.category-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
}

.category-checkbox:checked {
    background: #2F6C84;
    border-color: #2F6C84;
}

.category-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.category-label {
    font-size: 15px;
    color: #2F6C84;
    flex: 1;
    font-weight: 400;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Categories Footer - iOS 18 Style */
.categories-footer {
    display: flex !important;
    gap: 12px;
    padding: 16px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    background: rgba(230, 210, 181, 0.98);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.category-button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: -0.3px;
}

.category-button.cancel {
    background: rgba(120, 120, 128, 0.12);
    color: #2F6C84;
}

.category-button.cancel:hover {
    background: rgba(120, 120, 128, 0.18);
}

.category-button.cancel:active {
    background: rgba(120, 120, 128, 0.24);
    transform: scale(0.98);
}

.category-button.apply {
    background: #2F6C84;
    color: white;
}

.category-button.apply:hover {
    background: #1e4a5a;
}

.category-button.apply:active {
    background: #163a47;
    transform: scale(0.98);
}

.apply-filters {
    width: 100%;
    padding: 8px 16px;
    background: #2F6C84;
    border: 1px solid #2F6C84;
    border-radius: 6px;
    font-size: 14px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.apply-filters:hover {
    background: #1e4a5a;
    border-color: #1e4a5a;
}

.clear-filters {
    width: 100%;
    padding: 8px 16px;
    background: #E6D2B5;
    border: 1px solid #E6D2B5;
    border-radius: 6px;
    font-size: 14px;
    color: #2F6C84;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: #C44C2D;
    color: white;
}

.results-count {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    color: #2F6C84;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    letter-spacing: -0.2px;
}

/* Custom Zoom Controls - iOS 18 Pure Minimal */
/* ==========================================
   Video Controls - Botão de Vídeos
   ========================================== */
.video-controls {
    position: fixed;
    bottom: 200px;
    right: 16px;
    z-index: 1001;
}

.video-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C44C2D, #A03A25);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(196, 76, 45, 0.4);
    transition: all 0.3s ease;
}

.video-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(196, 76, 45, 0.5);
}

.video-button svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.video-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-header-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.video-title-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 8px;
}

#videoTitle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-button.active {
    background: linear-gradient(135deg, #A03A25, #7a2c1c);
}

/* Video Popup */
.video-popup {
    position: absolute;
    bottom: 55px;
    right: 0;
    width: 260px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 10000;
}

.video-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    z-index: 9999999; /* Acima do botão de acessibilidade quando aberto */
}

.video-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2F6C84, #1e4a5a);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.video-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-popup-list {
    padding: 8px;
    max-height: 350px;
    overflow-y: auto;
}

.video-item {
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #2F6C84;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-item:hover {
    background: #e8f0fe;
    transform: translateX(4px);
}

.video-item:active {
    background: #d0e3f7;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
    z-index: 9999999; /* Acima do botão de acessibilidade (999999) */
}

.video-modal-content {
    width: 90%;
    max-width: 900px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal.active .video-modal-content {
    transform: scale(1);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2F6C84, #1e4a5a);
    color: white;
}

.video-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.video-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.video-modal-body {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.video-modal-body video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Responsivo para vídeos */
@media (max-width: 768px) {
    /* Reduzir animações em mobile para melhor performance */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    .custom-zoom-controls {
        bottom: calc(90px + var(--safe-bottom));
        right: calc(12px + var(--safe-right));
    }
    
    .video-controls {
        bottom: calc(208px + var(--safe-bottom));
        right: calc(12px + var(--safe-right));
    }
    
    .video-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .video-popup {
        bottom: 50px;
        width: 260px;
        max-height: 50vh;
    }
    
    .video-popup-header {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .video-popup-list {
        max-height: calc(50vh - 50px);
        padding: 6px;
    }
    
    .video-item {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
        border-radius: 8px;
    }
    
    .video-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
    }
    
    .video-modal-header {
        padding: 16px;
        padding-top: calc(16px + env(safe-area-inset-top));
    }
    
    .video-modal-header h3 {
        font-size: 16px;
    }
    
    .video-modal-close {
        width: 44px;
        height: 44px;
    }
    
    .video-modal-body {
        padding-top: 0;
        height: calc(100vh - 70px);
    }
    
    .video-modal-body video {
        position: relative;
        height: 100%;
        width: 100%;
    }
}

/* Telas muito pequenas */
@media (max-width: 375px) {
    .custom-zoom-controls {
        bottom: 80px;
        right: 10px;
    }
    
    .video-controls {
        bottom: 195px;
        right: 10px;
    }
    
    .video-button {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .video-popup {
        width: 240px;
    }
    
    .video-item {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.custom-zoom-controls {
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Fit to Points Button - iOS 18 Pure Style */
.fit-to-points-button {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.fit-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: none;
    border-radius: 50px;
    color: #2F6C84;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.15s ease;
    letter-spacing: -0.3px;
}

.fit-button:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-1px) scale(1.02);
}

.fit-button:active {
    transform: translateY(0) scale(0.98);
    background: rgba(235, 235, 235, 0.95);
}

.fit-icon {
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fit-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    transition: transform 0.2s ease;
}

.fit-icon svg path {
    fill: #1C1C1E;
}

.fit-button:hover .fit-icon svg {
    transform: scale(1.1);
}

.fit-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.zoom-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 400;
    color: #2F6C84;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.15s ease;
}

.zoom-button:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: scale(1.06);
}

.zoom-button:active {
    transform: scale(0.94);
    background: rgba(235, 235, 235, 0.95);
}

/* ==========================================
   Content Panel - Google Maps Style
   ========================================== */
.content-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15), 4px 0 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.content-panel.open {
    transform: translateX(0);
}

/* Esconder botões flutuantes quando o painel de detalhes estiver aberto */
body.content-panel-open .video-controls,
body.content-panel-open .a11y-fab {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* Botão fechar flutuante */
.content-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    color: #5f6368;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 400;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.content-close:hover {
    background: #ffffff;
    color: #C44C2D;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Galeria de imagens no topo */
.content-gallery {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #2F6C84 0%, #1e4a5a 100%);
    overflow: hidden;
    flex-shrink: 0;
}

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

.content-gallery:hover img {
    transform: scale(1.03);
}

.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #5f6368;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    opacity: 0;
}

.content-gallery:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

/* Header com título */
.content-header {
    padding: 20px 20px 16px;
    background: #ffffff;
    border-bottom: none;
}

.content-title {
    font-size: 22px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 4px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.content-subtitle {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.content-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rating-badge {
    background: #2F6C84;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #70757a;
    flex-wrap: wrap;
}

.content-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Botões de ação estilo Google Maps */
.content-actions-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e8eaed;
    overflow-x: auto;
    scrollbar-width: none;
}

.content-actions-bar::-webkit-scrollbar {
    display: none;
}

.action-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 80px;
}

.action-chip:hover {
    background: #e8f0fe;
    border-color: #2F6C84;
}

.action-chip-icon {
    font-size: 20px;
}

.action-chip-text {
    font-size: 12px;
    font-weight: 500;
    color: #2F6C84;
}

.action-chip.primary {
    background: linear-gradient(135deg, #2F6C84, #1e4a5a);
    border-color: #2F6C84;
}

.action-chip.primary .action-chip-icon,
.action-chip.primary .action-chip-text {
    color: white;
}

.action-chip.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 108, 132, 0.3);
}

/* Corpo do conteúdo */
.content-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-body::-webkit-scrollbar {
    width: 6px;
}

.content-body::-webkit-scrollbar-track {
    background: transparent;
}

.content-body::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

/* Seções de informação */
.info-section {
    padding: 16px 20px;
    border-bottom: 1px solid #e8eaed;
}

.info-section:last-child {
    border-bottom: none;
}

.info-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-description {
    font-size: 14px;
    line-height: 1.7;
    color: #3c4043;
    margin: 0;
}

/* Detalhes em lista */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 -8px;
    padding: 8px;
    transition: background 0.2s ease;
}

.info-item:hover {
    background: #f8f9fa;
}

.info-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #2F6C84;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-item-content {
    flex: 1;
}

.info-item-label {
    font-size: 14px;
    color: #202124;
    font-weight: 500;
    line-height: 1.4;
}

.info-item-value {
    font-size: 13px;
    color: #70757a;
    margin-top: 2px;
}

.info-item-link {
    color: #2F6C84;
    text-decoration: none;
    font-weight: 500;
}

.info-item-link:hover {
    text-decoration: underline;
}

/* Tags modernizadas */
.content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.content-tag {
    background: #e8f0fe;
    color: #2F6C84;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.content-tag:hover {
    background: #2F6C84;
    color: white;
    transform: translateY(-1px);
}

/* Link Externo */
.external-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2F6C84, #3d8ba6);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(47, 108, 132, 0.25);
    margin-top: 8px;
}

.external-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 108, 132, 0.35);
    background: linear-gradient(135deg, #3d8ba6, #2F6C84);
}

.external-link-icon {
    font-size: 16px;
}

.external-link-text {
    flex: 1;
}

.external-link-arrow {
    font-size: 12px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.external-link-btn:hover .external-link-arrow {
    transform: translateX(3px);
}

/* Pesquisador(a) */
.researcher-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 8px;
}

.researcher-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2F6C84, #1e4a5a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.researcher-info {
    flex: 1;
}

.researcher-name {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
}

.researcher-role {
    font-size: 12px;
    color: #70757a;
}

/* Botões de ação antigos (compatibilidade) */
.content-actions {
    display: none;
}

.content-details {
    display: none;
}

.detail-item, .detail-icon, .detail-text, .detail-value {
    display: none;
}

/* Ações fixas no rodapé */
.content-footer {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e8eaed;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.footer-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.footer-btn-primary {
    background: #2F6C84;
    color: white;
    border: none;
}

.footer-btn-primary:hover {
    background: #1e4a5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 108, 132, 0.3);
}

.footer-btn-secondary {
    background: #ffffff;
    color: #2F6C84;
    border: 2px solid #2F6C84;
}

.footer-btn-secondary:hover {
    background: #e8f0fe;
}

/* Responsivo */
@media (max-width: 768px) {
    .content-panel {
        width: 100%;
        max-width: none;
        border-radius: 0;
        /* Considerar safe areas */
        height: 100vh;
        height: calc(100vh - var(--safe-top));
    }
    
    .content-close {
        top: calc(12px + var(--safe-top));
        right: calc(12px + var(--safe-right));
        /* Touch target adequado */
        width: var(--touch-target-min);
        height: var(--touch-target-min);
        font-size: 22px;
    }
    
    .content-gallery {
        height: 220px;
        margin-top: var(--safe-top);
    }
    
    .content-actions-bar {
        padding: 14px 16px;
    }
    
    .action-chip {
        min-width: 80px;
        min-height: var(--touch-target-min);
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .content-body {
        padding: 20px 16px;
        padding-bottom: calc(20px + var(--safe-bottom));
    }
    
    .content-footer {
        padding-bottom: calc(16px + var(--safe-bottom));
    }
    
    .footer-btn {
        min-height: var(--touch-target-min);
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Compatibilidade com código antigo */
.action-button {
    background: linear-gradient(135deg, #C44C2D 0%, #A03A25 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(196, 76, 45, 0.3);
}

.action-button.primary:hover {
    background: linear-gradient(135deg, #A03A25 0%, #8B2E1E 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(196, 76, 45, 0.4);
}

.action-button:active {
    transform: translateY(-1px) scale(0.98);
}

.loading-overlay {
    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: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E6D2B5;
    border-top: 4px solid #2F6C84;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    color: #2F6C84;
    font-size: 14px;
}

.custom-marker {
    background: #2F6C84;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2.5px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.custom-marker:hover {
    transform: scale(1.1);
}

.custom-marker.selected {
    background: #C44C2D;
    transform: scale(1.2);
}

/* Marker Dots - iOS 18 Flat */
.marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2F6C84;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.marker-dot .dot-inner {
    display: none;
}

.marker-dot:hover {
    transform: scale(1.3);
    z-index: 1000 !important;
}

.marker-dot.selected {
    background: #C44C2D;
    transform: scale(1.5);
}

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

.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    overflow: hidden;
}

.custom-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.96);
}

.leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    overflow: hidden;
}

.leaflet-popup-tip-container {
    text-align: center;
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.96);
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 280px !important;
}

.popup-content {
    padding: 16px;
}

.popup-title {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 12px;
    color: #000000;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.popup-description {
    font-size: 14px;
    color: #2F6C84;
    margin-bottom: 12px;
    line-height: 1.4;
}

.popup-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.popup-date {
    font-size: 12px;
    color: #2F6C84;
    display: flex;
    align-items: center;
    gap: 4px;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.popup-tag {
    background: rgba(47, 108, 132, 0.1);
    color: #2F6C84;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

.popup-tag:hover {
    background: rgba(47, 108, 132, 0.8);
    color: white;
    transform: translateY(-1px);
}

/* ==========================================
   Popup Moderno estilo Google Maps
   ========================================== */
.popup-container-modern .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    overflow: hidden;
    padding: 0;
}

.popup-container-modern .leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-width: 280px;
    max-width: 320px;
}

.popup-container-modern .leaflet-popup-tip {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-modern {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
}

.popup-image {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #2F6C84, #1e4a5a);
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.popup-modern:hover .popup-image img {
    transform: scale(1.05);
}

.popup-image-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.popup-body {
    padding: 14px 16px;
}

.popup-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.popup-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.popup-title-area {
    flex: 1;
    min-width: 0;
}

.popup-modern .popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.popup-category {
    font-size: 13px;
    color: #70757a;
    margin-top: 2px;
}

.popup-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #5f6368;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.popup-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.popup-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #2F6C84, #1e4a5a);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.popup-modern:hover .popup-cta {
    background: linear-gradient(135deg, #1e4a5a, #153544);
    transform: translateY(-1px);
}

.popup-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.popup-modern:hover .popup-arrow {
    transform: translateX(4px);
}

/* Popup responsivo para mobile */
@media (max-width: 768px) {
    .popup-container-modern .leaflet-popup-content {
        min-width: 260px;
        max-width: 300px;
    }
    
    .popup-image {
        height: 120px;
    }
    
    .popup-body {
        padding: 12px 14px;
    }
    
    .popup-modern .popup-title {
        font-size: 15px;
    }
    
    .popup-category {
        font-size: 12px;
    }
    
    .popup-info {
        font-size: 11px;
        gap: 12px;
    }
    
    .popup-cta {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Image Gallery Styles */
.image-gallery {
    margin-bottom: 20px;
}

.main-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.main-image:hover {
    transform: scale(1.02);
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.thumbnail {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 1;
    border-color: #2F6C84;
}

.thumbnail.active {
    opacity: 1;
    border-color: #C44C2D;
}

.image-counter {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.image-container {
    position: relative;
}

/* iOS Picker Wheel Modal - iOS 18 Style Centered */
.ios-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999; /* Acima do botão de acessibilidade */
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-modal-container {
    background: rgba(234, 231, 226, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    max-height: 90dvh; /* Dynamic viewport height para mobile */
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.ios-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* Impede que o header encolha */
}

.ios-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #2F6C84;
    margin: 0;
    letter-spacing: -0.4px;
}

.ios-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #8e8e93;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    line-height: 1;
}

.ios-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ios-modal-close:active {
    background: rgba(0, 0, 0, 0.1);
}

/* iOS Picker Wheel */
.ios-picker-container {
    height: 280px;
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    flex-shrink: 0; /* Impede que o picker encolha */
}

.ios-picker-highlight {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 40px;
    transform: translateY(-50%);
    background: rgba(47, 108, 132, 0.08);
    border-radius: 8px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    z-index: 1;
    pointer-events: none;
}

.ios-picker-fade-top,
.ios-picker-fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 2;
    pointer-events: none;
}

.ios-picker-fade-top {
    top: 0;
    background: linear-gradient(to bottom, 
        rgba(234, 231, 226, 1) 0%, 
        rgba(234, 231, 226, 0.8) 50%,
        rgba(234, 231, 226, 0) 100%);
}

.ios-picker-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, 
        rgba(234, 231, 226, 1) 0%, 
        rgba(234, 231, 226, 0.8) 50%,
        rgba(234, 231, 226, 0) 100%);
}

.ios-picker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.ios-picker-list:active {
    cursor: grabbing;
}

.ios-picker-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 400;
    color: #2F6C84;
    letter-spacing: -0.5px;
    transition: all 0.1s ease;
}

.ios-picker-item.selected {
    font-weight: 600;
    color: #2F6C84;
}

/* iOS Modal Footer */
.ios-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* Impede que o footer encolha */
}

.ios-modal-button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: -0.3px;
}

.ios-modal-button.cancel {
    background: rgba(120, 120, 128, 0.12);
    color: #2F6C84;
}

.ios-modal-button.cancel:hover {
    background: rgba(120, 120, 128, 0.18);
}

.ios-modal-button.cancel:active {
    background: rgba(120, 120, 128, 0.24);
    transform: scale(0.98);
}

.ios-modal-button.confirm {
    background: #2F6C84;
    color: white;
}

.ios-modal-button.confirm:hover {
    background: #1e4a5a;
}

.ios-modal-button.confirm:active {
    background: #163a47;
    transform: scale(0.98);
}

/* ===================================
   RESPONSIVIDADE MOBILE - iOS Style
   =================================== */

/* Tablets e Mobile Grande (max-width: 1024px) */
@media (max-width: 1024px) {
    .controls-main {
        padding: 12px 14px;
        gap: 8px;
    }
    
    .controls-title {
        font-size: 18px;
    }
    
    .logo-image {
        height: 24px;
    }
}

/* Mobile Médio (max-width: 768px) */
@media (max-width: 768px) {
    /* Header compacto */
    .controls-header {
        padding: 10px 14px;
    }
    
    .controls-title {
        font-size: 16px;
        gap: 6px;
    }
    
    .logo-image {
        height: 20px;
    }
    
    .controls-links {
        gap: 8px;
    }
    
    .controls-link {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 10px;
    }
    
    .button-icon svg {
        width: 16px;
        height: 16px;
    }
    
    /* Controles principais - layout em linha */
    .controls-content {
        padding: 12px 16px;
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .controls-main {
        padding: 12px 16px;
        gap: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }
    
    .year-selector {
        min-width: auto;
        justify-content: center;
    }
    
    .year-button-container {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: center;
    }
    
    .year-button {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 75px;
    }
    
    .categories-container {
        display: flex;
        justify-content: center;
    }
    
    .categories-button {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
        min-width: 130px;
        justify-content: center;
    }
    
    .categories-button svg {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .results-count {
        padding: 10px 16px;
        font-size: 13px;
        text-align: center;
        min-width: 120px;
    }
    
    /* Zoom controls maiores para touch */
    .zoom-controls {
        right: 12px;
        bottom: 100px;
        gap: 10px;
    }
    
    .zoom-btn,
    .fit-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .fit-btn {
        padding: 0;
        font-size: 18px;
    }
    
    .fit-icon svg {
        width: 18px;
        height: 18px;
    }
    
    /* Markers maiores no mobile */
    .custom-marker {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
    
    .marker-dot {
        width: 14px;
        height: 14px;
    }
    
    /* Popups otimizados para mobile */
    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 40px);
        border-radius: 14px;
    }
    
    .leaflet-popup-content {
        margin: 14px;
        font-size: 14px;
    }
    
    .popup-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .popup-image {
        height: 180px;
        border-radius: 10px;
        margin: 10px 0;
    }
    
    .popup-tag {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .popup-close-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    /* Modal de anos */
    .year-modal {
        width: 90%;
        max-width: 320px;
        padding: 20px;
        border-radius: 14px;
    }
    
    .year-modal h3 {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .year-picker-wheel {
        height: 220px;
    }
    
    .year-item {
        font-size: 18px;
        padding: 10px;
    }
    
    /* Dropdown de categorias */
    .categories-dropdown {
        width: calc(100vw - 24px);
        max-width: 340px;
        left: 12px;
        right: 12px;
        margin: 0 auto;
        max-height: 60vh;
    }
    
    .categories-list {
        max-height: calc(60vh - 120px);
    }
    
    .category-item {
        padding: 12px 16px;
    }
    
    .category-item label {
        font-size: 14px;
    }
    
    .ios-modal-button {
        padding: 12px;
        font-size: 15px;
    }
}

/* Mobile Pequeno (max-width: 480px) */
@media (max-width: 480px) {
    /* Header - Logo maior com texto do lado */
    .controls-header {
        padding: 12px 16px;
        flex-direction: row;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
    }
    
    .controls-title {
        font-size: 14px;
        font-weight: 600;
        gap: 10px;
        display: flex;
        align-items: center;
    }
    
    .controls-title span {
        display: inline; /* Mostrar texto */
        font-size: 13px;
    }
    
    .logo-image {
        height: 32px; /* Logo maior */
        width: auto;
    }
    
    .controls-subtitle {
        font-size: 11px;
        margin-top: 2px;
    }
    
    .controls-links {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .controls-link {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 10px;
        justify-content: center;
        align-items: center;
    }
    
    .button-icon {
        font-size: 16px;
        margin: 0;
    }
    
    /* Mostrar só ícones nos botões */
    .controls-link .button-text {
        display: none;
    }
    
    .button-icon svg {
        width: 18px;
        height: 18px;
    }
    
    /* Controles principais - mesma largura */
    .controls-content {
        padding: 10px 16px;
        gap: 8px;
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-main {
        padding: 10px 12px;
        gap: 8px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Anos, Categorias e Locais com mesma largura */
    .year-selector {
        width: 100%;
    }
    
    .year-button-container {
        width: 100%;
        gap: 8px;
        justify-content: center;
    }
    
    .year-button {
        flex: 1;
        padding: 10px 12px;
        font-size: 14px;
        min-width: 70px;
        text-align: center;
        justify-content: center;
    }
    
    .year-separator {
        font-size: 13px;
        padding: 0 4px;
    }
    
    .categories-container {
        width: 100%;
    }
    
    .categories-button {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
        justify-content: center;
    }
    
    .results-count {
        width: 100%;
        font-size: 13px;
        padding: 10px 16px;
        text-align: center;
        justify-content: center;
    }
    
    .results-count {
        font-size: 12px;
    }
    
    /* Ajuste do mapa */
    #map {
        top: 110px;
    }
    
    /* Zoom controls ajustados */
    .zoom-controls {
        right: 10px;
        bottom: 80px;
        gap: 8px;
    }
    
    .zoom-btn,
    .fit-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    
    /* Popups menores */
    .popup-image {
        height: 160px;
    }
    
    .popup-title {
        font-size: 16px;
    }
    
    /* Modal full width em telas muito pequenas */
    .year-modal {
        width: 94%;
        max-width: none;
        padding: 16px;
    }
    
    .year-picker-wheel {
        height: 200px;
    }
    
    .year-item {
        font-size: 16px;
        padding: 8px;
    }
    
    /* Dropdown full width */
    .categories-dropdown {
        width: calc(100vw - 16px);
        left: 8px;
        right: 8px;
        max-height: 70vh;
    }
    
    .categories-list {
        max-height: calc(70vh - 100px);
    }
    
    .dropdown-footer {
        padding: 10px;
        gap: 8px;
    }
    
    .ios-modal-button {
        padding: 10px;
        font-size: 14px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #map {
        top: 70px;
    }
    
    .controls-header {
        padding: 6px 12px;
    }
    
    .controls-main {
        padding: 6px 12px;
    }
    
    .zoom-controls {
        bottom: 20px;
        gap: 6px;
    }
    
    .zoom-btn,
    .fit-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .year-modal,
    .categories-dropdown {
        max-height: 80vh;
    }
    
    .year-picker-wheel {
        height: 180px;
    }
}

/* ==========================================
   Animações Modernas
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.3s ease;
}

/* Galeria de imagens aprimorada */
.content-gallery {
    position: relative;
    cursor: pointer;
}

.content-gallery::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    pointer-events: none;
}

.content-gallery img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Melhorias para mobile */
@media (max-width: 768px) {
    .content-panel {
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height para mobile */
        border-radius: 0;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
    }
    
    .content-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 24px;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        z-index: 10;
    }
    
    .content-gallery {
        height: 220px;
        min-height: 220px;
        flex-shrink: 0;
    }
    
    .gallery-nav {
        opacity: 1 !important;
        width: 44px;
        height: 44px;
    }
    
    .content-header {
        padding: 16px;
        flex-shrink: 0;
    }
    
    .content-title {
        font-size: 20px;
    }
    
    .content-actions-bar {
        padding: 12px 16px;
        gap: 8px;
        justify-content: center;
    }
    
    .action-chip {
        padding: 12px 14px;
        min-width: 75px;
        flex-direction: row;
        gap: 6px;
        border-radius: 20px;
    }
    
    .action-chip-icon {
        font-size: 18px;
    }
    
    .action-chip-text {
        font-size: 12px;
    }
    
    .content-body {
        flex: 1;
        overflow-y: auto;
        min-height: 0; /* Importante para flex scroll */
    }
    
    .info-section {
        padding: 16px;
    }
    
    .info-item {
        padding: 12px 8px;
        min-height: 48px;
    }
    
    /* Footer fixo no final */
    .content-footer {
        position: relative;
        padding: 16px;
        gap: 10px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        flex-shrink: 0;
        background: #ffffff;
        border-top: 1px solid #e8eaed;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .footer-btn {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 48px;
        flex: 1;
    }
    
    .footer-btn-primary {
        background: #2F6C84;
        color: white;
    }
    
    .footer-btn-secondary {
        background: white;
        color: #2F6C84;
        border: 2px solid #2F6C84;
    }
    
    .researcher-card {
        padding: 16px;
    }
    
    .researcher-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Hover states para desktop */
@media (hover: hover) {
    .info-item:hover .info-item-icon {
        transform: scale(1.1);
        transition: transform 0.2s ease;
    }
    
    .gallery-nav {
        opacity: 0;
    }
    
    .content-gallery:hover .gallery-nav {
        opacity: 1;
    }
}

/* Smooth scroll */
.content-body {
    scroll-behavior: smooth;
}

/* Skeleton loading (para uso futuro) */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== MODAL DE COMPARTILHAMENTO ===== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.share-modal {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh; /* Dynamic viewport height para mobile */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.share-modal-header {
    background: linear-gradient(135deg, #2F6C84, #4a8aa3);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    flex-shrink: 0; /* Impede que o header encolha */
}

.share-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.share-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
}

.share-location-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(47, 108, 132, 0.05), rgba(47, 108, 132, 0.02));
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid rgba(47, 108, 132, 0.1);
}

.share-location-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.share-location-info h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.share-location-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.share-btn svg {
    flex-shrink: 0;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.share-btn-whatsapp:hover {
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.share-btn-facebook {
    background: linear-gradient(135deg, #1877F2, #0C63D4);
}

.share-btn-facebook:hover {
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.4);
}

.share-btn-twitter {
    background: linear-gradient(135deg, #000000, #14171A);
}

.share-btn-twitter:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.share-btn-copy {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    grid-column: 1 / -1;
}

.share-btn-copy:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.share-url-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #e9ecef;
}

.share-url-preview input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #495057;
    font-family: 'Courier New', monospace;
    padding: 4px;
}

.share-url-preview input:focus {
    outline: none;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .share-modal-overlay {
        padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
    }
    
    .share-modal {
        max-width: 100%;
        margin: 0 10px;
        border-radius: 16px;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .share-btn {
        min-height: var(--touch-target-min);
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .share-btn-copy {
        grid-column: 1;
    }
    
    .share-modal-header {
        padding: 20px;
        padding-top: calc(20px + var(--safe-top));
    }
    
    .share-modal-header h3 {
        font-size: 18px;
    }
    
    .share-modal-close {
        width: var(--touch-target-min);
        height: var(--touch-target-min);
        font-size: 22px;
    }
    
    .share-modal-body {
        padding: 20px;
        padding-bottom: calc(20px + var(--safe-bottom));
    }
    
    .share-location-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 18px;
    }
    
    .share-location-icon {
        font-size: 48px;
        width: 70px;
        height: 70px;
    }
    
    .share-url-preview {
        padding: 14px;
    }
    
    .share-url-preview input {
        font-size: 12px;
    }
}
