/* Pronto Soccorso AGID - Stili conformi alle linee guida AGID */

/* Reset e base */
.ps-agid-container {
    font-family: 'Titillium Web', 'Helvetica Neue', Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header */
.ps-agid-header {
    background: linear-gradient(135deg, #07768D 0%, #0F4B57 100%);
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
    margin: -1rem -1rem 1.5rem -1rem;
}

.ps-agid-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabella */
.ps-agid-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ps-agid-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.ps-agid-table thead {
    background-color: #0F4B57;
    color: #ffffff;
}

.ps-agid-table th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.ps-agid-table th:last-child {
    border-right: none;
}

.ps-agid-th-codice {
    width: 15%;
}

.ps-agid-th-visita,
.ps-agid-th-attesa,
.ps-agid-th-tempo {
    width: 28%;
}

/* Righe */
.ps-agid-row {
    border-bottom: 1px solid #E0E0E0;
    transition: background-color 0.2s ease;
}

.ps-agid-row:hover {
    background-color: #E3F2FD;
}

.ps-agid-row:last-child {
    border-bottom: none;
}

.ps-agid-table td {
    padding: 1rem;
    text-align: center;
    vertical-align: middle;
}

/* Codice */
.ps-agid-codice-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ps-agid-icon {
    width: 105px;
    height: auto;
    margin-right: 5px;
}

.ps-agid-color-dot {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #E0E0E0;
}

.ps-agid-codice-label {
    font-weight: 600;
    color: #333333;
    font-size: 0.95rem;
}

/* Valori */
.ps-agid-value {
    display: inline-block;
    background-color: #CDE9ED;
    color: #0F4B57;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    min-width: 60px;
    text-align: center;
}

.ps-agid-td-visita .ps-agid-value {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.ps-agid-td-tempo .ps-agid-value {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Footer */
.ps-agid-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #E0E0E0;
}

.ps-agid-note {
    color: #666666;
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
}

/* Errori */
.ps-agid-error {
    background-color: #FEE;
    color: #C00;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #C00;
    font-weight: 600;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .ps-agid-container {
        padding: 0.75rem;
    }
    
    .ps-agid-title {
        font-size: 1.25rem;
    }
    
    .ps-agid-table {
        font-size: 0.9rem;
    }
    
    .ps-agid-table thead {
        display: none;
    }
    
    .ps-agid-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #E0E0E0;
        border-radius: 6px;
        padding: 0.5rem;
    }
    
    .ps-agid-table td {
        display: block;
        text-align: left;
        padding: 0.5rem;
        border: none;
    }
    
    .ps-agid-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: #0066CC;
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
        text-transform: uppercase;
    }
    
    .ps-agid-codice-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .ps-agid-icon {
        width: 80px;
    }
    
    .ps-agid-value {
        display: block;
        border-radius: 6px !important;
        text-align: left;
    }
}

@media screen and (max-width: 480px) {
    .ps-agid-title {
        font-size: 1.1rem;
    }
    
    .ps-agid-codice-label {
        font-size: 0.9rem;
    }
}

/* Accessibilità */
.ps-agid-table:focus {
    outline: 3px solid #07768D;
    outline-offset: 2px;
}

/* Print */
@media print {
    .ps-agid-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .ps-agid-header {
        background: #0F4B57 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .ps-agid-value {
        background: #009FE3 !important;
        -webkit-print-color-adjust: exact;
    }

    .ps-codice-center {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
