:root {
  /* Palette di colori sobria */
  --primary: #4a9fee;
  --primary-light: #6db5f8;
  --primary-dark: #2c6ca0;
  --accent: #f0f0f0;
  --text-light: #ffffff;
  --text-dark: #333333;
  --bg-light: rgba(255, 255, 255, 0.9);
  --bg-dark: rgba(44, 62, 80, 0.85);
  --border-light: rgba(255, 255, 255, 0.2);
  
  /* Dimensioni e spaziature */
  --border-radius-lg: 20px;
  --border-radius-md: 15px;
  --border-radius-sm: 10px;
  --spacing-xl: 40px;
  --spacing-lg: 30px;
  --spacing-md: 20px;
  --spacing-sm: 10px;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 30px 0;
  background-color: var(--text-dark);
}

.back-vid {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  filter: brightness(0.6);
}

@media (max-aspect-ratio: 16/9) {
  .back-vid {
    width: auto;
    height: 100%;
  }
}

@media (min-aspect-ratio: 16/9) {
  .back-vid {
    width: 100%;
    height: auto;
  }
}

.main-section {
  width: 90%;
  height: 90%;
  background-color: var(--bg-dark);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  overflow: hidden; /* Rimossa la barra di scorrimento */
  border: 1px solid var(--border-light);
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Barra di navigazione */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  flex-wrap: wrap;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav h1 {
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 30px;
  font-weight: 700;
  position: relative;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

nav li {
  position: relative;
  margin: 0 5px;
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 10px 20px;
  border-radius: 30px;
  display: inline-block;
  position: relative;
  z-index: 1;
  letter-spacing: 0.5px;
}

nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 30px;
  z-index: -1;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

nav a:hover::before,
.attivo::before {
  opacity: 1;
  transform: scale(1);
}

nav a:hover,
.attivo {
  color: var(--text-light);
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

nav a i {
  margin-right: 8px;
  font-size: 14px;
}

.hero {
  color: white;
  width: 90%;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar styling */
.hero::-webkit-scrollbar {
  width: 6px;
}

.hero::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.hero::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 10px;
}

.projects-title {
  font-size: 2.2em;
  margin-bottom: 10px;
  color: var(--primary);
  position: relative;
  display: inline-block;
  font-weight: 700;
  text-align: center;
  width: 100%;
}

.projects-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 25%;
  width: 50%;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.projects-subtitle {
  font-size: 1.1em;
  margin-bottom: 25px;
  text-align: center;
  color: var(--text-light);
  opacity: 0.9;
}

.projects-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 1px solid transparent;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(74, 159, 238, 0.3);
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  width: 100%;
  padding: 10px 0;
}

.project-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 20px;
  width: calc(33.33% - 20px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-light);
}

.project-image {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.project-item h3 {
  color: var(--primary-light);
  margin-bottom: 10px;
  font-size: 1.3em;
}

.project-item p {
  color: var(--text-light);
  opacity: 0.85;
  font-size: 0.9em;
  margin-bottom: 15px;
  line-height: 1.5;
}

.technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.technologies span {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(74, 159, 238, 0.1);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1em;
}

.btn.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn.disabled:hover {
  transform: none;
  background: var(--primary);
}

.projects-cta {
  margin-top: 40px;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  width: 100%;
}

.projects-cta p {
  margin-bottom: 15px;
  font-size: 1.1em;
}

/* Animation classes for project filtering */
.project-item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease, display 0.3s ease;
}

.project-item.show {
  opacity: 1;
  transform: translateY(0);
}

.project-item:not(.show) {
  opacity: 0;
  transform: translateY(20px);
}

/* Responsive design */
@media (max-width: 1200px) {
  .project-item {
    width: calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  .project-item {
    width: 100%;
  }
  
  nav {
    justify-content: center;
    flex-direction: column;
    gap: 10px;
  }
  
  nav ul {
    margin-top: 10px;
  }
  
  .projects-filter {
    margin-top: 10px;
  }
}
