/* DataTables sort arrows override */
table.dataTable thead .dt-column-order {
    display: none;
}

/* Documents table: first 3 columns left-aligned */
table#cig_documents thead th:nth-child(-n+3),
table#cig_documents tbody td:nth-child(-n+3) {
    text-align: left !important;
}

/* Uploaded column: prevent date wrapping */
table#cig_documents thead th:nth-child(3),
table#cig_documents tbody td:nth-child(3) {
    white-space: nowrap;
}

/* ---- CIG Map (ENEC style) ---- */
.container {
    border: solid #fff 5px;
    display: flex;
    flex-direction: row;
    width: 90%;
    max-width: 1200px;
    height: 650px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

#cig-map {
    flex: 2;
    height: 100%;
    background: #e0e0e0;
}

.sidebar {
    flex: 1;
    width: 380px;
    background: #ffffff;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.search-box {
    width: 70%;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    background-color: #f8f8f8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus {
    border-color: #00855a;
    background-color: #fff;
    box-shadow: 0 0 6px rgba(0, 120, 212, 0.4);
}

.info-window {
    padding: 10px;
    max-width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-window h3 {
    margin-bottom: 8px;
    color: #00855a;
    font-size: 16px;
}

.info-window p {
    margin: 4px 0;
    font-size: 14px;
    color: #555;
}

.location-list {
    list-style: none;
    margin-top: 20px;
}

.location-item {
    padding: 12px;
    border-bottom: 1px solid #e9e9e9;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease;
}

.location-item:hover {
    background-color: #f9f9f9;
}

.location-item h4 {
    color: #00855a;
    margin-bottom: 6px;
    font-size: 16px;
}

.location-item p {
    font-size: 13px;
    color: #777;
}

/* ---- Mappa su schermi stretti: lista sotto la mappa, non a fianco ----
   Le regole sono legate a .cig-map-container e non al solo .container,
   che è un nome troppo generico per essere sicuro sul tema. */
@media (max-width: 768px) {
    .cig-map-container {
        flex-direction: column;
        width: 95%;
        height: auto;
    }

    .cig-map-container #cig-map {
        flex: none;
        height: 60vh;
        min-height: 300px;
        max-height: 500px;
    }

    .cig-map-container .sidebar {
        flex: none;
        width: auto;
        max-height: 400px;
        border-left: none;
        border-top: 1px solid #ddd;
        padding: 15px;
    }

    .controls {
        width: 95%;
    }

    .search-box {
        width: 100%;
        box-sizing: border-box;
    }
}
