/**
 * Ricerca Partigiani - Stili CSS
 * Version: 1.0.0
 */

/* Container principale */
.rp-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Form di ricerca */
.rp-search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Griglia form - 3 colonne */
.rp-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

/* Sezione date */
.rp-date-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

/* Gruppo form */
.rp-form-group {
    margin-bottom: 0;
}

.rp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Input e Select */
.rp-input,
.rp-select,
.rp-date {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.rp-input:focus,
.rp-select:focus,
.rp-date:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

/* Date range */
.rp-date-range .rp-date-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rp-date-range .rp-date {
    flex: 1;
}

.rp-date-separator {
    color: #666;
    font-weight: bold;
}

/* Pulsanti */
.rp-form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.rp-submit,
.rp-reset {
    padding: 12px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.rp-submit {
    background: #007cba;
    color: white;
}

.rp-submit:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,124,186,0.2);
}

.rp-reset {
    background: #6c757d;
    color: white;
}

.rp-reset:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108,117,125,0.2);
}

/* Header risultati */
.rp-results-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007cba;
}

.rp-results-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Griglia risultati */
.rp-results-grid {
    display: grid;
    gap: 20px;
}

/* Singolo risultato */
.rp-result-item {
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    transition: box-shadow 0.3s;
    display: flex;
    gap: 0;
    overflow: hidden;
}

.rp-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Immagine risultato */
.rp-result-image {
    flex-shrink: 0;
    width: 190px;
    padding: 20px 0 20px 20px;
    background: #f8f9fa;
    border-right: 1px solid #e1e4e8;
}

.rp-result-image img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

/* Contenuto risultato */
.rp-result-content {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

.rp-result-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.rp-result-title a {
    color: #007cba;
    text-decoration: none;
}

.rp-result-title a:hover {
    text-decoration: underline;
}

/* Griglia dettagli completi */
.rp-result-details {
    margin-bottom: 20px;
}

.rp-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.rp-detail-item {
    display: flex;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px dotted #dee2e6;
}

.rp-detail-label {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
    min-width: 140px;
    font-size: 13px;
}

.rp-detail-value {
    flex: 1;
    color: #212529;
    font-size: 14px;
}

/* Evidenzia campo caduto */
.rp-highlight-caduto .rp-detail-value {
    color: #dc3545;
    font-weight: bold;
}

/* Sezione caratteristiche speciali */
.rp-result-special {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.rp-special-label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
    font-size: 14px;
}

.rp-no-badges {
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
}

/* Meta dati risultato - RIMOSSO perché ora usiamo details grid */
.rp-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.rp-meta-item {
    display: inline-block;
}

.rp-meta-item strong {
    color: #333;
}

/* Evidenzia caduti */
.rp-caduto {
    color: #dc3545;
    font-weight: bold;
}

/* Badges */
.rp-result-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rp-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Badge specifici con colori diversi */
.rp-badge-decorato {
    background: #ffd700;
    color: #333;
}

.rp-badge-ferito {
    background: #dc3545;
    color: white;
}

.rp-badge-prigioniero {
    background: #6c757d;
    color: white;
}

/* Excerpt */
.rp-result-excerpt {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

/* Link azioni */
.rp-result-actions {
    margin-top: auto;
}

.rp-read-more {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.rp-read-more:hover {
    text-decoration: underline;
}

/* Loader */
.rp-loader {
    text-align: center;
    padding: 40px;
}

.rp-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: rp-spin 1s linear infinite;
}

@keyframes rp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Nessun risultato */
.rp-no-results {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rp-no-results p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Paginazione */
.rp-pagination {
    margin-top: 30px;
    text-align: center;
}

.rp-pagination a,
.rp-pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
    cursor: pointer;
}

.rp-pagination a:hover,
.rp-pagination .current {
    background: #007cba;
    color: white;
}

/* Messaggi di errore */
.rp-error {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin: 20px 0;
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .rp-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rp-date-section {
        grid-template-columns: 1fr;
    }
    
    .rp-search-form {
        padding: 20px;
    }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
    .rp-form-grid {
        grid-template-columns: 1fr;
    }
    
    .rp-form-buttons {
        flex-direction: column;
    }
    
    .rp-submit,
    .rp-reset {
        width: 100%;
    }
    
    .rp-date-range .rp-date-inputs {
        flex-direction: column;
    }
    
    .rp-date-separator {
        display: none;
    }
    
    .rp-result-item {
        flex-direction: column;
    }
    
    .rp-result-image {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
    }
    
    .rp-result-image img {
        width: 100%;
        height: 200px;
    }
    
    .rp-result-content {
        padding: 15px;
    }
    
    /* Griglia dettagli mobile */
    .rp-details-grid {
        grid-template-columns: 1fr;
    }
    
    .rp-detail-label {
        min-width: 120px;
    }
}

/* Utility classes */
.rp-text-center {
    text-align: center;
}

.rp-mt-3 {
    margin-top: 1rem;
}

.rp-mb-3 {
    margin-bottom: 1rem;
}

/* Animazioni di transizione */
.rp-results-grid > * {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
