:root {
    --primary: #e4107b;
    --primary-dark: #c40c69;
    --secondary: #e0e0e0;
    --secondary-light: #f7f7f7;
    --accent: #ff02c3;
    --accent-light: #ff4dd4;
    --light: #f8f9fa; /* Color de fondo claro, para el panel */
    --dark: #212529; /* Color de texto oscuro */
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --border-radius: 12px;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    overflow: hidden; /* Evita scrolls innecesarios en el body */
    position: relative;
    background-color: var(--light); /* Fondo principal de la página */
    color: var(--dark); /* Color de texto predeterminado */
}

/* Nueva regla para el header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px; /* Altura fija para el header */
    /* padding: 15px 25px; */
    background: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Nueva regla para el logo */
.logo img {
    height: 70px; /* Aumentamos la altura del logo */
}

#map-container {
    height: 100%;
    width: 100%;
    position: absolute; /* Permite que otros elementos lo cubran o se superpongan */
    top: 0;
    left: 0;
    z-index: 1; /* El mapa debe estar debajo de los controles */
}

#map {
    height: 100%;
    width: 100%;
}

/* Nuevo estilo para los controles superiores */
.top-controls {
    position: fixed;
    top: 40px; /* Ajustado para estar debajo del header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 999; /* Asegura que los controles estén encima del mapa pero debajo del header */
    width: 95%;
    max-width: 600px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.search-bar i {
    color: var(--gray);
    margin-right: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 16px;
    color: var(--dark);
}

.filter-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tag {
    background: white;
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    color: var(--dark);
    box-shadow: var(--shadow);
    transition: background-color var(--transition);
}

.filter-tag.active {
    background: var(--primary);
    color: white;
}

/* Contenedor del nuevo botón de geolocalización */
.geolocation-btn-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999; /* Encima del mapa */
}

#find-me-btn {
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#find-me-btn:hover {
    transform: scale(1.1);
}

#find-me-btn i {
    font-size: 24px;
    color: var(--primary);
}
/* --- PANEL INFERIOR --- */
.details-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.details-panel.active {
    transform: translateY(0);
}

.details-panel .handle {
    width: 50px;
    height: 5px;
    background: #ccc;
    border-radius: 3px;
    margin: 8px auto 12px;
}

.panel-content {
    padding: 0 20px 20px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #333;
}

/* --- ENCABEZADO --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #777;
    cursor: pointer;
}
.close-btn:hover {
    color: #e4107b;
}

/* --- STATUS --- */
.parking-status {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 12px;
}

.status-item {
    text-align: center;
    flex: 1;
}

.status-item strong {
    font-size: 16px;
    display: block;
}

/* --- TARIFAS --- */
.tarifa-list {
    margin: 6px 0 10px 16px;
    padding: 0;
    list-style: disc;
    color: #444;
    font-size: 14px;
}

/* --- TAGS DE SERVICIOS --- */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

.tag {
    background: #e4107b;
    color: #fff;
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
}

/* --- BOTONES --- */
.actions {
    margin-top: 15px;
}

.directions-btn {
    width: 100%;
    background: #e4107b;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.directions-btn:hover {
    background: #c90e66;
}

.stop-btn {
    background: #dc3545;
}
.stop-btn:hover {
    background: #b02a37;
}

/* #parking-details h3 {
    margin-top: 0;
    color: var(--dark);
} */


.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Estilos para el Leaflet Routing Machine */
.leaflet-routing-container {
    /* Oculta la información detallada de la ruta, ya que mostramos el botón de cómo llegar */
    display: none !important; 
}
/* Busca la regla del Leaflet Routing Machine y agrega display:none */
.leaflet-routing-container {
    display: none !important;
}

/* Agrega una regla para ocultar los pines por defecto de la ruta */
.leaflet-routing-icon {
    display: none;
}
/* Ajusta los botones de zoom del mapa para que no se superpongan con el header */
.leaflet-control-zoom {
    margin-top: 80px; /* Un poco más abajo que el header */
}
/* Nuevo estilo para hacer los iconos de marcador redondos */
.leaflet-marker-icon {
    border-radius: 50%; /* Hace el borde del icono redondo (un círculo) */
    background: white; /* Color de fondo blanco para el círculo */
    border: 3px solid var(--primary); /* Un borde de color rosa para destacarlos */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Sombra para darle profundidad */
}
/* Estilos para el Spinner de Carga */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7); /* Fondo semi-transparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Asegura que esté por encima de todos los demás elementos */
    visibility: hidden; /* Oculto por defecto */
    opacity: 0; /* Oculto por defecto */
    transition: visibility 0s, opacity 0.3s linear;
}

.loading-spinner.active {
    visibility: visible;
    opacity: 1;
}

.spinner {
    border: 6px solid #f3f3f3; /* Light grey */
    border-top: 6px solid var(--primary); /* Pink */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite; /* Animación de giro */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Estilos para la Pantalla de Bienvenida */
#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary); /* Fondo rosa */
    z-index: 9999; /* Asegura que esté por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container {
    text-align: center;
}

#welcome-logo {
    height: 150px; /* Tamaño del logo en la pantalla de bienvenida */
    opacity: 0; /* Lo ocultamos para que se anime al entrar */
    transform: scale(0.5); /* Lo hacemos pequeño para el efecto de zoom */
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

#welcome-message {
    font-size: 2.3em;
    font-weight: bold;
    color: white;
    font-family: 'roboto', sans-serif;
    margin-top: 15px;
    opacity: 0; /* Lo ocultamos para la animación */
}
.install-app-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    margin-left: auto;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s ease;
}

.install-app-btn:hover {
    background: var(--primary-dark);
}

/* Estilos para el Tooltip (Globo de Información) */
#install-btn, #find-me-btn {
    position: relative; /* Asegura que el tooltip se posicione con respecto a su botón */
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px); /* Posicionado encima del botón, con 10px de separación */
    left: 50%;
    transform: translateX(-50%);
    
    white-space: nowrap;
    background-color: var(--dark);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    z-index: 1000;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Triángulo para el globo de información */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 5px); /* Se superpone con el borde del globo */
    left: 50%;
    transform: translateX(-50%) rotate(45deg); /* Gira 45 grados para formar el triángulo */
    width: 10px;
    height: 10px;
    background-color: var(--dark);
    z-index: 1000;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Estilos para el carrusel de publicidad */

/* Estilos para el carrusel de publicidad */
.ad-carousel {
    position: relative;
    width: 95%;
    max-width: 650px;
    height: 100px; /* Altura más baja */
    margin: 20px auto;
    overflow: hidden;
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow, 0 10px 25px rgba(0, 0, 0, 0.15));
}

.ad-carousel .slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.ad-carousel .slide {
    min-width: 100%;
    height: 100%;
    /* Flexbox para centrar el texto */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Estilos para el texto del banner */
.banner-text {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeIn 1s forwards;
}

/* Oculta las flechas y los indicadores de posición */
.ad-carousel .nav-btn,
.ad-carousel .indicators {
    display: none;
}

/* Animación de entrada para el texto */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
