/* ============================================ */
/* VARIABILI CSS GLOBALI */
/* ============================================ */
:root {
  --bg: #ffffff;
  --text: #111111;
  --accent: #ff0a78;
  --accent-dark: #d60063;
  --light: #f7f7f7;
  --border: #eaeaea;
  --header-height: 70px; /* Altezza fissa della navbar - usata per il padding-top del body */
}

/* ============================================ */
/* RESET & STILI DI BASE */
/* ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: var(--header-height); /* Spazio superiore per evitare che il contenuto sia coperto dalla navbar fissa */
}

body.menu-open {
  overflow: hidden; /* Impedisce lo scroll quando il menu mobile è aperto */
}

img {
  width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: min(1100px, 90%);
  margin: 0 auto;
}

/* ============================================ */
/* HEADER - NAVBAR FISSA IN ALTO */
/* ============================================ */
.header {
  position: fixed;     /* Fissa la navbar in alto */
  top: 0;              /* Allineata al bordo superiore */
  left: 0;             /* Allineata al bordo sinistro */
  width: 100%;         /* Occupa tutta la larghezza */
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  z-index: 1000;       /* Si assicura che sia sopra tutti gli altri elementi */
  backdrop-filter: blur(10px); /* Effetto sfocato trasparente */
  transition: background 0.3s ease, box-shadow 0.3s ease; /* Transizione per l'effetto scroll */
}

/* Effetto quando si scorre la pagina - navbar più compatta e ombra */
.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
  position: relative;
  min-height: var(--header-height);
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  z-index: 1001;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ============================================ */
/* PULSANTE MENU MOBILE */
/* ============================================ */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: 0.8s ease;
  color: var(--text);
  z-index: 1001;
}

.mobile-menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* ============================================ */
/* NAVIGAZIONE DESKTOP */
/* ============================================ */
.nav nav {
  display: flex;
  gap: 1.2rem;
}

.nav nav a {
  font-weight: 600;
  transition: color 0.3s ease;
  white-space: nowrap;
}

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

/* ============================================ */
/* LANGUAGE SWITCHER - Change lingua */
/* ============================================ */
.language-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  z-index: 1001;
}

.lang-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover {
  transform: scale(1.1);
}

.lang-btn.active {
  border-color: var(--accent);
  background: rgba(255, 10, 120, 0.1);
}

.lang-btn img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

/* Visibilità dei testi in base alla lingua selezionata */
[data-lang="it"] .lang-it,
[data-lang="en"] .lang-en {
  display: block;
}

[data-lang="it"] .lang-en,
[data-lang="en"] .lang-it {
  display: none;
}

/* ============================================ */
/* HERO SECTION */
/* ============================================ */
.hero {
  min-height: calc(100vh - var(--header-height)); /* Altezza viewport meno l'altezza della navbar */
  display: flex;
  align-items: center;
  padding: 4rem 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.hero-image img {
  border-radius: 20px;
  aspect-ratio: 4 / 4;
  object-fit: cover;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================ */
/* BOTTONI */
/* ============================================ */
.btn {
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.3s ease;
  display: inline-block;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 2px solid var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Bottoni CV */
.cv-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn-cv {
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  transition: all 0.3s ease;
}

.btn-cv:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn-cv img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* ============================================ */
/* SEZIONI GENERALI */
/* ============================================ */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--light);
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.section h2:after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================ */
/* ABOUT - Griglia informazioni */
/* ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Griglia lingue - due colonne */
.languages-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 5rem;
  margin-top: 0.5rem;
}

.language-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border);
}

.lang-label {
  font-weight: 600;
  color: var(--text);
}

.lang-level {
  color: var(--accent);
  font-weight: 500;
}

.about-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.about-card h3 {
  margin-bottom: 1rem;
  color: var(--accent);
}

.about-card p {
  margin-bottom: 0.6rem;
}

.about-card-full {
  grid-column: 1 / -1;
}

/* Esperienze lavorative - due colonne */
.experience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 1rem;
}

.country-title {
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.experience-item {
  margin-bottom: 1.5rem;
}

.experience-role {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 4px;
}

.experience-company {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.experience-date {
  color: #888;
  font-size: 0.8rem;
}

/* ============================================ */
/* SKILLS - Competenze tecniche */
/* ============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.skill-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 20px;
  text-align: center;
  font-weight: 700;
  transition: all 0.3s ease;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.skill-card span {
  font-size: 1rem;
  color: var(--text);
  transition: color 0.3s ease;
}

.skill-card img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 0;
  transition: transform 0.3s ease;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateX(5px);
}

.skill-card:hover img {
  transform: scale(1.1);
}

/* ============================================ */
/* PORTFOLIO - Progetti */
/* ============================================ */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-content {
  flex: 1;
  padding: 2rem;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.project-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.project-content p:last-of-type {
  margin-bottom: 1.5rem;
}

.project-image {
  flex: 1;
  padding: 2rem;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.project-image img:hover {
  transform: scale(1.02);
}

.project-link {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white !important;
  padding: 10px 20px !important;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease !important;
}

.project-link:hover {
  background: var(--accent-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 15px rgba(255, 10, 120, 0.3);
}

.project-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.project-link-download {
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-link-download img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  display: inline-block;
}

.project-link-download:hover {
  background: var(--accent-dark);
}

/* ============================================ */
/* CONTATTI */
/* ============================================ */
.contacts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.contacts-list a {
  background: white;
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.contacts-list a img {
  width: 24px;
  height: 24px;
  border-radius: 0;
  transition: filter 0.3s ease;
}

.contacts-list a:hover {
  background: white;
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ============================================ */
/* FOOTER */
/* ============================================ */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
  .container {
    width: min(95%, 90%);
  }
  
  .hero-content {
    gap: 1.5rem;
  }
  
  .hero-image img {
    max-width: 320px;
  }
  
  .project-item {
    gap: 1.5rem;
  }
  
  .project-content {
    padding: 1.5rem;
  }
  
  .project-image {
    padding: 1.5rem;
    min-height: 240px;
  }
}

/* Mobile Landscape (480px - 768px) */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .section h2 {
    font-size: 1.8rem;
  }
  
  /* Menu Mobile - versione meno invasiva */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .header-right {
    gap: 0.8rem;
  }
  
  /* Menu a comparsa da destra */
  .nav nav {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 250px;
    height: auto;
    background: white;
    flex-direction: column;
    gap: 0;
    box-shadow: -2px 5px 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    border-radius: 0 0 0 16px;
    overflow: hidden;
  }
  
  .nav nav.active {
    right: 0;
  }
  
  .nav nav a {
    display: block;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
    text-align: left;
  }
  
  .nav nav a:last-child {
    border-bottom: none;
  }
  
  /* Language switcher su mobile */
  .language-switcher {
    gap: 0.3rem;
  }
  
  /* Hero - mobile */
  .hero {
    min-height: auto;
    padding: 3rem 0;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-text {
    order: 2;
  }
  
  .hero-image {
    order: 1;
  }
  
  .hero p {
    margin-inline: auto;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-image img {
    max-width: 280px;
    border-radius: 16px;
  }
  
  /* About section mobile */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .about-card-full {
    grid-column: auto;
  }
  
  /* Lingue responsive */
  .languages-grid {
    gap: 0.8rem 1.2rem;
  }
  
  .language-item {
    font-size: 0.6rem;
  }
  
  /* Esperienze mobile */
  .experience-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .country-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .experience-item {
    margin-bottom: 1.2rem;
  }
  
  .experience-role {
    font-size: 0.95rem;
  }
  
  .experience-company {
    font-size: 0.85rem;
  }
  
  .experience-date {
    font-size: 0.75rem;
  }
  
  /* Skills mobile */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .skill-card {
    padding: 10px 16px;
  }
  
  /* Progetti mobile */
  .project-item {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  
  .project-content {
    order: 2;
    padding: 1.5rem;
    text-align: left;
  }
  
  .project-image {
    order: 1;
    padding: 1.5rem;
    min-height: auto;
  }
  
  .project-image img {
    max-width: 100%;
  }
  
  .project-content h3 {
    font-size: 1.3rem;
  }
  
  .project-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .project-link {
    text-align: center;
    justify-content: center;
  }
  
  /* Bottoni CV mobile */
  .cv-buttons {
    justify-content: center;
  }
  
  .btn-cv {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }
  
  /* Contatti mobile */
  .contacts-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }
  
  .contacts-list a {
    padding: 0.8rem;
    font-size: 0.85rem;
  }
  
  .contacts-list a img {
    width: 20px;
    height: 20px;
  }
  
  /* Footer mobile */
  .footer {
    padding: 1.5rem 0;
    font-size: 0.85rem;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .container {
    width: 92%;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  .hero-image img {
    max-width: 240px;
  }
  
  .btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }
  
  .section h2 {
    font-size: 1.5rem;
  }
  
  .about-card {
    padding: 1rem;
  }
  
  .about-card h3 {
    font-size: 1.1rem;
  }
  
  .about-card p {
    font-size: 0.85rem;
  }
  
  .skill-card span {
    font-size: 0.85rem;
  }
  
  .skill-card img {
    width: 24px;
    height: 24px;
  }
  
  .project-content {
    padding: 1rem;
  }
  
  .project-content h3 {
    font-size: 1.2rem;
  }
  
  .project-content p {
    font-size: 0.85rem;
  }
  
  .project-link {
    padding: 8px 16px !important;
    font-size: 0.8rem;
  }
  
  .contacts-list {
    grid-template-columns: 1fr;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .lang-btn img {
    width: 20px;
    height: 20px;
  }
  
  .nav nav {
    width: 220px;
  }
}

/* Tablet Portrait specific (768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .hero-image img {
    max-width: 260px;
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contacts-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* iPad Pro e tablet più grandi */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-image img {
    max-width: 340px;
  }
  
  .project-item {
    gap: 1rem;
  }
  
  .project-content {
    padding: 1.5rem;
  }
  
  .project-image {
    padding: 1.5rem;
  }
}
