/**
 * Ricerca Fondi Troilo - Stili CSS
 * Version: 1.0.4
 */

/* Container principale */
.rft-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Form di ricerca */
.rft-search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Gruppo form */
.rft-form-group {
    margin-bottom: 20px;
}

.rft-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Input e Select */
.rft-input,
.rft-select,
.rft-date {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.rft-input:focus,
.rft-select:focus,
.rft-date:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

/* Date range */
.rft-date-range .rft-date-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rft-date-range .rft-date {
    flex: 1;
}

.rft-date-separator {
    color: #666;
    font-weight: bold;
}

/* Pulsanti form */
.rft-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.rft-submit,
.rft-reset {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.rft-submit {
    background: #007cba;
    color: white;
}

.rft-submit:hover {
    background: #005a87;
}

.rft-reset {
    background: #6c757d;
    color: white;
}

.rft-reset:hover {
    background: #545b62;
}

/* Header risultati */
.rft-results-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007cba;
}

.rft-results-header h3 {
    margin: 0;
    color: #333;
}

/* Griglia risultati */
.rft-results-grid {
    display: grid;
    gap: 20px;
}

/* Singolo risultato */
.rft-result-item {
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    transition: box-shadow 0.3s;
    display: flex;
    gap: 0;
    overflow: hidden;
}

.rft-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Immagine risultato */
.rft-result-image {
    flex-shrink: 0;
    width: 190px;
    padding: 20px 0 20px 20px;
    background: #f8f9fa;
    border-right: 1px solid #e1e4e8;
}

.rft-result-image img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

/* Contenuto risultato */
.rft-result-content {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

.rft-result-title {
    margin: 0 0 15px 0;
    font-size: 20px;
}

.rft-result-title a {
    color: #007cba;
    text-decoration: none;
}

.rft-result-title a:hover {
    text-decoration: underline;
}

/* Meta dati risultato */
.rft-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.rft-meta-testata,
.rft-meta-data {
    display: inline-block;
}

.rft-meta-testata strong,
.rft-meta-data strong {
    color: #333;
}

/* Tassonomie */
.rft-result-taxonomies {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.rft-tax-item {
    background: #f0f2f5;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

/* Excerpt */
.rft-result-excerpt {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
}

/* Link azioni */
.rft-read-more {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
}

.rft-read-more:hover {
    text-decoration: underline;
}

/* Loader */
.rft-loader {
    text-align: center;
    padding: 40px;
}

.rft-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: rft-spin 1s linear infinite;
}

@keyframes rft-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Nessun risultato */
.rft-no-results {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Paginazione */
.rft-pagination {
    margin-top: 30px;
    text-align: center;
}

.rft-pagination a,
.rft-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;
}

.rft-pagination a:hover,
.rft-pagination .current {
    background: #007cba;
    color: white;
}

/* Debug info (opzionale) */
.rft-debug {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 10px;
    margin-top: 20px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

/* Messaggi di errore */
.rft-error {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin: 20px 0;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .rft-search-form {
        padding: 20px;
    }
    
    .rft-form-buttons {
        flex-direction: column;
    }
    
    .rft-submit,
    .rft-reset {
        width: 100%;
    }
    
    .rft-date-range .rft-date-inputs {
        flex-direction: column;
    }
    
    .rft-date-separator {
        display: none;
    }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
    .rft-result-item {
        flex-direction: column;
    }
    
    .rft-result-image {
        width: 100%;
        padding: 20px;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
    }
    
    .rft-result-image img {
        width: 100%;
        height: 200px;
    }
    
    .rft-result-content {
        padding: 15px;
    }
}