/* style.css */
:root {
    --primary-color: #003366; /* Blu Istituzionale */
    --secondary-color: #00509e; /* Blu più chiaro per hover */
    --accent-color: #b08d55;   /* Oro/Bronzo per dettagli */
    --bg-color: #f4f4f6;       /* Grigio chiarissimo */
    --text-color: #333;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Istituzionale */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header h1 { margin: 0; font-size: 1.4rem; font-weight: 600; }
header p { margin: 5px 0 0; font-size: 0.9rem; opacity: 0.9; }

/* Contenitore Principale */
.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Card e Pannelli */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
    border-top: 4px solid var(--primary-color);
}

/* Form di Ricerca */
.search-box { display: flex; gap: 10px; flex-wrap: wrap; }
.search-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px; /* Evita zoom su iPhone */
}
.btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: background 0.3s;
}
.btn:hover { background-color: var(--secondary-color); }
.btn-reset { background-color: #6c757d; }
.btn-call { 
    background-color: #28a745; 
    padding: 8px 12px; 
    font-size: 0.9rem;
    border-radius: 20px; /* Arrotondato */
}

/* Tabella Responsive */
.table-container {
    width: 100%;
    overflow-x: auto; /* Scroll orizzontale se necessario */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--primary-color);
    color: white;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* MOBILE OPTIMIZATION */
@media screen and (max-width: 600px) {
    /* Nascondi l'intestazione della tabella su mobile */
    table thead { display: none; }
    
    /* Trasforma le righe in "Card" */
    table, tbody, tr, td { display: block; width: 100%; }
    
    table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        overflow: hidden; /* Per i bordi arrotondati */
    }
    
    table td {
        text-align: right; /* Allinea i dati a destra */
        padding-left: 50%; /* Spazio per l'etichetta */
        position: relative;
        border-bottom: 1px solid #eee;
    }
    
    /* Crea finte etichette usando data-label */
    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--primary-color);
    }
    
    /* Il tasto chiama deve essere grande */
    .btn-call { display: block; text-align: center; margin-top: 5px;}
}