:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --background: #ffffff;
  --background-alt: #f9fafb;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Usiamo il nuovo colore per il testo */
  background-color: var(--background); /* Sostituiamo il gradiente con un colore unico */
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

h1 { font-size: 3rem; font-weight: 700; line-height: 1.2; color: var(--text-dark); }
h2 { font-size: 2.25rem; font-weight: 600; line-height: 1.3; color: var(--text-dark); }
h3 { font-size: 1.5rem; font-weight: 600; color: var(--text-dark); }
p { font-size: 1.125rem; line-height: 1.7; color: #4B5563; }

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

/* Header */
.main-header {
    background-color: var(--background); /* Sostituito con colore unico */
    color: var(--text-dark);
    padding-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 10vh; /* Ridotta l'altezza minima per lo spazio del logo */
    padding: 4rem 2rem; /* Aumentato il padding */
    position: relative;
    width: 100%;
    margin-bottom: 40px;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border-radius: 12px; /* Aggiunto border-radius */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); /* Aggiunto box-shadow */
}

.hero-content-overlay {
    position: relative; /* Cambiato da absolute a relative per flexbox */
    z-index: 10;
    display: flex; /* Abilita Flexbox */
    flex-direction: column; /* Organizza gli elementi in colonna */
    justify-content: center; /* Centra verticalmente */
    align-items: center; /* Centra orizzontalmente */
    width: 90%;
    max-width: 900px;
    padding-top: 10px;
}

.hero-content-overlay .hero-title { /* Made more specific to ensure precedence */
    font-size: 3.5em;
    color: #fff; /* Ensured it's white */
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.5em;
    color: #fff !important; /* Forzato il colore bianco per tutto il sottotitolo */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    margin-bottom: 0;
    line-height: 1.8;
    text-transform: none;
    background-color: rgba(0, 0, 0, 0.7); /* Ripristinato il background */
    padding: 3px 10px; /* Ripristinato padding orizzontale */
    display: inline-block; /* Cambiato a inline-block */
    box-decoration-break: clone; /* Per gestire il background su più righe */
    -webkit-box-decoration-break: clone; /* Per browser basati su WebKit */
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem; /* Aumentato il margine superiore */
}

.header-content {
    max-width: 1200px; /* Aumentato max-width */
    margin: 0 auto;
    padding: 0 2rem; /* Aumentato il padding */
    position: relative;
    z-index: 5;
}

.main-header h1 {
    font-size: 3rem; /* Usiamo la nuova gerarchia tipografica */
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark); /* Usiamo il nuovo colore per il testo */
    text-shadow: none; /* Rimosso text-shadow */
    margin-bottom: 20px;
}

.main-header .pre-headline {
    font-size: 1.2em;
    color: var(--text-light); /* Usiamo il nuovo colore per il testo */
    margin-bottom: 10px;
}

.sub-headline-container {
    background-color: var(--background-alt); /* Sostituito con colore alternativo */
    padding: 2rem; /* Aumentato il padding */
    margin: 2rem auto; /* Aumentato il margine */
    max-width: 1200px; /* Aumentato max-width */
    border-radius: 8px;
}

.main-header .sub-headline {
    font-size: 1.5rem; /* Usiamo la nuova gerarchia tipografica */
    font-weight: 600;
    color: var(--text-dark); /* Usiamo il nuovo colore per il testo */
    margin-top: 0;
    margin-bottom: 0;
}

.main-header p {
    font-size: 1.125rem; /* Usiamo la nuova gerarchia tipografica */
    line-height: 1.7;
    color: #4B5563;
    margin-bottom: 15px;
}

/* Buttons */
.button, .cta-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  display: inline-block; /* Assicurati che i bottoni siano inline-block */
  text-decoration: none; /* Rimuovi la sottolineatura */
  text-align: center;
}

.button:hover, .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn { /* Rimuoviamo gli stili generici .btn e usiamo .button o .cta-button */
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.primary-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.secondary-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Usiamo lo stesso gradiente per coerenza */
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.secondary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.github-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.github-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.email-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    white-space: normal;
    word-break: break-word;
}

.email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cta-actions {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* Sections */
section {
  padding: 5rem 2rem; /* invece di 2rem o 3rem */
  max-width: 1200px; /* invece di valori più piccoli */
  margin: 0 auto;
  background-color: var(--background); /* Tutte le sezioni con background bianco */
  border-bottom: none; /* Rimosso il bordo inferiore */
}

.section:last-of-type {
    border-bottom: none;
}

.section h2 {
    font-size: 2.25rem; /* Usiamo la nuova gerarchia tipografica */
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark); /* Usiamo il nuovo colore per il testo */
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section h2::after {
    content: '';
    width: 80px;
    height: 4px;
    background: var(--secondary); /* Usiamo la variabile colore */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    border-radius: 2px;
}

.section h3 {
    font-size: 1.5rem; /* Usiamo la nuova gerarchia tipografica */
    font-weight: 600;
    color: var(--text-dark); /* Usiamo il nuovo colore per il testo */
    margin-top: 30px;
    margin-bottom: 15px;
}

.section p {
    margin-bottom: 15px;
    font-size: 1.125rem; /* Usiamo la nuova gerarchia tipografica */
    line-height: 1.7;
    color: #4B5563;
}

.elemento + .elemento {
  margin-top: 2rem; /* o 3rem dove serve più respiro */
}

.section ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.section ul li {
    background-color: var(--background-alt); /* Usiamo il colore alternativo */
    margin-bottom: 10px;
    padding: 15px;
    border-left: 4px solid var(--primary); /* Usiamo la variabile colore */
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Ombra più leggera */
}

.section ul li strong {
    color: var(--primary); /* Usiamo la variabile colore */
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 30px;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: var(--background); /* Usiamo il colore di background */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Ombra più leggera */
    table-layout: fixed;
}

table th, table td {
    padding: 15px;
    border: 1px solid #e5e7eb; /* Bordo più chiaro */
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
}

table th {
    background-color: var(--secondary); /* Usiamo la variabile colore */
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

table tr:nth-child(even) {
    background-color: var(--background-alt); /* Usiamo il colore alternativo */
}

table tr:hover {
    background-color: #e5e7eb; /* Colore hover più chiaro */
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
    justify-items: center;
    align-items: start;
}

.team-member {
    background-color: var(--background); /* Usiamo il colore di background */
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Ombra più leggera */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 350px;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* Ombra più leggera */
}

.team-member .profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--primary); /* Usiamo la variabile colore */
    box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.3); /* Ombra più leggera */
}

.team-member h3 {
    color: var(--primary); /* Usiamo la variabile colore */
    font-size: 1.6em;
    margin-bottom: 5px;
}

.team-member p {
    font-size: 0.95em;
    color: var(--text-light); /* Usiamo il colore testo chiaro */
    margin-bottom: 5px;
}

.team-member .role-description {
    font-size: 0.85em;
    color: var(--text-light); /* Usiamo il colore testo chiaro */
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.team-member .profile-pic.placeholder {
    background-color: #e5e7eb; /* Colore placeholder più chiaro */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: var(--primary); /* Usiamo la variabile colore */
    border: 4px dashed var(--primary); /* Usiamo la variabile colore */
    box-shadow: none;
}

.team-member .profile-pic.placeholder i {
    opacity: 0.7;
}

.team-member .status.open {
    color: var(--secondary); /* Usiamo la variabile colore */
    font-weight: bold;
}

.team-member .status.open a {
    color: var(--secondary);
    text-decoration: none;
}

.team-member .status.open a:hover {
    text-decoration: underline;
}

/* Specific grid for the second row of team members */
.team-grid > div:nth-child(3),
.team-grid > div:nth-child(4),
.team-grid > div:nth-child(5) {
    grid-column: span 1;
}

/* Adjusting grid for the 3-column layout for the last three members */
@media (min-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .team-grid > div:nth-child(3) {
        grid-column: 1 / 2;
    }
    .team-grid > div:nth-child(4) {
        grid-column: 2 / 3;
    }
    .team-grid > div:nth-child(5) {
        grid-column: 1 / 3;
        max-width: 350px;
    }
}

@media (min-width: 1024px) {
    .team-grid > div:nth-child(3) {
        grid-column: 1 / 2;
    }
    .team-grid > div:nth-child(4) {
        grid-column: 2 / 3;
    }
    .team-grid > div:nth-child(5) {
        grid-column: 1 / 3;
    }
}

/* Stili per le nuove sezioni */
#mission-vision,
#current-status {
    background-color: var(--background-alt); /* Usiamo il colore alternativo */
    border-radius: 10px;
    padding: 2rem; /* Aumentato il padding */
    margin-top: 2rem; /* Aumentato il margine */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Ombra più leggera */
}

#mission-vision h2,
#current-status h2 {
    color: var(--secondary); /* Usiamo la variabile colore */
    margin-bottom: 20px;
}

#mission-vision p,
#current-status p {
    font-size: 1.125rem; /* Usiamo la nuova gerarchia tipografica */
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: left;
}

/* Stili per la sezione FAQ */
#faq {
    background-color: var(--background-alt); /* Usiamo il colore alternativo */
    border-radius: 10px;
    padding: 2rem; /* Aumentato il padding */
    margin-top: 2rem; /* Aumentato il margine */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Ombra più leggera */
}

#faq h2 {
    color: var(--primary); /* Usiamo la variabile colore */
    margin-bottom: 30px;
}

.faq-item {
    background-color: var(--background); /* Usiamo il colore di background */
    border-left: 5px solid var(--secondary); /* Usiamo la variabile colore */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Ombra più leggera */
}

.faq-item h3 {
    color: var(--primary); /* Usiamo la variabile colore */
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
}

.faq-item p {
    font-size: 1.125rem; /* Usiamo la nuova gerarchia tipografica */
    line-height: 1.7;
    color: #4B5563;
}

/* Stili per il background professionale del Project Owner */
.team-member p:nth-of-type(2) {
    font-size: 0.9em;
    color: var(--text-light); /* Usiamo il colore testo chiaro */
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.5;
    background-color: transparent; /* Rimosso background */
    padding: 0; /* Rimosso padding */
    border-radius: 0; /* Rimosso border-radius */
}


/* Footer */
.olms-footer {
    background-color: var(--background-alt); /* Usiamo il colore alternativo */
    color: var(--text-light); /* Usiamo il colore testo chiaro */
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9em;
    border-top: 1px solid #e5e7eb; /* Bordo più chiaro */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.olms-footer .legal-info a {
    color: var(--primary); /* Usiamo la variabile colore */
    text-decoration: none;
    margin: 0 5px;
}

.olms-footer .legal-info a:hover {
    text-decoration: underline;
}

.olms-footer .contact-info a {
    color: var(--primary); /* Usiamo la variabile colore */
    text-decoration: none;
}

.olms-footer .contact-info a:hover {
    text-decoration: underline;
}

/* Stili per la modale */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Sfondo più leggero */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: var(--background); /* Usiamo il colore di background */
    color: var(--text-dark); /* Usiamo il colore testo scuro */
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Ombra più leggera */
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--primary); /* Usiamo la variabile colore */
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.modal-content p strong {
    color: var(--primary); /* Usiamo la variabile colore */
}

.modal-content a {
    color: var(--secondary); /* Usiamo la variabile colore */
    text-decoration: none;
}

.modal-content a:hover {
    text-decoration: underline;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-light); /* Usiamo il colore testo chiaro */
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--text-dark); /* Colore hover più scuro */
}

/* Responsive per la modale */
@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 1.5em;
    }
}

/* Animazioni Subtle */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  section { padding: 3rem 1.5rem; }
  .hero { min-height: 60vh; }

  .hero-content-overlay {
    margin: 0 auto; /* Centra il blocco orizzontalmente */
  }

  .hero-content-overlay {
    width: 100%; /* Occupa tutta la larghezza disponibile */
    box-sizing: border-box; /* Include padding nella larghezza */
    padding-left: 20px; /* Aggiunge padding laterale per il respiro */
    padding-right: 20px; /* Aggiunge padding laterale per il respiro */
  }

  .hero-content-overlay .hero-title,
  .hero-subtitle {
    text-align: center;
  }
}
