/**
 * Frontend styles for SM Header Builder
 * Versione semplificata senza dropdown logo
 */

/* Reset minimo e selettori specifici */
#sm-header-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333333;
  box-sizing: border-box;
  position: relative;
  z-index: 1000;
  display: block;
  width: 100%;
}

#sm-header-root * {
  box-sizing: border-box;
}

/* Screen reader text */
#sm-header-root .sm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Base header styles */
#sm-header-root .sm-header {
  position: relative;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: block;
}

#sm-header-root .sm-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 80px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

/* Header style variations */
#sm-header-root .sm-header-curved {
  position: relative;
  overflow: hidden;
}

#sm-header-root .sm-header-curved::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(106, 27, 154, 0.1), rgba(57, 73, 171, 0.1));
  z-index: -1;
}

#sm-header-root .sm-header-curved::after {
  content: "";
  position: absolute;
  bottom: -50px;
  left: 0;
  width: 100%;
  height: 60px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05);
}

#sm-header-root .sm-header-wave {
  position: relative;
  overflow: hidden;
}

#sm-header-root .sm-header-wave::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(106, 27, 154, 0.1), rgba(57, 73, 171, 0.1));
  z-index: -1;
}

#sm-header-root .sm-header-wave::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 20px;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23FFFFFF" /></svg>');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

#sm-header-root .sm-header-angled {
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
  height: 100px;
}

#sm-header-root .sm-header-angled::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(106, 27, 154, 0.1), rgba(57, 73, 171, 0.1));
  z-index: -1;
}

#sm-header-root .sm-header-angled .sm-container {
  height: 80px;
}

/* Gradient border */
#sm-header-root .sm-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #6a1b9a, #3949ab, #6a1b9a);
  z-index: 2;
}

/* Logo styles - Semplificato senza dropdown */
#sm-header-root .sm-logo-container {
  position: relative;
  z-index: 10;
  margin-right: auto;
}

#sm-header-root .sm-logo {
  display: block;
  text-decoration: none;
  transition: transform 0.3s ease;
}

#sm-header-root .sm-logo:hover {
  transform: scale(1.05);
}

#sm-header-root .sm-logo:focus {
  outline: 2px solid #333333;
  outline-offset: 2px;
  border-radius: 4px;
}

#sm-header-root .sm-logo img {
  max-height: 60px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* Right side container */
#sm-header-root .sm-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Menu styles */
#sm-header-root .sm-menu {
  display: flex;
  gap: 2rem;
}

#sm-header-root .sm-menu-section {
  position: relative;
}

#sm-header-root .sm-menu-title {
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  background: transparent;
  border: none;
  color: #333333;
  font-size: 16px;
  transition: color 0.3s ease;
  display: block;
}

#sm-header-root .sm-menu-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #333333, #666666);
  transition: width 0.3s ease;
}

#sm-header-root .sm-menu-title:hover::after,
#sm-header-root .sm-menu-title:focus::after,
#sm-header-root .sm-menu-title[aria-expanded="true"]::after {
  width: 100%;
}

#sm-header-root .sm-menu-title:focus {
  outline: 2px solid #333333;
  outline-offset: 2px;
}

/* Menu dropdown styles */
#sm-header-root .sm-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 15px;
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 9999;
  min-width: 220px;
}

#sm-header-root .sm-menu-dropdown.sm-active {
  display: flex;
}

#sm-header-root .sm-menu-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: -1px -1px 0 0 rgba(0, 0, 0, 0.1);
}

#sm-header-root .sm-menu-item {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #333333;
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

#sm-header-root .sm-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateX(3px);
}

#sm-header-root .sm-menu-item:focus {
  outline: 2px solid #333333;
  outline-offset: -2px;
  background: rgba(0, 0, 0, 0.05);
}

/* Icon styles */
#sm-header-root .sm-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

#sm-header-root .sm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #333333;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

#sm-header-root .sm-icon:hover {
  transform: translateY(-2px);
}

#sm-header-root .sm-icon:focus {
  outline: 2px solid #333333;
  outline-offset: 2px;
}

#sm-header-root .sm-icon i {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

/* Forza le icone Font Awesome */
#sm-header-root .sm-icon i::before,
#sm-header-root .sm-mobile-icon-link i::before {
  display: inline-block !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased !important;
}

#sm-header-root .fas::before,
#sm-header-root .sm-mobile-menu .fas::before {
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
}

#sm-header-root .far::before,
#sm-header-root .sm-mobile-menu .far::before {
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 400 !important;
}

#sm-header-root .fab::before,
#sm-header-root .sm-mobile-menu .fab::before {
  font-family: "Font Awesome 5 Brands" !important;
}

#sm-header-root .sm-icon:hover i {
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sm-header-root .sm-icon-text {
  margin-left: 0.5rem;
  font-weight: 500;
}

/* Mobile toggle button */
#sm-header-root .sm-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 20;
}

#sm-header-root .sm-mobile-toggle:focus {
  outline: 2px solid #333333;
  outline-offset: 2px;
}

#sm-header-root .sm-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: #333333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

#sm-header-root .sm-mobile-toggle[aria-expanded="true"] .sm-toggle-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

#sm-header-root .sm-mobile-toggle[aria-expanded="true"] .sm-toggle-bar:nth-child(2) {
  opacity: 0;
}

#sm-header-root .sm-mobile-toggle[aria-expanded="true"] .sm-toggle-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile menu styles */
#sm-header-root .sm-mobile-menu {
  display: none;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 99;
  width: 100%;
  position: absolute;
  top: 100%;
  left: 0;
}

#sm-header-root .sm-mobile-menu.sm-active {
  display: block;
}

#sm-header-root .sm-mobile-menu nav {
  padding: 1.5rem;
}

#sm-header-root .sm-mobile-section {
  margin-bottom: 1.5rem;
}

#sm-header-root .sm-mobile-title {
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  background: rgba(0, 0, 0, 0.03);
  border: none;
  color: #333333;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#sm-header-root .sm-mobile-title:hover,
#sm-header-root .sm-mobile-title[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.08);
}

#sm-header-root .sm-mobile-title:focus {
  outline: 2px solid #333333;
  outline-offset: -2px;
  background: rgba(0, 0, 0, 0.08);
}

#sm-header-root .sm-mobile-icon {
  position: relative;
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

#sm-header-root .sm-mobile-icon::before,
#sm-header-root .sm-mobile-icon::after {
  content: "";
  position: absolute;
  background-color: #333333;
  transition: transform 0.3s ease;
  border-radius: 1px;
}

#sm-header-root .sm-mobile-icon::before {
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
}

#sm-header-root .sm-mobile-icon::after {
  top: 0;
  left: 7px;
  width: 2px;
  height: 16px;
}

#sm-header-root .sm-mobile-title[aria-expanded="true"] .sm-mobile-icon {
  transform: rotate(180deg);
}

#sm-header-root .sm-mobile-title[aria-expanded="true"] .sm-mobile-icon::after {
  transform: scaleY(0);
}

#sm-header-root .sm-mobile-dropdown {
  display: none;
  padding: 0.5rem 0 0.5rem 1rem;
  margin-top: 0.5rem;
}

#sm-header-root .sm-mobile-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #333333;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
  font-weight: 500;
  cursor: pointer;
}

#sm-header-root .sm-mobile-item:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateX(3px);
}

#sm-header-root .sm-mobile-item:focus {
  outline: 2px solid #333333;
  outline-offset: -2px;
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile icons */
#sm-header-root .sm-mobile-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#sm-header-root .sm-mobile-icon-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #333333;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

#sm-header-root .sm-mobile-icon-link:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

#sm-header-root .sm-mobile-icon-link:focus {
  outline: 2px solid #333333;
  outline-offset: -2px;
  background: rgba(0, 0, 0, 0.08);
}

#sm-header-root .sm-mobile-icon-link i {
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

/* Assicuriamoci che i contenitori non taglino i dropdown */
#sm-header-root,
#sm-header-root .sm-header,
#sm-header-root .sm-container,
#sm-header-root .sm-menu,
#sm-header-root .sm-menu-section {
  overflow: visible !important;
}

/* Responsive styles */
@media (max-width: 1024px) {
  #sm-header-root .sm-container {
    padding: 0 1.5rem;
  }

  #sm-header-root .sm-menu {
    gap: 1.5rem;
  }

  #sm-header-root .sm-icons {
    gap: 1rem;
  }

  #sm-header-root .sm-icon-text {
    display: none;
  }

  #sm-header-root .sm-hide-tablet {
    display: none !important;
  }
}

@media (max-width: 768px) {
  #sm-header-root .sm-container {
    padding: 0 1.5rem;
  }

  #sm-header-root .sm-right {
    display: none;
  }

  #sm-header-root .sm-mobile-toggle {
    display: flex;
  }

  #sm-header-root .sm-logo img {
    max-height: 40px;
  }

  #sm-header-root .sm-header-angled {
    clip-path: none;
    height: 80px;
  }

  #sm-header-root .sm-header-angled::before {
    display: none;
  }

  #sm-header-root .sm-hide-mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  #sm-header-root .sm-container {
    padding: 0 1rem;
    height: 70px;
  }

  #sm-header-root .sm-logo img {
    max-height: 30px;
  }
}

/* Classi di visibilità responsive */
@media (min-width: 1025px) {
  #sm-header-root .sm-hide-desktop {
    display: none !important;
  }
}
