* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #000;
    color: white;
    overflow: hidden;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#canvas3d {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#canvas3d:active {
    cursor: grabbing;
}

/* PANEL DE INFORMACIÓN */
#info {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
    background: rgba(0,0,0,0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    max-width: 320px;
    backdrop-filter: blur(10px);
}

#info h1 {
    font-size: 16px;
    margin-bottom: 8px;
}

#info p {
    font-size: 12px;
    margin: 4px 0;
}

#controls {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 220px;
    text-align: center;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255,255,255,0.1);
}

.control-btn.active {
    background: rgba(100,200,255,0.3);
    border-color: rgba(100,200,255,0.6);
    box-shadow: 0 0 10px rgba(100,200,255,0.3);
}

.control-btn.inactive {
    background: rgba(255,100,100,0.3);
    border-color: rgba(255,100,100,0.6);
    box-shadow: 0 0 10px rgba(255,100,100,0.3);
}

.control-btn.geometry-spheres {
    background: rgba(100,255,100,0.3);
    border-color: rgba(100,255,100,0.6);
    box-shadow: 0 0 10px rgba(100,255,100,0.3);
}

.control-btn.geometry-planes {
    background: rgba(255,200,100,0.3);
    border-color: rgba(255,200,100,0.6);
    box-shadow: 0 0 10px rgba(255,200,100,0.3);
}

/* NUEVO ESTILO PARA BOTÓN DE ROTACIÓN */
.control-btn.rotation-active {
    background: rgba(255,150,255,0.3);
    border-color: rgba(255,150,255,0.6);
    box-shadow: 0 0 10px rgba(255,150,255,0.3);
}

.control-btn.rotation-inactive {
    background: rgba(150,150,150,0.3);
    border-color: rgba(150,150,150,0.6);
    box-shadow: 0 0 10px rgba(150,150,150,0.3);
}

/* =========================
   ESTILOS PARA MAPA LEAFLET
   ========================= */

.map-container {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 500px;
    height: 350px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ESTADO MINIMIZADO */
.map-container.minimized {
    width: 250px;
    height: 180px;
}

/* CONTROLES DEL MAPA */
.map-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35px;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.map-title {
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}

.map-control-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.map-control-btn:hover {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.6);
    transform: scale(1.1);
}

/* MAPA LEAFLET */
#leafletMap {
    width: 100%;
    height: calc(100% - 70px);
    margin-top: 35px;
}

/* INFORMACIÓN DEL PAÍS */
.country-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 12px;
    color: white;
    backdrop-filter: blur(5px);
}

/* ESTILOS PARA ELEMENTOS LEAFLET */
.leaflet-container {
    background: rgba(20, 20, 40, 0.3) !important;
}

.leaflet-control-container {
    font-size: 11px;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(5px);
}

.leaflet-control-zoom a:hover {
    background: rgba(100, 200, 255, 0.3) !important;
    border-color: rgba(100, 200, 255, 0.6) !important;
}

.leaflet-popup-content-wrapper {
    background: rgba(0, 0, 0, 0.95) !important;
    color: white !important;
    border-radius: 8px !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-tip {
    background: rgba(0, 0, 0, 0.95) !important;
}

.leaflet-popup-close-button {
    color: white !important;
}

/* ESTILOS PARA MARCADORES PERSONALIZADOS */
.country-marker {
    background: rgba(100, 200, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

.country-marker:hover {
    transform: scale(1.3);
    background: rgba(100, 200, 255, 1);
    box-shadow: 0 2px 10px rgba(100, 200, 255, 0.5);
}

.user-marker {
    background: rgba(255, 100, 100, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    backdrop-filter: blur(5px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .map-container {
        width: 350px;
        height: 250px;
        bottom: 10px;
        right: 10px;
    }
    
    .map-container.minimized {
        width: 200px;
        height: 150px;
    }
    
    #info {
        max-width: 280px;
    }
    
    .control-btn {
        min-width: 180px;
        font-size: 10px;
    }
}
