/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

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

/* Skip to main content for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3498db;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1001;
}

.skip-link:focus {
    top: 6px;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-cimec, .logo-unitn {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.nav-text h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.nav-text p {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #3498db;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/Pictures/manifattura.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: white;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    display: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-description p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.brain-animation {
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.05); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.1; }
}

/* Sections */
section {
    padding: 5rem 0;
}

h2 {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: #2c3e50;
}

/* Overview Section */
.overview {
    background: #f8f9fa;
}

.overview h2 {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
}

.overview-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: justify;
    color: #ffffff !important;
}

.research-goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.goal {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: none !important;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
}

.goal:hover {
    transform: translateY(-5px);
}

.goal i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.goal h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2c3e50 !important;
}

.goal p {
    color: #555 !important;
    font-size: 1rem;
}

/* Research Section */
.research {
    background: white;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.research-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.research-card:hover {
    transform: translateY(-10px);
}

.research-icon {
    background: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 1px solid #e0e0e0;
}

.research-icon i {
    font-size: 2rem;
    color: #3498db;
}

.research-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.research-card p {
    color: #555;
    font-size: 1rem;
}

/* Team Section */
.team {
    background: #f8f9fa;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.team-member {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-photo {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-photo.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-photo.placeholder i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.7);
}

.member-info {
    padding: 1.5rem;
}

.member-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.position {
    font-weight: 600;
    color: #3498db;
    margin-bottom: 1rem;
}

.description {
    color: #666;
    font-size: 0.9rem;
}

/* Join Us Section */
.join-us-section {
    margin-top: 3rem;
    padding: 0;
}

.join-us-content {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.join-us-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    background: white;
    color: #667eea;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: none;
}

.join-us-btn:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.join-us-btn i {
    font-size: 1.2rem;
}

/* Collaborations Section */
.collaborations {
    background: white;
}

.collaboration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.collaboration-item {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid #3498db;
}

.collaboration-item h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.affiliation {
    font-weight: 600;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.institution {
    color: #666;
    font-size: 0.9rem;
}

.grants-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    margin-top: 3rem;
}

.grants-section h3 {
    color: white;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2.5rem;
}

.grants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grant-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.grant-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.grant-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.grant-icon i {
    font-size: 1.8rem;
    color: white;
}

.grant-card h4 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.grant-period {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.grant-team,
.grant-description,
.grant-pi,
.grant-consortium {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.grant-description {
    font-style: italic;
    margin-top: 1rem;
}

.grant-pi strong,
.grant-consortium strong {
    color: white;
    font-weight: 600;
}

/* Publications Section */.grant-period {
    font-weight: 600;
    opacity: 0.9;
}

.grant-investigators {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Publications Section */
.publications {
    background: #f8f9fa;
}

.publications-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.publication-item {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #3498db;
}

.publication-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.publication-header h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.publication-year {
    color: #3498db;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.publication-journal {
    color: #3498db;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.publication-authors {
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.publication-preview {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.publication-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.expand-btn {
    background: #e9ecef;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-btn:hover {
    background: #dee2e6;
    color: #343a40;
}

.expand-btn i {
    transition: transform 0.3s ease;
}

.expand-btn.expanded i {
    transform: rotate(180deg);
}

.pdf-btn {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-btn:hover {
    background: #c82333;
    color: white;
    transform: translateY(-1px);
}

.publication-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    animation: fadeIn 0.3s ease;
}

.publication-details p {
    margin-bottom: 1rem;
    color: #555;
}

.publication-details strong {
    color: #2c3e50;
}

.publications-note-bottom {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    border: 2px dashed #3498db;
}

.publications-link-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
}

.publications-link-small:hover {
    color: #2980b9;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Section */
.contact {
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.lab-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item i {
    font-size: 1.2rem;
    color: #3498db;
    width: 20px;
}

.contact-item a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #2980b9;
}

.cimec-info {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid #3498db;
}

.cimec-info h4 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.cimec-info p {
    color: #666;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logos {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-logos img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-text p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo-cimec, .logo-unitn {
        height: 35px;
    }
    
    .nav-text h2 {
        font-size: 1rem;
    }
    
    .nav-text p {
        font-size: 0.8rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .brain-animation {
        font-size: 6rem;
    }
    
    .research-goals {
        grid-template-columns: 1fr;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .collaboration-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .goal, .research-card, .team-member, .collaboration-item {
        margin: 0 0.5rem;
    }
}