/* Stili generali */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    font-size: 1em;
    font-weight: 500;
}

.leaflet-container {font-family: 'Barlow', sans-serif !important;}

.navbar {
    width: 100%;
}

#map {
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    position: relative;
}

/* Stile per il pulsante principale di aggiunta risorsa */

.title-box {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 900;
    background-color: #000;
    color: white;
    border-radius: 8px;
    border: none;
    padding:8px 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 2em;
    font-weight: 600;
}

.title-box span {font-size:.6em; margin-left:6px; margin-bottom:2px;align-self: flex-end;}


.add-resource-btn {
    position: absolute;
    top: 80px;
    left: 20px;
    z-index: 900;
    background-color: #000;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    font-weight: 300;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-bottom: 2px;
    transition: all 0.2s ease;
}

#add-resource-btn:hover .add-resource-btn, #add-resource-btn:hover .add-resource-text {
    background-image: linear-gradient(#fff3,#fff3);
}

#add-resource-btn:focus .add-resource-btn {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5), 0 2px 6px rgba(0,0,0,0.25);
}

#add-resource-btn:focus {
    outline: none;
}

/* Contenitore controlli mappa a destra */
.map-controls-right {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Stile unificato per tutti i pulsanti controllo mappa */
.map-control-btn {
    background-color: #fff;
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-control-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}

.map-control-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5), 0 2px 6px rgba(0,0,0,0.25);
}

.map-control-btn:active {
    transform: scale(0.95);
}

.map-control-btn.locating {
    background-color: #007bff;
    color: white;
    animation: pulse 1s infinite;
}

.map-control-btn.error {
    background-color: #dc3545;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.add-resource-text {
    position: absolute;
    left: 40px;
    top: 85px;
    z-index: 899;
    background-color: #eaea00;
    color: black;
    height: 36px;
    border-radius: 20px;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left:30px;
    padding-right:14px;

    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Stile per il wizard */
.wizard-container {
    position: absolute;
    top: 150px;
    left: 20px;
    width: min(320px, calc(100vw - 40px));
    max-height: calc(100vh - 200px);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 1000;
    display: none;
    overflow: auto;
}

/* Wizard responsive */
@media (max-width: 480px) {
    .wizard-container {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        top: 80px;
    }
}

.wizard-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wizard-title {
    margin: 0;
    font-size: 1.2em;
    text-align: center;
    font-weight: 600;
    color: #343a40;
}

.wizard-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
}

.wizard-content {
    padding: 0 15px;
}

.wizard-footer {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.wizard-btn {
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    font-weight: 500;
    transition: all 0.2s ease;
}

.wizard-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.4);
}

.wizard-btn-back {
    background-color: #f8f9fa;
    border-color: #ddd;
    color: #495057;
}

.wizard-btn-next {
    background-color: #007bff;
    color: white;
}

.wizard-btn-next:hover {
    background-color: #0056b3;
}

.wizard-btn-back:hover {
    background-color: #e2e6ea;
}

/* Stile per gli elenchi di opzioni */
.option-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.option-item {
    padding: 14px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 1.1em;
}

.option-item:last-child {
    border-bottom: none;
}

.option-item:hover {
    background-color: #f8f9fa;
}
.option-color {
    margin-right: 12px;
    width:16px;
    height:16px;
    border-radius: 8px;
}

.option-icon {
    margin-right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-info {
    width: 24px;
    height:24px;
    border-radius:12px;
    border: 1px solid #000;
    display:block;
    cursor: pointer;
    position: relative;
}
.option-info:hover {
    background:rgba(0,0,0,0.1);
}
.option-info::after
{
    content: "?";
    position:relative;
    left: 7.5px;
    top: 2px;
    font-weight: bold;
}
/* Tooltip per l'icona help */
.option-info::before {
    content: "Clicca per info";
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
}
.option-info:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Stile per il form */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.file-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.file-input-btn {
    flex: 1;
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    color: #495057;
}

.file-input-btn:hover {
    background-color: #e9ecef;
}

/* Stile per il feedback di salvataggio */
.save-feedback {
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    display: none;
}

.save-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.save-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Overlay per bloccare le interazioni con la mappa durante l'aggiunta di linee/poligoni */
.draw-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.1);
    z-index: 999;
    display: none;
    pointer-events: none;
}

.draw-instructions {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 1001;
    display: none;
    font-weight: 500;
}

.draw-controls {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 1001;
    display: none;
    gap: 10px;
}

.leaflet-tooltip-right:before {display:none;}
.marker-label {
    border-radius: 20px;
    padding: 6px 14px;
    border: 1px solid #000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    font-size: 1em;
    font-weight: 600;
}

#modalColor
{
    color:white;
}
#modalColor .modal-header, #modalColor .modal-footer
{
    border-color:#fff2;
}

/* Stile per il controllo layer */
.leaflet-control-layers {
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    border: none !important;
}

.leaflet-control-layers-toggle {
    width: 40px !important;
    height: 40px !important;
    background-size: 24px 24px !important;
}

.leaflet-control-layers-expanded {
    padding: 10px 14px !important;
}

.leaflet-control-layers label {
    font-size: 0.95em;
    padding: 4px 0;
}

.leaflet-control-layers-selector {
    margin-right: 8px;
}

/* Mobile touch targets and sizing */
@media (max-width: 768px) {
    .map-control-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .add-resource-btn {
        width: 44px;
        height: 44px;
    }
    .title-box {
        font-size: 1.4em;
    }
    .leaflet-control-layers-toggle {
        width: 44px !important;
        height: 44px !important;
    }
}