/* General Styles - Ottimizzato per performance, rimosse ridondanze */
body {
  font-family: "SF Pro Display", Arial, sans-serif;
  color: #1d1d1f;
  margin: 0;
  padding: 0;
  background-color: #fafafa;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d3d3d3 #fafafa;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

header,
header * {
  box-sizing: content-box;
}

body.dark-mode {
  background-color: #000000;
  color: #f5f5f7;
}

/* Logo Styles */
.logo {
  height: 25px;
  width: auto;
}

/* Header Styles */
header {
  background-color: #fafafa;
  padding: 10px 20px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

header.scrolled {
  background-color: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(5px);
}

body.dark-mode header {
  background-color: rgba(0, 0, 0, 0.9);
}

body.dark-mode header.scrolled {
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.header-container {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
}

.logo-link {
  display: inline-block;
  margin-left: 35px;
  flex-shrink: 0;
}

.desktop-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0 20px;
}

.header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 20px;
}

.nav-menu li a {
  text-decoration: none;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 525;
  transition: color 0.3s ease;
}

body.dark-mode .nav-menu li a {
  color: #f5f5f7;
}

.nav-menu li a:hover,
body.dark-mode .nav-menu li a:hover {
  color: #45b6fe;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 30px;
  margin-left: 0;
}

.theme-icon {
  font-size: 17px;
  color: #1d1d1f;
  transition: color 0.3s ease;
}

body.dark-mode .theme-icon {
  color: #f5f5f7;
}

.theme-toggle:hover .theme-icon {
  color: #45b6fe;
  background: linear-gradient(90deg, #45b6fe, #d95bc5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-icon.moon {
  display: none;
}

body.dark-mode .theme-icon.sun {
  display: none;
}

body.dark-mode .theme-icon.moon {
  display: block;
}

.hamburger {
  display: block;
  cursor: pointer;
  margin-right: 15px;
  z-index: 3000;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 3px;
  background-color: #000;
  margin: 6px 0;
  transform-origin: center center;
  transition: transform 0.3s ease;
}

body.dark-mode .hamburger span {
  background-color: #f5f5f7;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(6px);
}

.hamburger.active span:nth-child(2) {
  transform: rotate(-45deg) translateY(-6px);
}

.mobile-menu {
  transform: translateY(-100%);
  transition: transform 1s ease;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: #fafafa;
  z-index: 2000;
  text-align: center;
}

body.dark-mode .mobile-menu {
  background: #000000;
}

.mobile-menu.open {
  transform: translateY(0);
}

.mobile-menu ul li {
  margin-bottom: 40px;
}

.mobile-menu ul li a {
  text-decoration: none;
  color: #1d1d1f;
  font-size: 30px;
  font-weight: 600;
  transition: color 0.3s ease;
}

body.dark-mode .mobile-menu ul li a {
  color: #f5f5f7;
}

.mobile-menu ul li a:hover,
body.dark-mode .mobile-menu ul li a:hover {
  color: #45b6fe;
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mobile-menu .social-icons,
.footer .social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.social-icon {
  display: inline-block;
  font-size: 24px;
  color: #1d1d1f;
  transition: color 0.3s ease;
}

body.dark-mode .social-icon {
  color: #f5f5f7;
}

.social-icon:hover {
  color: #45b6fe;
  background: linear-gradient(90deg, #45b6fe, #d95bc5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-section {
  background: #fafafa;
  text-align: left;
  padding: 40px 20px 40px; /* Aumentato per distanziare */
}

body.dark-mode .hero-section {
  background: #000000;
}

.hero-section h1 {
  margin-left: 50px;
  font-size: 70px;
  max-width: 800px;
}

.hero-section h2 {
  font-size: 36px;
  font-weight: 575;
  margin: 10px 0 10px 50px;
  color: #1d1d1f;
}

body.dark-mode .hero-section h2 {
  color: #f5f5f7;
}

.hero-section p {
  font-size: 18px;
  margin: 0 0 0 50px;
  color: #6e6e73;
}

body.dark-mode .hero-section p {
  color: #a1a1a6;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0;
  background-color: #fafafa;
  margin-top: 0px;
  width: 100%;
}

body.dark-mode .services-grid {
  background-color: #000000;
}

.vertical-layout {
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  height: 500px;
  padding: 20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.service-window-text {
  position: absolute;
  bottom: 20px;
  width: 100%;
  padding: 0 20px;
}

.service-window-text h2 {
  font-weight: 525;
  font-size: 27px;
}

.service-window-text p {
  font-weight: 525;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cta-button-preventivo-button {
  padding: 10px 15px;
  background-color: transparent;
  color: white;
  text-decoration: none;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.022em;
  cursor: pointer;
  border: 1px solid #45b6fe;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button-preventivo-button:hover {
  background-color: #45b6fe;
  color: white;
  border: 1px solid #45b6fe;
}

.portfolio-section {
  background-color: #fafafa;
  padding: 30px 0;
  text-align: left;
  width: 100%;
  margin: 0;
}

body.dark-mode .portfolio-section {
  background-color: #000000;
}

.portfolio-section h2 {
  font-size: 50px;
  margin-bottom: 40px;
  color: #1d1d1f;
  margin-left: 100px;
}

body.dark-mode .portfolio-section h2 {
  color: #f5f5f7;
}

.carousel-container {
  position: relative;
  width: 100%;
  margin: 0;
  background: transparent;
}

.carousel-wrapper {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 20px 0 20px 100px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.portfolio-card {
  position: relative;
  width: 350px;
  height: 450px;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  flex-shrink: 0;
}

body.dark-mode .portfolio-card {
  background-color: #1c1c1e;
}

.portfolio-card:hover {
  transform: scale(1.025);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.card-content {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
  text-align: left;
  color: white;
}

.card-content h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.card-content p {
  font-size: 16px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #1d1d1f;
  transition: color 0.3s ease;
  z-index: 10;
  padding: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark-mode .carousel-arrow {
  color: #f5f5f7;
}

.carousel-arrow:hover {
  color: #45b6fe;
}

.carousel-arrow.left {
  left: 10px;
}

.carousel-arrow.right {
  right: 10px;
}

.cta-button,
.cta-button-large {
  padding: 10px 15px;
  background-color: #45b6fe;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.022em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button-large {
  padding: 15px 30px;
  font-size: 17px;
}

.cta-button:hover,
.cta-button-large:hover {
  background-color: #5ec2fe;
  color: white;
  border-color: transparent;
}

/* Why SolveX Section Styles */
.why-solvex-section {
  background-color: #fafafa;
  padding: 60px 20px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

body.dark-mode .why-solvex-section {
  background-color: #000000;
}

.why-solvex-section h2 {
  font-size: 40px;
  margin-bottom: 20px;
  color: #1d1d1f;
}

body.dark-mode .why-solvex-section h2 {
  color: #f5f5f7;
}

.intro-text {
  font-size: 18px;
  margin-bottom: 40px;
  color: #6e6e73;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

body.dark-mode .intro-text {
  color: #a1a1a6;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.benefit-item {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: left;
  transition: transform 0.3s ease;
}

body.dark-mode .benefit-item {
  background-color: #1c1c1e;
  box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.benefit-item:hover {
  transform: translateY(-5px);
}

.benefit-icon {
  font-size: 30px;
  color: #45b6fe;
  margin-bottom: 15px;
  background: #45b6fe;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.benefit-item h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #1d1d1f;
}

body.dark-mode .benefit-item h3 {
  color: #f5f5f7;
}

.benefit-item p {
  font-size: 16px;
  color: #6e6e73;
}

body.dark-mode .benefit-item p {
  color: #a1a1a6;
}

/* Footer */
.footer {
  background-color: #f5f5f7;
  padding: 40px 20px;
  color: #1d1d1f;
}

body.dark-mode .footer {
  background-color: #373737;
  color: #f5f5f7;
}

.footer-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

.footer-column {
  margin: 10px;
  min-width: 200px;
}

.footer-logo {
  height: 50px;
  width: auto;
  margin-bottom: 10px;
}

.footer-column h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 5px;
}

.footer-column ul li a {
  text-decoration: none;
  color: #1d1d1f;
  transition: color 0.3s ease;
}

body.dark-mode .footer-column ul li a {
  color: #f5f5f7;
}

.footer-column ul li a:hover,
body.dark-mode .footer-column ul li a:hover {
  color: #45b6fe;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
}

.footer-bottom a {
  color: #1d1d1f;
  text-decoration: none;
}

body.dark-mode .footer-bottom a {
  color: #f5f5f7;
}

.footer-bottom a:hover {
  color: #45b6fe;
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: #fafafa;
}

body.dark-mode::-webkit-scrollbar-track {
  background: #000000;
}

body::-webkit-scrollbar-thumb {
  background-color: #d3d3d3;
  border-radius: 10px;
}

body.dark-mode::-webkit-scrollbar-thumb {
  background-color: #3a3a3c;
}

.gradient-text {
  background: linear-gradient(90deg, #45b6fe, #d95bc5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Accessibilità: Focus styles */
:focus-visible {
  outline: 2px solid #45b6fe;
  outline-offset: 2px;
}

/* Responsive - Espanso per tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero-section h1 {
    font-size: 60px;
  }
  .portfolio-section h2 {
    margin-left: 70px;
  }
  .carousel-wrapper {
    padding-left: 70px;
  }
}

@media (max-width: 769px) {
  .nav-menu {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .hero-section h1 {
    margin-left: 0;
    font-size: 46px;
    font-weight: 600;
  }
  .hero-section h2,
  .hero-section p {
    margin-left: 0;
  }
  .portfolio-section h2 {
    font-size: 35px;
    margin-left: 50px;
    text-align: left;
  }
  .carousel-wrapper {
    gap: 10px;
    padding-left: 50px;
  }
  .portfolio-card {
    width: 300px;
    height: 400px;
  }
  .card-content h3 {
    font-size: 18px;
  }
  .card-content p {
    font-size: 14px;
  }
  .carousel-arrow {
    font-size: 20px;
  }
  .carousel-arrow.left {
    left: 5px;
  }
  .carousel-arrow.right {
    right: 5px;
  }
  .why-solvex-section h2 {
    font-size: 30px;
  }
  .intro-text {
    font-size: 16px;
  }
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}