/* 
 * Stili per il modal dei documenti legali (Privacy Policy e Termini e Condizioni)
 * Compatibile con Bootstrap e il tema esistente
 */

/* Overlay del modal */
.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Overlay visibile */
.legal-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Contenitore del modal */
.legal-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    display: flex;
    flex-direction: column;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    overflow: hidden;
    cursor: default;
}

/* Modal visibile */
.legal-modal-overlay.show .legal-modal {
    transform: scale(1);
}

/* Header del modal */
.legal-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

/* Titolo del modal */
.legal-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

/* Pulsante di chiusura */
.legal-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.legal-modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.legal-modal-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Corpo del modal */
.legal-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

/* Stili per il contenuto HTML */
.legal-modal-body h1,
.legal-modal-body h2,
.legal-modal-body h3,
.legal-modal-body h4,
.legal-modal-body h5,
.legal-modal-body h6 {
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.legal-modal-body h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.legal-modal-body h2 {
    font-size: 1.5rem;
    color: #007bff;
}

.legal-modal-body h3 {
    font-size: 1.3rem;
    color: #495057;
}

.legal-modal-body p {
    margin-bottom: 1rem;
    color: #555;
}

.legal-modal-body ul,
.legal-modal-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-modal-body li {
    margin-bottom: 0.5rem;
    color: #555;
}

.legal-modal-body strong,
.legal-modal-body b {
    color: #333;
}

.legal-modal-body a {
    color: #007bff;
    text-decoration: none;
}

.legal-modal-body a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Footer del modal */
.legal-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Informazioni di aggiornamento */
.legal-modal-updated {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
}

/* Pulsante di chiusura nel footer */
.legal-modal-footer .btn {
    min-width: 100px;
}

/* Indicatore di caricamento */
.legal-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.legal-modal-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messaggio di errore */
.legal-modal-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
}

.legal-modal-error .error-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .legal-modal {
        max-width: 95%;
        max-height: 95%;
        margin: 10px;
    }
    
    .legal-modal-header,
    .legal-modal-body,
    .legal-modal-footer {
        padding: 15px 20px;
    }
    
    .legal-modal-title {
        font-size: 1.3rem;
    }
    
    .legal-modal-body {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .legal-modal {
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .legal-modal-header,
    .legal-modal-body,
    .legal-modal-footer {
        padding: 12px 15px;
    }
    
    .legal-modal-title {
        font-size: 1.2rem;
    }
    
    .legal-modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .legal-modal-updated {
        text-align: center;
    }
}

/* Accessibilità */
.legal-modal:focus {
    outline: none;
}

/* Animazione di entrata per il contenuto */
.legal-modal-content-enter {
    opacity: 0;
    transform: translateY(20px);
}

.legal-modal-content-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

/* Stili per la scrollbar personalizzata (webkit) */
.legal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Stili per evidenziare sezioni importanti */
.legal-modal-body .highlight {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.legal-modal-body .important {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

/* Stili per tabelle se presenti nel contenuto */
.legal-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.legal-modal-body table th,
.legal-modal-body table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
}

.legal-modal-body table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.legal-modal-body table tr:nth-child(even) {
    background-color: #f8f9fa;
}
