:root {
  --primary-color: #2c3e50;
  --accent-color: #3498db;
  --light-bg: #f8f9fa;
  --dark-bg: #1a1a1a;
  --text-light: #f8f9fa;
  --text-dark: #333;
  --low-cluster: #FFC0CB;    /* Pink */
  --medium-cluster: #90EE90; /* Green */
  --high-cluster: #FFFFE0;   /* Yellow */
}

* {
  margin: auto;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-dark);
  scroll-behavior: smooth;
  background-color: var(--light-bg);
}

/* --- HEADER --- */
header {
  position: relative;
  height: 100vh;
  background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('/assets/progetti/time_milan/social_mixing.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--text-light);
  padding: 0 20px;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  z-index: 1000;
  transition: background-color 0.3s;
}

nav.scrolled {
  background-color: rgba(44, 62, 80, 0.95);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}


.nav-links a:hover {
  color: var(--accent-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
}

.header-content {
  max-width: 960px;
  width: 100%;
}

.header-content h1 {
  font-weight: 700;
  font-size: 7vh;
  margin-bottom: 20px;
  max-width: 960px;
  width: 100%;
}

.header-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  max-width: 700px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: white;
  min-width: 100px;
  min-height: 40px;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s;
  border: 2px solid var(--accent-color);
  cursor: pointer;
}

.btn:hover {
  background-color: transparent;
  color: white;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid white;
  margin-left: 15px;
}

.btn-outline:hover {
  background-color: white;
  color: var(--primary-color);
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  color: var(--text-light);
  font-size: 1.5rem;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

/* --- SECTIONS --- */
section {
  padding: 100px 20px;
}

.section-title {
  text-align: center;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.section-title h2 {
  font-weight: 700;
  font-size: 6.5vh;
  color: var(--primary-color);
  margin-bottom: 15px;
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.section-title h3 {
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.section-title p {
  color: #777;
  max-width: 700px;
  margin: 0 auto;
}

/* --- ABOUT --- */
#about .section-title p {
  max-width: 500px;
  margin: 0 auto;
}

.about-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.about-text {
  flex: 1;
  text-align: justify;
}

.highlight-box {
  background-color: rgba(52, 152, 219, 0.1);
  border-left: 4px solid var(--accent-color);
  padding: 20px;
  margin: 25px 0;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  text-align: justify-all;
}

.highlight-box p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.highlight-box strong {
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* --- METHODOLOGY --- */
#method {
  background-color: var(--light-bg);
}

.methodology-grid {
    padding: 10px 0px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.method-card {
  text-align: center;
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  min-height: 220px;
  min-width: 150px;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.method-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.method-card i {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 20px;
}

.method-card h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

/* --- TEMPORAL PATTERNS --- */
.time-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 5px;
  justify-content: center;
  width: 100%;
}

.time-tab {
  min-width: 30%;
  padding: 10px;
  cursor: pointer;
  height: 100px;
  background: var(--light-bg);
  border: 2px solid var(--primary-color);
  border-radius: 20px;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}

.time-tab:hover {
  background: var(--accent-color);
  color: var(--text-light);
  transform: scale(1.05);
}

.time-tab.active {
  background: var(--accent-color);
  color: var(--text-light);
  border-color: var(--accent-color);
}

.visualization {
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.viz-content {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.viz-image {
  flex: 1 1 100%;
  margin-bottom: 20px;
  text-align: center;
}

.viz-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.viz-text {
  flex: 1 1 55%;
  text-align: left;
}

.viz-text h3 {
  margin: auto;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.viz-text ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.viz-text li {
  margin-bottom: 0.5rem;
}

.time-content {
  display: none;
}

.time-content.active {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- INTERACTIVE MAP & INFO PANEL --- */
#visualization {
  padding: 10px;
  background-color: var(--light-bg);
}

#visualization h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  width: 100%;
  max-width: 960px;
  text-align: center;
}

.map-wrapper {
  position: relative;
  border-radius: 10px;
  height: 70vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.map-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.info-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 10;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s;
}

.info-toggle:hover {
  background-color: var(--accent-color);
}

.info-panel {
  display: none;
  position: absolute;
  top: 20px;
  height: 95%;
  width: 95%;
  background-color: white;
  border-radius: 10px;
  margin: auto;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  z-index: 10;
  overflow-y: auto;
}

.info-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
}

.info-content {
  padding: 10px;
}

.info-content h4 {
  margin: 0 0 10px;
  color: var(--primary-color);
}

.info-content p {
  margin: 0 0 15px;
  font-size: 0.9rem;
}

.info-content ul {
  margin-left: 20px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  list-style-type: disc;
}

/* --- CONTROL BUTTONS (Info & Help) --- */
.control-buttons {
  position: fixed;
  top: 2px;
  right: 2px;
  z-index: 1500;
  display: flex;
  gap: 10px;
}

.control-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.control-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
}

.control-button i {
  font-size: 1.2rem;
}

/* --- INTRO MODAL --- */
.intro-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.9);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.map-container {
  width: 97%;
  max-width: 960px;
  margin: 0 auto 30px;
}

.intro-modal.open {
  display: flex;
}

.intro-content {
  background-color: white;
  border-radius: 10px;
  max-width: 95%;
  width: 600px;
  max-height: 80%;
  overflow-y: auto;
  position: relative;
  padding: 20px;
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.intro-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
  z-index: 10;
}

.intro-slide {
  margin-bottom: 30px;
}

.intro-slide h2 {
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.intro-slide p {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.intro-triade {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.intro-triade img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.intro-footer {
  text-align: center;
  margin-top: 15px;
}

.intro-footer .intro-btn {
  padding: 10px 25px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
}

.intro-footer .intro-btn:hover {
  background-color: var(--accent-color);
}

/* --- TOP NAVIGATION --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(44, 62, 80, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hamburger {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

#current-view-title {
  color: white;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

/* --- FOOTER --- */
footer {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 40px 20px;
  text-align: center;
}

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

footer p {
  margin-bottom: 10px;
}

.narrow-content {
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.viz-content.narrow-content {
  max-width: 960px;
  width: 100%;
}

.additional-info.narrow-content {
  max-width: 960px;
  width: 100%;
  margin: 20px auto 40px;
  text-align: center;
  padding: 15px;
  background-color: rgba(52, 152, 219, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
}

.additional-info.narrow-content p {
  margin: 0;
  font-size: 0.95rem;
}

.additional-info.narrow-content a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.additional-info.narrow-content a:hover {
  text-decoration: underline;
}

.map-notice.narrow-content {
  max-width: 960px;
  width: 100%;
  text-align: center;
  margin: 30px auto;
  padding: 10px 15px;
  background-color: rgba(52, 152, 219, 0.08);
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.citation {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-style: italic;
  font-size: 0.9rem;
}

.footer-links {
  margin-top: 20px;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0 10px;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent-color);
}

/* Styling for the findings box */
.findings-box {
  background-color: rgba(52, 152, 219, 0.08);
  border-left: 4px solid var(--accent-color);
  border-radius: 6px;
  padding: 25px;
  margin: 30px 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.findings-box h4 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 18px;
}

.findings-box .key-findings {
  padding-left: 20px;
  margin-bottom: 0;
}

.findings-box .key-findings li {
  margin-bottom: 12px;
  position: relative;
  list-style-type: none;
  padding-left: 28px;
}

.findings-box .key-findings li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

.findings-box .key-findings li:last-child {
  margin-bottom: 0;
}

.findings-box .key-findings li strong {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-color);
}

/* About Research Section with header-style background */
#additional-info {
  position: relative;
  background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('/assets/progetti/time_milan/social_mixing.jpg');
  background-size: cover;
  background-position: center;
  padding: 60px 0;
  color: white;
}

#additional-info .section-title h2 {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 6.5vh;
  max-width: 960px;
  width: 100%;
}

.about-research-content {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.about-research-content h2 {
  color: var(--accent-color);
  font-size: 28px;
  margin-bottom: 15px;
  text-align: left;
  padding-left: 0;
  max-width: 960px;
  width: 100%;
}

.about-research-content h3 {
  color: rgba(255, 255, 255, 0.85);
  font-size: 22px;
  margin: 25px 0 15px;
  font-weight: 600;
}

.about-research-content h4 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  margin: 15px 0 10px;
  font-weight: 500;
}

.about-research-content p {
  margin-bottom: 20px;
  line-height: 1.6;
  text-align: justify;
  color: white;
}

.research-details-row {
  display: flex;
  flex-wrap: wrap;
  margin: 30px 0;
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.research-column {
  flex: 1;
  padding: 0 15px;
  min-width: 280px;
}

.publications-list, 
.data-sources-list, 
.team-list {
  padding-left: 20px;
  margin-bottom: 25px;
  color: white;
}

.publications-list li, 
.data-sources-list li, 
.team-list li {
  margin-bottom: 12px;
  line-height: 1.5;
  color: white;
}

.publications-list li {
  padding-bottom: 10px;
}


.team-list li a, 
.team-list li a:link,
.team-list li a:visited {
  color: var(--accent-color); /* Using the main accent color variable #3498db */
  text-decoration: none;
  transition: color 0.3s;
}

.team-list li a:hover {
  text-decoration: underline;
  opacity: 0.8;
}


.publications-list a,
.contact-info a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s;
}

.publications-list a:hover,
.contact-info a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.contact-info {
  margin: 15px 0;
  font-size: 16px;
  color: white;
}

.partner-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  gap: 30px;
}

.partner-logo {
  height: 45px; /* Match the height from covid page */
  max-width: 180px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s;
  filter: brightness(0) invert(1); /* Makes logos white */
}

.partner-logo:hover {
  opacity: 1;
}

/* Mobile responsiveness */
@media only screen and (max-width: 768px) {
  .research-column {
    flex: 100%;
    margin-bottom: 30px;
  }
  
  .partner-logo {
    height: 40px;
    max-width: 140px;
    margin: 10px;
  }
  
  .about-research-content h2 {
    font-size: 24px;
  }
  
  .about-research-content h3 {
    font-size: 20px;
  }
  
  .publications-list li, 
  .data-sources-list li, 
  .team-list li {
    font-size: 14px;
  }
  
  #additional-info .section-title h2 {
    font-size: 5vh;
  }
}

info_partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: 960px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 10px 0;
}

info_partners img {
  position: relative;
  max-height: 45px;
  margin: 5px;
  object-fit: contain;
 /*  filter: brightness(0) invert(1); Makes logos white */
}


/* Fix for email link color */
#contactid, 
#contactid:link,
#contactid:visited {
  color: var(--accent-color); /* Using the main accent color variable #3498db */
  text-decoration: none;
  transition: color 0.3s;
}

#contactid:hover {
  text-decoration: underline;
  opacity: 0.8;
}

