/* Estilos adicionales para Geo Tracker */

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading overlay: cubrir área del mapa para evitar scroll */
#loading {
    position: fixed;
    top: 64px; /* altura del header en desktop */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent;
    z-index: 55; /* sobre el mapa (z-normal) y bajo bottom-sheet (60) / modal (60+) */
}

/* Bottom Sheet for mobile details */
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -70vh;
    background: #ffffff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -8px 20px rgba(0,0,0,0.15);
    transition: bottom 0.25s ease;
    z-index: 60;
}
.bottom-sheet.open {
    bottom: 0;
}
.bottom-sheet .handle {
    width: 48px;
    height: 5px;
    background: #e5e7eb;
    border-radius: 9999px;
    margin: 8px auto;
}
.bottom-sheet .content {
    max-height: 60vh;
    overflow-y: auto;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Safe area helpers (iOS notch) */
.safe-top {
    padding-top: calc(env(safe-area-inset-top, 0px));
}
.safe-bottom {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px));
}

/* Floating Action Buttons */
.fab-container {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}
.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
.fab-primary { background: #3b82f6; }
.fab-secondary { background: #6b7280; }
.fab-success { background: #10b981; }

/* Bottom action bar (mobile) */
.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    display: flex;
    gap: 12px;
    z-index: 40;
}
.bottom-bar .btn {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
}


.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Loader personalizado */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.animate-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Mapa */
#map {
    height: calc(100vh - 64px);
    width: 100%;
}

/* Info Window personalizado */
.gm-style .gm-style-iw-c {
    border-radius: 8px;
    padding: 12px;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
}

/* Responsive */
@media (max-width: 768px) {
    #map {
        height: calc(100vh - 80px);
    }
    /* ajustar overlay para altura de header móvil */
    #loading {
        top: 80px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header .flex {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Botones */
button, .btn {
    transition: all 0.2s ease-in-out;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:active, .btn:active {
    transform: translateY(0);
}

/* Inputs */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
}

/* Modal overlay */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* Markers personalizados */
.custom-marker {
    cursor: pointer;
    transition: transform 0.2s;
}

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

/* Categorías con colores */
.category-mirador { color: #3b82f6; }
.category-camping { color: #10b981; }
.category-hotel { color: #8b5cf6; }
.category-parada { color: #fbbf24; }
.category-restaurante { color: #f97316; }

/* Toast notifications */
.toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background-color: #10b981;
    color: white;
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

.toast-info {
    background-color: #3b82f6;
    color: white;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print styles */
@media print {
    header, button, .no-print {
        display: none;
    }
    
    #map {
        height: 100vh;
    }
}
