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

.gallery {
  padding: clamp(7px, 1.5vw, 15px) 0;
  position: relative;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: clamp(2px, 1vw, 4px);
}

.gallery-item {
  flex: 0 0 auto;
  width: clamp(150px, 30vw, 200px);
  margin: clamp(3px, 1vw, 8px);
  border-radius: clamp(4px, 0.8vw, 12px);
  overflow: hidden;
  box-shadow: 0 clamp(2px, 0.4vw, 6px) clamp(3px, 0.6vw, 9px) rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  position: relative;
}

.gallery-item:hover {
  box-shadow: 0 clamp(4px, 0.8vw, 12px) clamp(6px, 1.2vw, 18px) rgba(0, 0, 0, 0.15);
}

.gallery-item:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(clamp(10px, 2vw, 30px));
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover:before {
  opacity: 1;
}

.gallery-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: clamp(4px, 0.8vw, 12px);
  transition: transform 0.5s ease;
  position: relative;
  z-index: 2;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Global styles */
body {
  font-family: "Albert Sans", sans-serif;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

body[theme="dark"] {
  background: #000;
  color: #707070;
}

.light-theme {
  background-color: #ffffff;
  color: #505050;
}

.dark-theme {
  background-color: #1E201E;
  color: #a1a29b;
}

.container {
  max-width: clamp(400px, 70vw, 560px);
  margin: 0 auto;
  padding: clamp(0.5rem, 1.5vw, 1rem);
  text-align: left;
  position: relative;
  z-index: 1;
}

/* Navbar styles */
.header {
  padding: clamp(0.5rem, 1vw, 1.5rem) 0;
  position: relative;
  z-index: 2;
}

.navbar {
  display: flex;
  padding: clamp(10px, 1vw, 20px) 0;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand,
.navbar-nav,
.theme-toggle {
  display: flex;
  align-items: center;
}

.navbar-brand {
  font-size: clamp(0.9rem, 1.1vw, 1.3rem);
  font-weight: 600px;
  position: left;
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.navbar-brand:hover {
  color: #666;
}

.navbar-nav {
  list-style-type: none;
}

.nav-item {
  margin: 0 clamp(0.5rem, 0.75vw, 1rem);
}

.nav-item:last-child {
  margin-right: 0;
}

.nav-link {
  text-decoration: none;
  font-weight: 500;
  color: inherit;
  font-size: clamp(0.8rem, 1.1vw, 1.2rem);
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: #ddd;
}

/* .nav-link:visited {
  color: inherit;
} */

.theme-toggle {
  background-color: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  height: 100%;
  transition: color 0.3s ease;
}

.theme-toggle:hover {
  color: #666;
}

.theme-icon {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-icon.visible {
  opacity: 1;
}

.light-theme .theme-icon:first-child,
.dark-theme .theme-icon:last-child {
  opacity: 1;
}

/* Main content styles */
.about,
.projects,
.skills,
.contact {
  /* margin-top: clamp(1rem, 1.3vw, 1.5rem); */
  margin-bottom: clamp(1.1rem, 1.4vw, 1.6rem);
  position: relative;
}

.experience {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.experience-item {
  flex: 1 1 50%;
  padding-right: clamp(1rem, 2vw, 3rem);
  margin-bottom: clamp(1.5rem, 2vw, 2.5rem);
}

a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: #666;
}

/* a:visited {
  color: inherit;
} */

body.dark-theme a {
  color: #697565;
  /* Colore di default per i link nel tema scuro */
}

body.dark-theme a:hover,
body.dark-theme a:focus {
  color: #ddd;
  /* Colore al passaggio del mouse e focus nel tema scuro */
}

/* body.dark-theme a:visited {
  color: inherit;
  /* Mantiene il colore visitato */
/* } */

h2 {
  font-size: clamp(1.4rem, 1.7vw, 2rem);
  font-weight: 600;
  color: black;
  font-family: "Albert Sans";
  margin-top: clamp(0.8rem, 1vw, 1.1rem);
  margin-bottom: clamp(0.7rem, 1vw, 1rem);
  transition: color 0.3s ease;
}

/* Stile per il tema scuro */
body.dark-theme h2 {
  color: #e8e6e3;
}

/* Stile generale per h3 (light theme di default) */
h3 {
  color: #333;
  /* Colore di default per il tema chiaro */
}

/* Stile per h3 nel tema dark */
body.dark-theme h3 {
  color: #c8c3bc;
  /* Colore per il tema scuro */
}

.Company-Name {
  font-size: clamp(1.1rem, 1.3vw, 1.5rem);
  font-weight: 600;
  color: #333;
  font-family: "Albert Sans";
  margin-bottom: clamp(0.2rem, 0.3vw, 0.4rem);
  margin-top: clamp(1.5rem, 2vw, 2.5rem);
  transition: color 0.3s ease;
}

.Project-Name {
  font-size: clamp(1.1rem, 1.3vw, 1.5rem);
  font-weight: 600;
  color: #333;
  font-family: "Albert Sans";
  margin-bottom: clamp(0.2rem, 0.3vw, 0.4rem);
  margin-top: clamp(1.5rem, 2vw, 2.5rem);
  transition: color 0.3s ease;
}

.Role,
.books {
  font-size: clamp(0.8rem, 1vw, 1.2rem);
  font-weight: 400;
  padding: clamp(0.01rem, 0.01vw, 0.02rem);
  color: #3d3d3d;
  font-family: "Albert Sans";
  transition: color 0.3s ease;
}

/* Tema scuro basato sulla classe aggiunta al body */
body.dark-theme .Role,
body.dark-theme .books {
  color: #a1a29b;
  /* Colore per il tema scuro */
}

p {
  font-size: clamp(0.8rem, 1vw, 1.2rem);
  line-height: 1.6;
  padding: clamp(5px, 0.7vw, 10px) 0;
  opacity: 0;
  animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

ul {
  list-style-type: none;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
}

/* Stile generale per ul li (tema light di default) */
ul li {
  margin-bottom: clamp(0.5rem, 0.75vw, 1rem);
  transition: color 0.3s ease;
  color: #333;
  /* Colore di default per il tema light */
}

/* Stile generale per li (sia per ul che ol) nel tema light */
li {
  color: #333;
  /* Colore di default per li in generale (light) */
}

/* Stile per li nel tema dark */
body.dark-theme li {
  color: #c1bcb4;
  /* Colore per li in generale nel tema dark */
}

.skills-table {
  display: table;
  width: 100%;
  margin-top: 20px;
}

.skills-row {
  display: table-row;
  margin-bottom: 20px;
}

.skills-column {
  display: table-cell;
  vertical-align: middle;
  padding: 10px;
}

.tech-name {
  width: 20%;
  font-weight: bold;
}

.tech-icons {
  width: 80%;
  display: flex;
  flex-wrap: wrap;
}

.skills-logo {
  height: 40px;
  margin-right: 10px;
  margin-bottom: 10px;
  filter: grayscale(100%);
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.skills-logo:hover {
  filter: grayscale(0%);
  opacity: 0.8;
}

/* Stile generale per il footer (tema light di default) */
.footer {
  background-color: #ffffff;
  /* Sfondo chiaro per il tema light */
  color: #333;
  /* Colore del testo per il tema light */
  padding: clamp(0.5rem, 1vw, 1.5rem) 0;
  text-align: center;
  font-size: clamp(0rem, 0.1vw, 0.2rem);
  position: relative;
  z-index: 2;
  transition: color 0.3s ease, background-color 0.3s ease;
  /* Aggiunta transizione per background */
}

/* Hover per il footer nel tema light */
.footer:hover {
  color: #666;
}

/* Stile per il footer nel tema dark */
body.dark-theme .footer {
  background-color: #1E201E;
  /* Sfondo scuro per il tema dark */
  color: #c8c3bc;
  /* Colore del testo per il tema dark */
}

/* Hover per il footer nel tema dark */
body.dark-theme .footer:hover {
  color: #ddd;
}

.mail {
  font-family: monospace;
  backdrop-filter: opacity(2);
}

.social-link {
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease;
}

.social-link:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #666;
  transition: width 0.3s ease;
}

.social-link:hover,
.social-link:focus {
  color: #666;
}

.social-link:hover:before {
  width: 100%;
}

.image-collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: clamp(10px, 1vw, 20px);
  margin-bottom: clamp(10px, 1.5vw, 25px);
}

.collage-item {
  width: 100%;
  height: auto;
  border-radius: clamp(4px, 0.8vw, 12px);
  box-shadow: 0 clamp(2px, 0.4vw, 6px) clamp(3px, 0.6vw, 9px) rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collage-item:hover {
  transform: translateY(clamp(-3px, -0.5vw, -7px));
  box-shadow: 0 clamp(4px, 0.8vw, 12px) clamp(6px, 1.2vw, 18px) rgba(0, 0, 0, 0.15);
}

@keyframes smooth-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.smooth-blinking-text {
  animation: smooth-blink 2s infinite ease-in-out;
}

@media (max-width: 768px) {
  .skills-logo {
    height: clamp(35px, 4.1vw, 65px);
    margin: 0 clamp(0.4rem, 0.7vw, 0.8rem);
    margin-bottom: clamp(0.5rem, 0.7vw, 0.9rem);
  }
}

.highlight {
  background-color: #2e2e2e;
  padding: 10px;
  border-radius: 5px;
  margin-top: 20px;
  color: #fff;
}