/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    color: #333;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 300px;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    color: #666;
    margin: 0;
}

/* Search Container */
.search-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Toggle Controls Button */
.toggle-controls-btn {
    position: absolute;
    top: 20px;
    right: 340px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.toggle-controls-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

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

/* Estados de visibilidad */
.controls-hidden .header,
.controls-hidden .search-container,
.controls-hidden .info-panel,
.controls-hidden .footer {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.controls-hidden .toggle-controls-btn {
    right: 20px;
}

/* Info Panel */
.info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    max-width: 350px;
    max-height: 200px;
    overflow-y: auto;
}

.info-panel h3 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-panel p {
    color: #666;
    line-height: 1.6;
}

.info-panel.active {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Footer */
.footer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-size: 12px;
    color: #666;
    text-align: center;
}

.footer-links {
    margin-top: 5px;
}

.footer-link {
    color: #666;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.3s ease;
    font-size: 11px;
}

.footer-link:hover {
    color: #333;
}

/* Leaflet customizations */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-content h4 {
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.leaflet-popup-content p {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

/* Custom marker styles */
.custom-marker {
    background: #667eea;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        top: 10px;
        left: 10px;
        max-width: 250px;
        padding: 12px 15px;
    }
    
    .title {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .search-container {
        top: 10px;
        right: 10px;
        width: 250px;
    }
    
    .toggle-controls-btn {
        top: 10px;
        right: 270px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .controls-hidden .toggle-controls-btn {
        right: 10px;
    }
    
    .info-panel {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 15px;
    }
    
    .footer {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .header {
        max-width: 200px;
        padding: 10px 12px;
    }
    
    .title {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .search-container {
        width: 200px;
    }
    
    .toggle-controls-btn {
        right: 220px;
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .controls-hidden .toggle-controls-btn {
        right: 10px;
    }
    
    .search-input {
        padding: 10px 35px 10px 12px;
        font-size: 14px;
    }
    
    .info-panel {
        padding: 12px;
        border-radius: 10px;
        max-height: 150px;
    }
    
    .footer {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .footer-link {
        font-size: 9px;
        margin: 0 5px;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 360px) {
    .header {
        max-width: 180px;
    }
    
    .search-container {
        width: 180px;
    }
    
    .info-panel {
        max-height: 120px;
    }
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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