/* Estilos para o componente do mapa */
#map-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
}

#map {
    width: 100%;
    height: 600px;
    position: relative;
}

.map-controls-overlay {
    position: absolute;
    top: 10px;
    right: 60px; /* Movido para a esquerda para não sobrepor os controles do mapa */
    z-index: 1000;
    display: flex;
    gap: 8px;
}

.info-panel {
    padding: 20px;
    background: var(--verde-suave, #E8F5E9);
    font-family: 'Poppins', sans-serif;
}

.info-panel h3 {
    color: var(--verde-escuro, #0B3D2F);
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.collapsible-header:hover {
    color: var(--verde-medio, #1B5E3F);
}

.collapsible-header .toggle-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--verde-medio, #1B5E3F);
}

.collapsible-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    overflow: hidden;
}

.info-panel p {
    color: var(--dark-gray, #212121);
    margin-bottom: 15px;
    line-height: 1.6;
}

#info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #333;
    min-height: 50px;
}

/* Controles 3D */
.controls-3d {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid var(--verde-medio, #1B5E3F);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.controls-3d label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 5px;
}

.controls-3d label:first-child {
    margin-top: 0;
}

.controls-3d input[type="range"] {
    width: 70%;
    margin-right: 10px;
    vertical-align: middle;
}

.controls-3d span {
    display: inline-block;
    min-width: 50px;
    color: #667eea;
    font-weight: bold;
}

.btn-3d {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(230, 81, 0, 0.85);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

.btn-3d:hover {
    background: rgba(230, 81, 0, 1);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

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

.btn-trail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: #28a745 !important;
}

.btn-danger {
    background: #dc3545 !important;
}

.btn-download {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-upload {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-marker {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

#trails-list {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    min-height: 50px;
}

#trails-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#trails-list li {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

#trails-list li:last-child {
    border-bottom: none;
}

#markers-list {
    background: var(--verde-suave, #E8F5E9);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--verde-medio, #1B5E3F);
    min-height: 50px;
    margin-top: 15px;
}

#markers-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#markers-list li {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#markers-list li:last-child {
    border-bottom: none;
}

#markers-list .marker-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

/* Controles customizados do mapa */
.mapboxgl-ctrl-logo {
    display: none;
}

.mapboxgl-ctrl-attrib {
    background: rgba(255, 255, 255, 0.8);
    padding: 5px;
    font-size: 11px;
}

/* Estilos para o carrossel de imagens */
.carousel-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
    background: rgba(27, 94, 63, 1) !important;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-dot:hover {
    transform: scale(1.2);
    background: #E65100 !important;
}

.carousel-image {
    transition: opacity 0.3s ease;
}

/* Responsivo */
@media (max-width: 768px) {
    #map-container {
        border-radius: 10px;
        margin: 0 10px;
    }
    
    #map {
        height: 400px;
    }
    
    .map-controls-overlay {
        top: 5px;
        right: 50px; /* Movido para a esquerda em mobile também */
        gap: 6px;
    }
    
    .btn-3d {
        padding: 8px 14px !important;
        font-size: 11px !important;
        min-height: 36px;
        min-width: 80px;
    }
    
    .info-panel {
        padding: 15px;
    }
    
    .info-panel h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .info-panel p {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    #markers-list {
        padding: 12px;
        gap: 8px;
    }
    
    /* Botões de referência maiores para touch */
    #markers-list button {
        min-height: 44px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Carrossel otimizado para mobile */
    .carousel-container {
        max-width: 100% !important;
    }
    
    .carousel-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 14px !important;
        min-width: 24px;
        min-height: 24px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        line-height: 24px; /* Centraliza verticalmente */
        padding: 0 !important; /* Remove padding extra */
    }
    
    .carousel-dot {
        width: 6px !important;
        height: 6px !important;
        min-width: auto !important;
        min-height: auto !important;
        margin: 0 3px !important;
    }
    
    /* Popups otimizados para mobile */
    .mapboxgl-popup-content {
        max-width: 220px !important; /* Ainda mais compacto */
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    
    .mapboxgl-popup-content h3 {
        font-size: 13px !important;
        margin-bottom: 3px !important;
    }
    
    .mapboxgl-popup-content p {
        font-size: 11px !important;
        margin: 0 0 5px 0 !important;
        line-height: 1.2 !important;
    }
    
    .mapboxgl-popup-content img, .carousel-image {
        max-width: 100% !important;
        max-height: 110px !important; /* Limita altura da imagem */
        object-fit: cover !important; /* Garante que a imagem cubra a área sem distorcer */
        display: block;
        margin: 0 auto;
    }
    
    /* Melhorar controles do Mapbox para touch */
    .mapboxgl-ctrl-group {
        margin: 10px !important;
    }
    
    .mapboxgl-ctrl-group button {
        width: 36px !important;
        height: 36px !important;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Melhorar scroll em mobile */
    .info-panel {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}

/* Mobile muito pequeno */
@media (max-width: 480px) {
    #map {
        height: 350px;
    }
    
    .btn-3d {
        padding: 6px 10px !important;
        font-size: 10px !important;
        min-width: 70px;
    }
    
    .info-panel {
        padding: 12px;
    }
    
    #markers-list {
        padding: 10px;
        gap: 6px;
    }
    
    #markers-list button {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    
    .carousel-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 14px !important;
    }
}
