/* Stili personalizzati per il visualizzatore delle Tesi ENEA */

.tesi-container {
    font-family: 'Titillium Web', sans-serif;
    color: #334155;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    margin-bottom: 50px;
}

.tesi-header {
    text-align: center;
    margin-bottom: 35px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
}

.tesi-header h1 {
    color: #2d79aa;
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: -0.025em;
}

.tesi-header p {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.tesi-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.search-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
#search-input {
    width: 98%;
}
.search-input {
    width: 100%;
    margin-left: 1.5rem;
    padding: 12px 16px 12px 45px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
}

.search-input:focus {
    border-color: #2d79aa;
    box-shadow: 0 0 0 3px rgba(45, 121, 170, 0.15);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: white;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    border-color: #2d79aa;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-text strong {
    color: #1e293b;
}

.stats-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-badge.total { background: #e0f2fe; color: #0369a1; }
.stat-badge.available { background: #dcfce7; color: #15803d; }
.stat-badge.assigned { background: #fee2e2; color: #991b1b; }

.tesi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 35px;
}

.tesi-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
    position: relative;
}

.tesi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    flex-wrap: wrap;
}

.card-badge-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-available { background-color: #dcfce7; color: #166534; }
.badge-assigned { background-color: #fee2e2; color: #991b1b; }
.badge-code { background-color: #f1f5f9; color: #475569; }
.badge-level { background-color: #f0f9ff; color: #0369a1; }

.card-date {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-project {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tag-course {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-people {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #f1f5f9;
}

.person-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.person-info h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 4px;
}

.person-info p {
    font-size: 0.9rem;
    margin: 0;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.person-info p i {
    color: #64748b;
    width: 16px;
    text-align: center;
}

.person-info a {
    color: #2d79aa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.person-info a:hover {
    color: #1e5274;
    text-decoration: underline;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px;
    flex-wrap: wrap;
    gap: 20px;
    border-top: 2px solid #e2e8f0;
    padding-top: 25px;
}

.page-btn {
    padding: 10px 18px;
    border: 1px solid #cbd5e1;
    background-color: white;
    color: #334155;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.page-btn:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    color: #475569;
}

.page-num.active {
    background-color: #2d79aa;
    color: white;
    border-color: #2d79aa;
}

.page-num:hover:not(.active) {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.page-ellipsis {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 600;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.loader {
    border: 4px solid #f1f5f9;
    border-top: 4px solid #2d79aa;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 15px;
}

.loader-text {
    color: #64748b;
    font-weight: 600;
}

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

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.no-results i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}

.no-results p {
    font-size: 0.95rem;
    color: #94a3b8;
}

.highlight {
    background-color: #fef08a;
    color: #854d0e;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: inherit;
}

/* Sticky layout for the top section containing header, controls, and stats */
.tesi-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #ffffff;
    padding-top: 10px;
    margin-top: -10px;
}

/* Offset positioning when site-wide sticky header is active */
#sp-header.header-sticky ~ #sp-main .tesi-sticky-header,
#sp-header.header-sticky ~ main .tesi-sticky-header,
.header-sticky .tesi-sticky-header,
body.header-sticky .tesi-sticky-header {
    top: 90px;
}

@media (max-width: 991.98px) {
    #sp-header.header-sticky ~ #sp-main .tesi-sticky-header,
    #sp-header.header-sticky ~ main .tesi-sticky-header,
    .header-sticky .tesi-sticky-header,
    body.header-sticky .tesi-sticky-header {
        top: 70px;
    }
}
