/**
 * CSS Frontend per Documenti Amministrativi WP-Client
 * Stili per l'interfaccia utente del sistema documenti
 */

/* Container principale */
.daw-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Sezione istruzioni */
.daw-instructions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.daw-instructions h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.daw-instructions p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
}

.daw-requirements {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.daw-requirements h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.daw-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.daw-requirements li {
    margin-bottom: 8px;
    font-size: 14px;
}

.daw-required {
    color: #ff6b6b;
    font-weight: bold;
}

/* Sezione progresso */
.daw-progress-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
}

.daw-progress-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.daw-progress-bar {
    background: #ecf0f1;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.daw-progress-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.daw-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.daw-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #7f8c8d;
}

.daw-progress-percentage {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

/* Messaggi di completamento */
.daw-completion-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.daw-completion-message.daw-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.daw-completion-message.daw-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.daw-icon {
    font-size: 20px;
}

/* Griglia documenti */
.daw-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Card documento */
.daw-document-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    overflow: hidden;
}

.daw-document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.daw-document-card.daw-required-doc {
    border-left: 4px solid #e74c3c;
}

.daw-document-card.daw-optional-doc {
    border-left: 4px solid #f39c12;
}

/* Header documento */
.daw-document-header {
    padding: 20px 20px 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.daw-document-title {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daw-required-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.daw-optional-badge {
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
}

.daw-document-status {
    font-size: 14px;
}

.daw-status-uploaded {
    color: #27ae60;
    font-weight: bold;
}

.daw-status-missing {
    color: #e74c3c;
    font-weight: bold;
}

/* Descrizione documento */
.daw-document-description {
    padding: 15px 20px;
    background: #fdfdfd;
    border-bottom: 1px solid #f0f0f0;
}

.daw-document-description p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Contenuto documento */
.daw-document-content {
    padding: 20px;
}

/* Area di caricamento */
.daw-upload-area {
    position: relative;
}

.daw-dropzone {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.daw-dropzone:hover,
.daw-dropzone.daw-dragover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: scale(1.02);
}

.daw-dropzone.daw-dragover {
    border-color: #27ae60;
    background: #f0fff4;
}

.daw-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.daw-upload-text p {
    margin: 5px 0;
    color: #2c3e50;
}

.daw-upload-text strong {
    font-size: 16px;
}

.daw-btn-link {
    background: none;
    border: none;
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.daw-btn-link:hover {
    color: #2980b9;
}

.daw-upload-formats {
    margin-top: 15px;
    font-size: 12px;
    color: #7f8c8d;
}

/* Progress upload */
.daw-upload-progress {
    margin-top: 15px;
}

.daw-upload-progress .daw-progress-bar {
    height: 8px;
    margin-bottom: 8px;
}

.daw-upload-progress .daw-progress-text {
    font-size: 14px;
    color: #3498db;
    text-align: center;
}

/* File caricati */
.daw-uploaded-files {
    margin-bottom: 20px;
}

.daw-uploaded-file {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daw-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.daw-file-icon {
    font-size: 24px;
}

.daw-file-details {
    flex: 1;
}

.daw-file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.daw-file-meta {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.daw-file-status {
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.daw-file-status.daw-status-pending {
    background: #fff3cd;
    color: #856404;
}

.daw-file-status.daw-status-approved {
    background: #d4edda;
    color: #155724;
}

.daw-file-status.daw-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.daw-file-notes {
    margin-top: 8px;
    padding: 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 12px;
}

.daw-file-actions {
    display: flex;
    gap: 8px;
}

/* Sezione sostituzione */
.daw-replace-section {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.daw-replace-text {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #6c757d;
}

/* Bottoni */
.daw-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.daw-btn:hover {
    filter: brightness(1.12);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.daw-btn-primary {
    background: #3498db;
    color: white;
}

.daw-btn-primary:hover {
    background: #2980b9;
}

.daw-btn-secondary {
    background: #95a5a6;
    color: white;
}

.daw-btn-secondary:hover {
    background: #7f8c8d;
}

.daw-btn-danger {
    background: #e74c3c;
    color: white;
}

.daw-btn-danger:hover {
    background: #c0392b;
}

.daw-btn-outline {
    background: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.daw-btn-outline:hover {
    background: #3498db;
    color: white;
}

/* Sezione aiuto */
.daw-help-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
}

.daw-help-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.daw-help-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.daw-help-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.daw-help-item a {
    color: #3498db;
    text-decoration: none;
}

.daw-help-item a:hover {
    text-decoration: underline;
}

.daw-help-faq {
    margin-top: 20px;
}

.daw-help-faq details {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.daw-help-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
}

.daw-faq-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.daw-faq-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Messaggi */
.daw-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.daw-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

.daw-message.daw-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.daw-message.daw-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.daw-message.daw-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .daw-container {
        padding: 15px;
    }
    
    .daw-documents-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .daw-document-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .daw-uploaded-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .daw-file-actions {
        width: 100%;
        justify-content: center;
    }
    
    .daw-help-content {
        grid-template-columns: 1fr;
    }
    
    .daw-messages {
        left: 15px;
        right: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .daw-instructions {
        padding: 20px;
    }
    
    .daw-instructions h3 {
        font-size: 20px;
    }
    
    .daw-dropzone {
        padding: 30px 15px;
    }
    
    .daw-upload-icon {
        font-size: 36px;
    }
    
    .daw-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Link per scaricare il modello, sopra il riquadro di caricamento */
#daw-documenti-amministrativi .daw-model-download {
    margin: 0 0 12px;
}
#daw-documenti-amministrativi .daw-model-download .daw-btn-model {
    display: inline-block;
    text-decoration: none;
}

/* Dati del documento d'identità */
#daw-documenti-amministrativi .daw-id-data {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}
#daw-documenti-amministrativi .daw-id-data h5 {
    margin: 0 0 8px;
}
#daw-documenti-amministrativi .daw-id-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    align-items: end;
}
#daw-documenti-amministrativi .daw-id-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}
#daw-documenti-amministrativi .daw-id-warning {
    color: #b45309;
    font-weight: 600;
}
