/* Estilos generales */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto', Arial, sans-serif;
}

/* Estilos del contenedor principal */
#map {
    height: calc(100% - 110px);
    width: 100%;
    z-index: 1;
}

/* Estilos para los controles */
#controls {
    height: 60px;
    background-color: #2c3e50;
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#data-controls {
    height: 40px;
    background-color: #34495e;
    color: white;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Estilos para los botones de color */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    max-width: 320px;
    background-color: #34495e;
    padding: 5px;
    border-radius: 4px;
}

.color-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    display: inline-block;
    margin: 2px;
    transition: transform 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.2);
}

.color-btn.active {
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(255,255,255,0.8);
}

/* Estilos para botones */
button {
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button.active {
    background-color: #27ae60;
}

/* Grupos de botones */
.mode-group {
    border: 1px solid #95a5a6;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    gap: 5px;
    background-color: #34495e;
}

.color-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
}

/* Leyenda */
.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
}

.legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 20px;
    height: 5px;
    margin-right: 8px;
}

.legend-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-icon img {
    width: 20px;
    height: 20px;
}

/* Reloj */
#clock {
    margin-left: auto;
    font-weight: bold;
    font-size: 16px;
    color: #ecf0f1;
    background-color: rgba(44, 62, 80, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
}

/* Paneles de información */
.info-panel {
    position: absolute;
    top: 120px;
    left: 10px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.info-panel h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 8px;
}

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

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

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.area-form, .bin-form {
    display: none;
}

/* Lista de puntos */
.point-list {
    font-size: 12px;
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid #bdc3c7;
    padding: 8px;
    margin-top: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 60%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    animation: modalFadeIn 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ecf0f1;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

/* Estilos para la paleta extendida de colores */
.color-palette-toggle {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    margin-right: 5px;
}

.extended-palette {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #2c3e50;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1001;
    width: 200px;
}

/* Estilos para tooltips y accesibilidad */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #34495e;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1002;
}

/* Estilos para dispositivos móviles */
@media (max-width: 768px) {
    #controls, #data-controls {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 90%;
    }

    .legend {
        max-width: 200px;
        font-size: 11px;
    }
}

/* Clases auxiliares */
.hidden {
    display: none !important;
}

.flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.ml-auto {
    margin-left: auto;
}

/* Estilos para mejorar la visualización de los contenedores */
.bin-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
}

.bin-type-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

/* Estilos para los popups de Leaflet */
.leaflet-popup-content {
    font-family: 'Roboto', Arial, sans-serif;
    max-width: 250px;
}

.popup-title {
    font-weight: bold;
    color: #2c3e50;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.popup-content {
    font-size: 13px;
}

.popup-row {
    margin-bottom: 3px;
    display: flex;
}

.popup-label {
    font-weight: bold;
    margin-right: 5px;
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mejora visual para accesibilidad en foco */
button:focus, input:focus, select:focus {
    outline: 2px solid #3498db;
    outline-offset: 1px;
}

/* Estilos para el panel del usuario */
.user-panel {
    position: absolute;
    top: 120px;
    right: 10px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 250px;
}