body { margin: 0; padding: 0; font-family: sans-serif; overflow: hidden; }

#map { width: 100vw; height: 100vh; z-index: 1; background: #aaa; }

/* Overzoom */
.leaflet-tile-pane { transition: opacity 0.3s ease; }
.map-dimmed .leaflet-tile-pane { opacity: 0.3 !important; filter: grayscale(30%); }

/* BURGER MENU */
#burger-btn {
    position: absolute; top: 10px; right: 10px; z-index: 2000;
    width: 45px; height: 45px; background: white; border-radius: 8px; border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); font-size: 20px; cursor: pointer; color:#333;
}

#side-menu {
    position: absolute; top: 0; right: 0; width: 300px; height: 100%;
    background: white; z-index: 2100; box-shadow: -2px 0 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease; display: flex; flex-direction: column;
}
#side-menu.hidden { transform: translateX(100%); display: flex; } /* Nascondi spostando a destra */

.menu-header {
    padding: 15px; background: #f5f5f5; border-bottom: 1px solid #ddd;
    display: flex; justify-content: space-between; align-items: center;
}
.menu-content { padding: 15px; overflow-y: auto; flex: 1; }
.menu-section { margin-bottom: 20px; }
.menu-section h4 { margin: 0 0 10px 0; color: #555; }
.menu-section button { 
    width: 100%; margin-bottom: 8px; text-align: left; padding: 10px; 
    border-radius: 5px; background: #f0f0f0; border: none; cursor: pointer;
}
.close-menu { background: transparent !important; width: auto !important; font-size: 20px; }

/* Preferiti */
#favorites-list div {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px; border-bottom: 1px solid #eee; cursor: pointer;
}
#favorites-list div:hover { background: #f9f9f9; }
.fav-del { color: red; cursor: pointer; padding: 5px; }

/* CONTROLLI FLOTTANTI */
#gps-btn {
    position: absolute; bottom: 100px; right: 20px; z-index: 1000;
    width: 50px; height: 50px; border-radius: 50%; background: #3388ff; color: white;
    border: none; box-shadow: 0 4px 6px rgba(0,0,0,0.3); font-size: 20px; cursor: pointer;
}

#main-actions {
    position: absolute; bottom: 30px; right: 20px; z-index: 1000;
    display: flex; gap: 15px;
}
.action-btn {
    width: 60px; height: 60px; border-radius: 50%; border: none; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); font-size: 24px; cursor: pointer;
    color: white; display: flex; align-items: center; justify-content: center;
}
.plant-btn { background: #2e7d32; }
.struct-btn { background: #d84315; }

/* SLIDER TEMPO */
#time-control {
    position: absolute; top: 10px; left: 10px; width: 200px;
    background: rgba(255, 255, 255, 0.9); padding: 10px; border-radius: 8px;
    z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.time-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 5px;}

/* TOOLBARS */
#drawing-toolbar, #edit-toolbar {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: white; padding: 10px 25px; border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); z-index: 2000;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
#drawing-toolbar.hidden, #edit-toolbar.hidden { display: none; }
.drawing-actions { display: flex; gap: 15px; }
.drawing-actions button {
    width: 45px; height: 45px; border-radius: 50%; border: none; font-size: 18px; 
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.btn-confirm-draw { background: #4caf50; color: white; }
.btn-cancel-draw { background: #f44336; color: white; }
#btn-toggle-type { background: #ff9800; color: white; }

/* MODALI */
.modal {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 3000; display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-content { background: white; padding: 20px; border-radius: 10px; width: 85%; max-width: 350px; }
.modal-content input, .modal-content select { width: 100%; padding: 8px; margin: 5px 0 10px 0; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;}
.modal-buttons { display: flex; gap: 10px; margin-top: 15px; }
.modal-buttons button { flex: 1; padding: 10px; border: none; border-radius: 5px; cursor: pointer;}
.modal-buttons button:first-child { background: #2e7d32; color: white; }
.hidden { display: none !important; }

/* MEDIA QUERY LANDSCAPE */
@media (orientation: landscape) and (max-height: 500px) {
    #side-menu { width: 40%; }
    #time-control { width: 150px; top: auto; bottom: 20px; left: 20px; }
    .action-btn { width: 50px; height: 50px; font-size: 20px; }
}