/* Sezione back-to-portfolio */
.back-to-portfolio {
  width: 100%;
  text-align: left;
  padding: 15px 10px;
  background-color: #F2C4D5;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999; /* maggiore di sticky */
  height: 60px; /* altezza fissa */
  line-height: 60px;
  padding: 0 20px;
}

.back-to-portfolio a {
  color: #580B59;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.back-to-portfolio a:hover {
  color: #040DBF;
  font-weight: bold;
  text-decoration: none;
}

/* Fix preciso per evitare sovrapposizione */
#curriculum-container {
  margin-top: 0; 
  padding-top: 60px; 
  background-color: white;
}

/* Generale */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    margin: 0;                
    padding-top: 80px;        
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

.cv-container {
    width: 210mm;
    height: 297mm;
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    height: auto; 
    max-height: none;
}

.top-fixed-section {
    background-color: #ffffff;
    padding: 20px 30px 0px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #dcdcdc;
    position: sticky;
    top: 60px; /* spazio per la barra fissa sopra */
    z-index: 200;
    width: 100%;
    flex-shrink: 0;
}

.header-main-content {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 10px;
    width: 100%;
    margin-left: 74px;
}

/* Contenitore della foto */
.profile-pic-container {
    margin-right: 20px; 
    flex-shrink: 0; 
}

/* Immagine del profilo */
.profile-pic {
    width: 150px;
    height: 150px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Header con nome e titolo */
.header-fixed {
    text-align: left; 
    margin-left: 30px;
}

.header-fixed h1 {
    font-size: 1.8em;
    color: #a78b5a;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: 500;
    font-family: 'Artifika', serif;
}

.header-fixed p {
    font-size: 1em;
    color: #555;
    margin-top: 0;
    margin-bottom: 0;
    font-family: 'Artifika', serif;
}

/* Linea di separazione  */
.header-line-fixed {
    border: none;
    margin-top: 10px; 
    width: 100%;
    margin-bottom: 0;
}

/* Contenitore delle due colonne scorrevoli */
.scrollable-content-wrapper {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    box-sizing: border-box;
    align-items: stretch;
    overflow-y: visible; 
    max-height: none;
}

/* Colonne */
.left-column, .right-column {
    padding-bottom: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    /* Rimuovo overflow per far scorrere il wrapper */
    overflow-y: visible;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Nascondo scrollbar sui contenitori figli */
.left-column::-webkit-scrollbar,
.right-column::-webkit-scrollbar {
    display: none;
}

.left-column {
    width: 32%;
    background-color: #f7f7f7;
    padding: 30px 20px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: auto; 
}

.right-column {
    width: 68%;
    padding: 30px 30px 30px 15px;
    box-sizing: border-box;
}

/* Headings e Titoli delle Sezioni */
h1 {
    font-size: 2.2em;
    color: #a78b5a;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 500;
}

h2 {
    font-size: 1.2em;
    color: #a78b5a;
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 1px solid #dcdcdc;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-weight: 500;
}

.left-column h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 15px;
}
.left-column h2::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background-color: #a78b5a;
    margin-top: 5px;
}

h3 {
    font-size: 1.05em;
    color: #333;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 500;
}

h4 {
    font-size: 0.95em;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: 900;
}

/* Sezioni e Contenuto */
.section {
    margin-bottom: 25px;
}

.left-column .section {
    margin-bottom: 180px;
}

.left-column .section:last-of-type {
    margin-bottom: 0;
}

.section p, .section li {
    font-size: 0.9em;
    color: #444;
    line-height: 1.5;
    margin-bottom: 5px;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul li {
    margin-bottom: 5px;
    padding-left: 0;
}

.item ul,
.right-column .section ul {
    list-style: disc;
    margin-left: 20px;
}

.item ul li,
.right-column .section ul li {
    padding-left: 0;
}

/* Contatti */
.section.contacts p {
    font-size: 0.9em;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.4;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.contact-icon, .icon-indent {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #a78b5a;
    flex-shrink: 0;
}

/* Data (Esperienze/Istruzione) */
.item {
    margin-bottom: 20px;
}

.item h3 {
    margin-top: 0;
    margin-bottom: 3px;
    color: #333;
}

.item p.date {
    font-size: 0.85em;
    color: #777;
    margin-top: 0;
    margin-bottom: 5px;
    font-weight: 500;
}

.item p.date-right {
    font-size: 0.85em;
    color: #777;
    margin-top: 0;
    margin-bottom: 5px;
    font-weight: 500;
}

.item p.date-right {
    float: right;
    margin-left: 15px;
}

.item h3 {
    display: inline-block;
}

.item ul {
    clear: both;
    margin-top: 10px;
}

.item p:not(.date):not(.date-right) {
    margin-top: 0;
    margin-bottom: 10px;
}

/* Links */
a {
    color: #a78b5a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Barre di Progresso Linguistiche */
.language {
    margin-bottom: 15px;
}

.language h3 {
    margin-bottom: 5px;
    font-size: 1em;
    color: #555;
}

.language p {
    margin-top: 0;
    margin-bottom: 3px;
    font-size: 0.85em;
    color: #666;
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #d8931c;
    border-radius: 4px;
}

/* Livelli di progresso specifici */
.progress-bar.mother-tongue {
    width: 100%;
}

.progress-bar.written-excellent {
    width: 95%;
}

.progress-bar.comprehension-good {
    width: 80%;
}

/* QR Code */
.qr-code-container {
    text-align: center;
    margin-top: 55px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.qr-code-container a {
    flex-shrink: 0;
}

.qr-code {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0;
}

.qr-text-non-clickable {
    font-size: 0.8em;
    color: #555;
    margin: 0;
    line-height: 1.2;
    max-width: 80px;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: normal;
}

/* Footer (Autorizzazione al trattamento dati) */
.footer {
    font-size: 0.70em;
    color: #777;
    margin-top: 70px;
    padding-top: 15px;
    text-align: center;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Stili per il nuovo link di download testuale - MODIFICATO PER ALLINEAMENTO A DESTRA */
.download-text-link {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    width: 100%; 
    color: #a78b5a;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    margin-top: 10px; 
    margin-bottom: 10px; 
    transition: color 0.3s ease;
}

.download-text-link:hover {
    color: #8a704a;
    text-decoration: underline;
}

.download-text-link i {
    margin-right: 5px;
}

@media (max-width: 750px) {
  body {
    padding: 10px;
  }

  .cv-container {
    width: 100%;
    height: auto; 
    box-shadow: none;
    padding: 10px 15px;
  }

  .top-fixed-section {
    position: relative; 
    padding: 15px 20px 10px 20px;
    border-bottom: 1px solid #dcdcdc;
  }

  .header-main-content {
    margin-left: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-pic-container {
    margin: 0 0 15px 0;
  }

  .header-fixed {
    margin-left: 0;
  }

  .scrollable-content-wrapper {
    flex-direction: column;
    overflow: visible; 
  }

  .left-column, .right-column {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    padding: 20px 15px;
  }

  .left-column {
    border-right: none;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    margin-top: 50px;
    background-color: #fafafa; 
  }

  .right-column {
    padding-top: 10px;
  }

  h1 {
    font-size: 1.6em;
  }
  
  h2 {
    font-size: 1.1em;
  }
  
  h3 {
    font-size: 1em;
  }
}

#scrollToTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none; /* nascosto di default */
  background-color: #a78b5a;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
}

/* Mostro il bottone solo su schermi piccoli!! */
@media (max-width: 900px) {
  #scrollToTopBtn {
    display: block;
  }
}

#scrollToTopBtn:hover {
  background-color: #8a704a;
}
