* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove highlight no touch */
}

:root {
    /* Paleta suave inspirada em nuvens e sonhos */
    --cloud-white: #f8f9fa;
    --cloud-light: #e9ecef;
    --cloud-medium: #dee2e6;
    --cloud-soft: #ced4da;
    --accent-soft: #adb5bd;
    --text-dark: #000000; /* Alterado para preto puro */
    --text-medium: #000000; /* Alterado para preto puro */
    --text-light: #000000; /* Alterado para preto puro */
    --white: #ffffff;
    --black: #000000; /* Adicionado preto puro */
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --shadow-soft: 0 5px 20px rgba(0, 0, 0, 0.08);
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: manipulation; /* Melhora a resposta ao toque */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', sans-serif;
    background: 
        radial-gradient(ellipse at top, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%),
        linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
    overscroll-behavior: none; /* Evita scroll indesejado */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Nuvem 1 */
        radial-gradient(ellipse 800px 400px at 10% 20%, rgba(248, 249, 250, 0.9) 0%, transparent 70%),
        /* Nuvem 2 */
        radial-gradient(ellipse 600px 300px at 80% 40%, rgba(233, 236, 239, 0.85) 0%, transparent 70%),
        /* Nuvem 3 */
        radial-gradient(ellipse 700px 350px at 50% 70%, rgba(248, 249, 250, 0.8) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available; /* Para Safari mobile */
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* HEADER - Otimizado para mobile */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-dark); /* Preto */
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-area-inset-top));
    animation: fadeInDown 0.8s ease-out;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    margin: 0;
    border-bottom: 1px solid rgba(222, 226, 230, 0.3);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    color: var(--text-dark); /* Preto */
    line-height: 1.2;
}

.subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    opacity: 0.9;
    color: var(--text-dark); /* Alterado para preto */
    line-height: 1.3;
}

/* MAPA - Totalmente responsivo */
#map {
    height: 100vh;
    height: -webkit-fill-available;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    padding-top: 70px; /* Espaço para o header fixo */
    padding-bottom: 90px; /* Espaço para as stats */
    animation: fadeInUp 0.8s ease-out;
    z-index: 1;
    border: none;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    touch-action: pan-x pan-y; /* Permite apenas pan no mapa */
}

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

/* Remove zoom duplo no mapa para mobile */
.leaflet-container {
    touch-action: auto;
}

/* STATS - Redesenhadas para mobile */
.stats {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    animation: fadeInUp 1s ease-out;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(222, 226, 230, 0.3);
    padding: 12px 8px;
    padding-bottom: calc(12px + var(--safe-area-inset-bottom));
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.stat-card {
    background: transparent;
    padding: 8px 2px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
    margin: 0 2px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: none;
}

.stat-card:active {
    background: rgba(233, 236, 239, 0.3);
    transform: scale(0.98);
}

.stat-number {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark); /* Preto */
    margin-bottom: 2px;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dark); /* Alterado para preto */
    font-weight: 400;
    letter-spacing: 0.2px;
    opacity: 0.9; /* Um pouco de transparência para suavizar */
}

/* MODAL - Otimizado para touch */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
    overscroll-behavior: contain;
}

.modal-content {
    background: var(--white);
    margin: 0;
    padding: 0;
    border-radius: 0;
    width: 100%;
    min-height: 100vh;
    box-shadow: none;
    animation: slideUp 0.4s ease;
    overflow: hidden;
    border: none;
    position: relative;
}

.close {
    position: fixed;
    top: 16px;
    right: 16px;
    color: #000 !important; /* Preto fixo */
    font-size: 32px;
    font-weight: 300;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    z-index: 2001;
    border: 1px solid rgba(222, 226, 230, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.close:active {
    background: rgba(222, 226, 230, 0.95);
    transform: scale(0.95);
}

.modal-header {
    background: linear-gradient(135deg, var(--cloud-light) 0%, var(--cloud-medium) 100%);
    color: var(--text-dark); /* Preto */
    padding: 80px 20px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--cloud-soft);
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: var(--text-dark); /* Preto */
    line-height: 1.3;
}

.modal-header p {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 4px 0;
    position: relative;
    z-index: 1;
    color: var(--text-dark); /* Alterado para preto */
    line-height: 1.4;
}

.modal-body {
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-area-inset-bottom));
}

#modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark); /* Preto */
    margin-bottom: 25px;
    text-align: left;
    font-weight: 400;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.photo-item:active {
    transform: scale(0.95);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Botões de compartilhamento */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-btn span {
    font-size: 1.1rem;
}

.share-whatsapp {
    background: #25D366;
    color: white;
}

.share-whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.share-copy {
    background: var(--cloud-medium);
    color: var(--text-dark);
}

.share-copy:hover {
    background: var(--cloud-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Visualizador de fotos melhorado */
.photo-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.photo-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

#photo-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-viewer-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 3001;
    backdrop-filter: blur(10px);
}

.photo-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.photo-viewer-prev,
.photo-viewer-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3001;
    backdrop-filter: blur(10px);
    font-weight: 300;
}

.photo-viewer-prev {
    left: 20px;
}

.photo-viewer-next {
    right: 20px;
}

.photo-viewer-prev:hover,
.photo-viewer-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.photo-viewer-prev:active,
.photo-viewer-next:active {
    transform: translateY(-50%) scale(0.95);
}

.photo-viewer-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 3001;
    backdrop-filter: blur(10px);
}

.photo-viewer-zoom-controls {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3001;
}

.zoom-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Notificação */
.notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 4000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Marcadores personalizados - maiores para touch */
.custom-marker {
    background: var(--text-dark); /* Preto */
    width: 44px;
    height: 44px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.custom-marker:active {
    transform: rotate(-45deg) scale(1.1);
}

.custom-marker::after {
    content: '❤️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-size: 20px;
}

/* Animações suaves para mobile */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

/* Melhorias para telas muito pequenas */
@media (max-width: 350px) {
    header h1 {
        font-size: 1.2rem;
        color: var(--text-dark); /* Preto */
    }
    
    .subtitle {
        font-size: 0.75rem;
        color: var(--text-dark); /* Preto */
    }
    
    .stat-number {
        font-size: 1.6rem;
        color: var(--text-dark); /* Preto */
    }
    
    .stat-label {
        font-size: 0.7rem;
        color: var(--text-dark); /* Preto */
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .share-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .photo-viewer-content {
        padding: 40px 20px;
    }

    .photo-viewer-prev,
    .photo-viewer-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .photo-viewer-prev {
        left: 10px;
    }

    .photo-viewer-next {
        right: 10px;
    }

    .photo-viewer-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 32px;
    }
}

/* Paisagem em mobile */
@media (max-width: 900px) and (orientation: landscape) {
    header {
        padding: 8px 12px;
        padding-top: calc(8px + var(--safe-area-inset-top));
    }
    
    header h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
        color: var(--text-dark); /* Preto */
    }
    
    .subtitle {
        font-size: 0.75rem;
        color: var(--text-dark); /* Preto */
    }
    
    #map {
        padding-top: 50px;
        padding-bottom: 60px;
    }
    
    .stats {
        padding: 8px;
        padding-bottom: calc(8px + var(--safe-area-inset-bottom));
    }
    
    .stat-card {
        padding: 4px 2px;
        min-height: 50px;
    }
    
    .stat-number {
        font-size: 1.5rem;
        color: var(--text-dark); /* Preto */
    }
    
    .stat-label {
        font-size: 0.7rem;
        color: var(--text-dark); /* Preto */
    }
    
    .modal-content {
        min-height: 100vh;
    }
    
    .modal-header {
        padding: 60px 15px 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
        color: var(--text-dark); /* Preto */
    }
    
    .modal-header p {
        color: var(--text-dark); /* Preto */
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .photo-viewer-zoom-controls {
        bottom: 60px;
    }

    .zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Tablets pequenos */
@media (min-width: 600px) and (max-width: 768px) {
    header {
        padding: 15px 20px;
        padding-top: calc(15px + var(--safe-area-inset-top));
    }
    
    header h1 {
        font-size: 1.6rem;
        color: var(--text-dark); /* Preto */
    }
    
    .subtitle {
        font-size: 0.95rem;
        color: var(--text-dark); /* Preto */
    }
    
    .stats {
        padding: 15px;
        padding-bottom: calc(15px + var(--safe-area-inset-bottom));
    }
    
    .stat-number {
        font-size: 2rem;
        color: var(--text-dark); /* Preto */
    }
    
    .stat-label {
        font-size: 0.85rem;
        color: var(--text-dark); /* Preto */
    }
    
    .modal-content {
        margin: 20px auto;
        max-width: 90%;
        border-radius: 16px;
        min-height: auto;
        max-height: 90vh;
    }
    
    .close {
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    .modal-header {
        padding: 30px 30px 20px;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-body {
        padding: 30px;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .share-buttons {
        gap: 12px;
    }

    .photo-viewer-content {
        padding: 50px 60px;
    }
}

/* Desktops - mantém o estilo original com ajustes */
@media (min-width: 769px) {
    .modal-content {
        margin: 5% auto;
        max-width: 800px;
        border-radius: 20px;
        min-height: auto;
    }
    
    .close {
        position: absolute;
        top: 25px;
        right: 25px;
    }
    
    .modal-header {
        padding: 30px;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-header h2 {
        color: var(--text-dark); /* Preto */
    }
    
    .modal-header p {
        color: var(--text-dark); /* Preto */
    }
    
    #modal-description {
        color: var(--text-dark); /* Preto */
    }

    .share-btn {
        padding: 12px 20px;
    }

    .share-btn:hover {
        transform: translateY(-3px);
    }

    .photo-viewer-content {
        padding: 60px 100px;
    }

    .photo-viewer-prev,
    .photo-viewer-next {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }

    .photo-viewer-prev {
        left: 30px;
    }

    .photo-viewer-next {
        right: 30px;
    }
}

/* Melhorias para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .modal {
        -webkit-overflow-scrolling: touch;
    }
    
    .stats,
    header {
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }

    .photo-viewer {
        -webkit-overflow-scrolling: touch;
    }

    #photo-viewer-img {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Evita zoom em inputs em iOS */
input,
textarea,
button,
select,
a {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Mobile - ajustes adicionais para visualizador */
@media (max-width: 600px) {
    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .photo-viewer-content {
        padding: 50px 20px;
    }

    .photo-viewer-prev,
    .photo-viewer-next {
        width: 45px;
        height: 45px;
        font-size: 28px;
    }

    .photo-viewer-zoom-controls {
        bottom: 70px;
        gap: 8px;
    }

    .zoom-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .photo-viewer-info {
        bottom: 15px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    #photo-viewer-img {
        touch-action: pan-x pan-y pinch-zoom;
    }
}

/* Scrollbar personalizada para modal (opcional) */
.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-track {
    background: transparent;
}

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

/* Melhorias de performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Suporte para modo escuro */
@media (prefers-color-scheme: dark) {
    :root {
        --cloud-white: #121212;
        --cloud-light: #1e1e1e;
        --cloud-medium: #2d2d2d;
        --cloud-soft: #3d3d3d;
        --text-dark: #ffffff; /* Branco no modo escuro para contraste */
        --text-medium: #f0f0f0;
        --text-light: #cccccc;
    }
    
    header {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .stats {
        background: rgba(30, 30, 30, 0.98);
    }
    
    .modal-content {
        background: #1e1e1e;
    }
    
    .modal-header {
        background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    }
    
    #modal-description {
        color: #f0f0f0;
    }
}