/* Reset e stili di base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    line-height: 1.6 !important;
    color: #333 !important;
    background-color: #f8f9fa !important;
    padding: 20px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    font: 1rem Lato !important;
}

/* Stili generali per l'accessibilità */
:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Header e logo */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e3a8a;
}

/* Form di ricerca */
.search-form {
    width: 100%;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-form-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #1e3a8a;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    font-size: 1rem;
}


.search-button {
    padding: 0.5rem 1rem;
    background-color: #2563eb;
    color: white;
    border:none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight:bold;
}

.search-button:hover,
.search-button:active {
    background-color: #1d4ed8;
}

/* Filtri di ricerca */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    margin-bottom: 1rem;
}

.filter-label {
    margin-bottom: 0.5rem;
    /*font-weight: 600;*/
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
}

.filter-date {
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    width: 100%;
}

.date-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-range-separator {
    font-weight: 600;
}

.filter-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.filter-section-title {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #1e3a8a;
    font-weight:bold;
}

.filter-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.filter-reset {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .filter-reset:hover,
    .filter-reset:focus {
        background-color: #e2e8f0;
    }

.filter-toggle {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle-button {
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .filter-toggle-button:hover,
    .filter-toggle-button:focus {
        background-color: #e2e8f0;
    }

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.filter-tag-remove {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .filter-tag-remove:hover,
    .filter-tag-remove:focus {
        color: #334155;
    }

/* Risultati della ricerca */
.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem;
}

.results-count {
    font-weight: 600;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

    .result-item:hover,
    .result-item:focus-within {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

.result-content {
    display: flex;
    gap: 1.5rem;
}

.result-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 160px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .result-thumbnail img {
        max-width: 100%;
        max-height: 100%;
        object-fit: cover;
    }

.thumbnail-format {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.75rem;
    padding: 2px 4px;
    text-align: center;
}

.result-main {
    flex: 1;
}

.result-title {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: #1e3a8a;
}

    .result-title a {
        color: #2563eb;
        text-decoration: none;
    }

        .result-title a:hover,
        .result-title a:focus {
            text-decoration: underline;
        }

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.result-abstract {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

    .result-abstract em {
        font-style: normal;
        font-weight: 600;
        background-color: #fef3c7;
        padding: 0 2px;
    }

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.availability {
    font-weight: 600;
}

.availability-yes {
    color: #16a34a;
}

.availability-no {
    color: #dc2626;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.action-button {
    padding: 0.5rem 0.75rem;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.favorite-button {
    background-color: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .favorite-button:hover,
    .favorite-button:focus {
        background-color: #f1f5f9;
    }

.favorite-icon {
    color: #f59e0b;
    font-size: 1rem;
}

.action-button:hover,
.action-button:focus {
    background-color: #e2e8f0;
}

/* Rating Stars */
.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-label {
    font-weight: 600;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #f59e0b;
    font-size: 1rem;
}
.star-gray {
    color: #64748b;
    font-size: 1rem;
}

.star-empty {
    color: #cbd5e1;
}

/* Tags */
.meta-tags-container {
    margin-top: 0.75rem;
}

.meta-tags-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #334155;
}

.meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-tag {
    padding: 0.2rem 0.5rem;
    background-color: #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #334155;
}

/* Paginazione */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.25rem;
}

.pagination-item {
    list-style: none;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    color: #334155;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

    .pagination-link:hover,
    .pagination-link:focus {
        background-color: #f1f5f9;
        z-index: 1;
    }

    .pagination-link.active {
        background-color: #2563eb;
        color: white;
        font-weight: 600;
        border-color: #2563eb;
    }

.pagination-text {
    margin: 0 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.modal-body {
    height: calc(90vh - 56px); /* Altezza dello schermo meno la header del modale */
}

    .modal-body object {
        width: 100%;
        height: 100%;
    }

/* Media query per layout responsivo */
@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
    }

    .search-results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .result-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .date-range {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-columns {
        grid-template-columns: 1fr;
    }

    .result-content {
        flex-direction: column;
    }

    .result-thumbnail {
        width: 100%;
        height: 200px;
        margin-bottom: 1rem;
    }
}
