/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px; /* Offset per compensare la navbar sticky */
}
.team-group {
    margin-bottom: 50px;
}
.team-group-title {
    font-size: 1.3rem;
    color: #003366;
    margin-bottom: 25px;
    text-align: center;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation Menu */
.navbar {
    background-color: #003366;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-logo-img {
    width: 36px;
    height: 36px;
    padding: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hamburger Menu - Hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

/* Header/Hero Section */
.hero {
    background: linear-gradient(135deg, #003366 0%, #004d99 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero .logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 8px;
    padding: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}   

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.3rem;
    margin-bottom: 20px;
    opacity: 0.95;
}

.hero .description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    opacity: 0.9;
}

/* Team Section */
.team {
    padding: 80px 20px;
    background-color: white;
}

.team h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #003366;
    margin-bottom: 60px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.team-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 51, 102, 0.15);
}

.member-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid #004d99;
    background-color: #f0f4f8;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.member-photo-link {
    display: inline-block;
    perspective: 1000px;
}

/* Effetto rotazione solo su dispositivi con mouse/pointing device */
@media (hover: hover) and (pointer: fine) {
    .member-photo-link:hover .member-photo {
        transform: rotateY(360deg);
    }
}

.team-card h3 {
    margin: 15px 0 0 0;
    font-size: 1.4rem;
    color: #003366;
}

.team-card h3 a {
    color: #003366;
    text-decoration: none;
    transition: color 0.3s ease;
}

.team-card h3 a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.university-logo {
    width: 210px;
    height: 210px;
    margin: 0;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.casd-logo {
    width: 120px;
    height: 120px;
    margin: 0;
}

.logo-link {
    display: inline-block;
    margin: 12px 0;
}

.team-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 12px 0;
}

.team-logos .university-logo {
    width: 145px;
    height: 145px;
}

.logo-divider {
    width: 2px;
    height: 48px;
    background-color: #003366;
    opacity: 0.9;
}

.university-logo:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.team-card .university {
    color: #666;
    font-size: 1.05rem;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.team-card .bio {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 15px 0 20px 0;
    min-height: 70px;
    text-align: left;
}

.contact-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #004d99;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.contact-btn:hover {
    background-color: #003366;
    transform: scale(1.05);
}

/* Publications Section */
.publications {
    padding: 80px 20px;
    background-color: #f4f7fa;
}

.publications h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #003366;
    margin-bottom: 20px;
}

.section-intro {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.publications-list {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.publications-list h3 {
    color: #003366;
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #004d99;
    padding-bottom: 8px;
}

.publications-list h3:first-child {
    margin-top: 0;
}

.publications-list ul {
    list-style: none;
    padding-left: 0;
}

.publications-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.publications-list li:last-child {
    border-bottom: none;
}

.publications-list a {
    color: #004d99;
    text-decoration: none;
    font-weight: 500;
}

.publications-list a:hover {
    color: #003366;
    text-decoration: underline;
}

.placeholder-text {
    color: #999;
    font-style: italic;
    padding: 15px 0;
}

/* Repositories Section */
.repositories {
    padding: 80px 20px;
    background-color: white;
}

.repositories h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #003366;
    margin-bottom: 20px;
}

.repos-table {
    width: 100%;
    max-width: 1000px;
    margin: 40px auto 0;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.repos-table thead {
    background-color: #003366;
    color: white;
}

.repos-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.repos-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.repos-table tbody tr:last-child td {
    border-bottom: none;
}

.repos-table tbody tr:hover {
    background-color: #f4f7fa;
}

.repos-table code {
    background-color: #f0f4f8;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #003366;
    font-weight: 600;
}

.repos-table a {
    color: #004d99;
    text-decoration: none;
    font-weight: 500;
}

.repos-table a:hover {
    color: #003366;
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: #003366;
    color: white;
    padding: 50px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 10px;
}

.footer-section a {
    color: #b3d9ff;
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
    opacity: 0.8;
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: #003366;
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        padding: 20px 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 0;
    }
    
    .nav-link {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: 0;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Hamburger animation */
    .hamburger.active .hamburger-line:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .hamburger-line:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .hero .description {
        font-size: 1rem;
    }

    .team h2,
    .publications h2,
    .repositories h2 {
        font-size: 2rem;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }

    .member-photo {
        width: 130px;
        height: 130px;
    }

    .university-logo {
        width: 180px;
        height: 180px;
    }

    .casd-logo {
        width: 105px;
        height: 105px;
        margin: 0;
    }

    .team-logos .university-logo {
        width: 130px;
        height: 130px;
    }

    .logo-divider {
        height: 40px;
    }

    .hero {
        padding: 60px 20px;
    }

    .team,
    .publications,
    .repositories {
        padding: 60px 20px;
    }

    .publications-list {
        padding: 30px;
    }

    .repos-table {
        font-size: 0.9rem;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .hero {
        padding: 40px 15px;
    }

    .hero .logo {
        max-width: 100px;
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .hero .description {
        font-size: 0.95rem;
    }

    .team h2,
    .publications h2,
    .repositories h2 {
        font-size: 1.6rem;
        margin-bottom: 40px;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .team-card {
        padding: 25px;
    }

    .member-photo {
        width: 120px;
        height: 120px;
    }

    .university-logo {
        width: 150px;
        height: 150px;
    }

    .casd-logo {
        width: 90px;
        height: 90px;
        margin: 0;
    }

    .team-logos .university-logo {
        width: 110px;
        height: 110px;
    }

    .logo-divider {
        height: 36px;
    }

    .team,
    .publications,
    .repositories {
        padding: 40px 15px;
    }

    .publications-list {
        padding: 25px;
    }

    .publications-list h3 {
        font-size: 1.3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .section-intro {
        font-size: 1rem;
    }

    /* Mobile responsive table */
    .repos-table {
        font-size: 0.85rem;
    }

    .repos-table th,
    .repos-table td {
        padding: 10px;
    }

    /* Nascondi colonna Paper su mobile */
    .repos-table th:nth-child(4),
    .repos-table td:nth-child(4) {
        display: none;
    }
}
