/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-align: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.header h1 {
    margin: 0;
    color: #0066cc;
    font-size: 1.5rem;
    white-space: nowrap;
}

/* Sidebar para desktop */
.sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease;
    transform: translateX(0);
    overflow-y: auto;
    display: none; /* Oculto por defecto en móvil */
}

.sidebar.collapsed {
    transform: translateX(100%);
}

.sidebar-toggle {
    position: absolute;
    top: 70px;
    right: 350px;
    width: 36px;
    height: 60px;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 4px 0 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: right 0.3s ease, background-color 0.2s ease;
    display: none; /* Oculto por defecto en móvil */
}

.sidebar-toggle:hover {
    background-color: #f0f5ff;
}

.sidebar-toggle i {
    color: #0066cc;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.sidebar-toggle:hover i {
    transform: scale(1.2);
}

.sidebar.collapsed + .sidebar-toggle {
    right: 0;
}

/* Bottomsheet para móvil */
.bottomsheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
    overflow-y: auto;
    max-height: 80vh;
    display: block; /* Visible por defecto en móvil */
}

.bottomsheet.expanded {
    transform: translateY(0);
}

.bottomsheet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px 0;
}

.bottomsheet-handle {
    width: 40px;
    height: 5px;
    background-color: #ccc;
    border-radius: 3px;
}

.bottomsheet-close {
    position: absolute;
    right: 15px;
    top: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.bottomsheet-close:hover {
    background-color: #f0f0f0;
    color: #cc0000;
}

/* Contenedor de formularios */
.form-container {
    padding: 20px;
}

.form-container h2 {
    color: #0066cc;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group select,
.form-group textarea,
.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.location-info {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
}

.btn:hover {
    background-color: #0055aa;
}

/* Estilo para checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.checkbox-container label {
    margin-bottom: 0;
    font-weight: normal;
    color: #cc0000;
}

/* Estilo para select de categoría */
.category-select {
    max-height: 200px;
    overflow-y: auto;
}

.category-select optgroup {
    font-weight: bold;
    color: #0066cc;
}

.urgent-checkbox {
    transform: scale(1.2);
}

/* Indicador de carga */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0066cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Toast para notificaciones */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4caf50;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.error {
    background-color: #cc0000;
}

/* Media Queries */
@media (min-width: 769px) {
    .sidebar,
    .sidebar-toggle {
        display: block; /* Mostrar sidebar en desktop */
    }

    .bottomsheet {
        display: none; /* Ocultar bottomsheet en desktop */
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }

    .sidebar-toggle {
        right: 280px;
    }

    .leaflet-control-zoom {
        margin-top: 60px; /* Hacer espacio para el header centrado en móvil */
    }
    
    .toast {
        width: 90%;
        text-align: center;
    }
}


/* Botón de información */

.info-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #0066cc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 900;
    transition: transform 0.2s, background-color 0.2s;
    font-size: 24px;
}

.info-button:hover {
    transform: scale(1.1);
    background-color: #0055aa;
}

/* Modal de información */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 25px;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalopen 0.4s;
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 10px 0;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.modal-body ul li {
    margin-bottom: 5px;
}

.motivational {
    text-align: center;
    font-size: 1.1em;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f5ff;
    border-radius: 6px;
    border-left: 4px solid #0066cc;
}

.contact-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.95em;
}

.contact-info a {
    color: #0066cc;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 15% auto;
        padding: 20px;
    }
    
    .info-button {
        bottom: 70px; /* Ajustar posición para no interferir con el bottomsheet */
    }
}

/* Estilos para botones de compartir */
.share-buttons {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.share-buttons p {
    margin-bottom: 10px;
}

.share-button {
    display: inline-block;
    margin: 5px;
    padding: 8px 15px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.2s;
}

.share-button:hover {
    opacity: 0.9;
}

.share-button i {
    margin-right: 5px;
}

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

.facebook {
    background-color: #3b5998;
}

.twitter {
    background-color: #000000;
}

.instagram {
    background: #d6249f;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.copy-link {
    background-color: #333333; /* Gris más oscuro para mejor contraste */
    cursor: pointer;
    border: none;
    font-size: 1em;
}

.copy-link.copied {
    background-color: #4caf50;
}

/* Top container for header and search */
.top-container {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

/* Update search container styles */
.search-container {
    flex-grow: 1;
}


.search-box {
    display: flex;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 100%;
}

.search-box input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    outline: none;
}

.search-box button {
    background: #0066cc;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #0055aa;
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .top-container {
        flex-direction: column;
        top: 10px;
    }
    
    .header {
        width: 100%;
        padding: 8px 10px;
    }
    
    .search-container {
        width: 100%;
        margin-top: 10px;
    }

    /* Adjust leaflet controls to avoid overlap */
    .leaflet-control-zoom {
        margin-top: 120px;
    }
}