:root {
  --bg-color: #EFEFEF; /* Grigio Pietra Chiaro */
  --primary-text: #414141; /* Grigio Grafite */
  --heading-color: #385446; /* Verde Bosco Scuro */
  --accent-color: #C5A669; /* Ottone Spazzolato */
  --details-bg-color: #CAD2C5; /* Verde Salvia Pallido */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;
}

body[data-theme='dark'] {
  --bg-color: #2A2A2A; /* Grigio Ardesia Scuro */
  --primary-text: #EAEAEA; /* Bianco Sporco */
  --heading-color: #FFFFFF; /* Bianco Puro */
  --accent-color: #D4AF37; /* Oro Antico/Mostarda */
  --details-bg-color: #3A3A3A; /* Grigio Scuro per dettagli */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--primary-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--heading-color);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
p { margin-bottom: 1rem; font-weight: 300; }
a { color: var(--heading-color); text-decoration: none; }
a:hover { color: var(--accent-color); }

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.main-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease;
}
body[data-theme='dark'] .main-header {
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  line-height: 0; 
  position: relative;
}
.logo:hover {
  color: var(--heading-color); 
}

.logo img {
  height: 45px;
  width: auto;
  transition: transform 0.2s ease-in-out;
}
body[data-theme='dark'] .logo img {
  filter: brightness(0) invert(1);
}

.logo:hover img {
  transform: scale(1.05);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--primary-text);
  font-weight: 400;
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 5px;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent-color);
}
.main-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-color);
  transition: width 0.3s ease-in-out;
}
.main-nav a:hover::after, .main-nav a.active::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
  color: var(--accent-color);
  background-color: rgba(0,0,0,0.05);
}

body[data-theme='dark'] .theme-toggle:hover {
  background-color: rgba(255,255,255,0.1);
}

.btn {
  background-color: var(--accent-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}
body[data-theme='dark'] .btn {
  color: #2A2A2A;
}

.btn:hover {
  background-color: #b4955a; /* Darker shade of Ottone Spazzolato */
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(197, 166, 105, 0.3);
}
body[data-theme='dark'] .btn:hover {
  background-color: #c09d2e;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  color: #2A2A2A;
}

.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  background: linear-gradient(rgba(56, 84, 70, 0.6), rgba(56, 84, 70, 0.6)), url('/public/images/hero-background.jpg?v=1.2') no-repeat center center/cover;
  position: relative;
  padding: 4rem 0;
}
body[data-theme='dark'] .hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('/public/images/hero-background.jpg?v=1.2') no-repeat center center/cover;
}

.hero-content h1 {
  margin-bottom: 1.5rem;
  line-height: 0;
}

.hero-logo {
  max-width: 500px;
  width: 90%;
  height: auto;
}
body[data-theme='dark'] .hero-logo {
  filter: brightness(0) invert(1);
}

.hero-content .hero-intro {
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0 auto 1.5rem auto;
  font-weight: 300;
  line-height: 1.7;
  opacity: 0.9;
}

.hero-content .tagline {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 400;
  color: white;
  margin: 0 auto 2rem auto;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem 1rem 0.5rem 2rem;
  border-left: 4px solid var(--accent-color);
  background: rgba(65, 65, 65, 0.3);
  border-radius: 0 4px 4px 0;
  max-width: 90%;
}
body[data-theme='dark'] .hero-content .tagline {
  background: rgba(0, 0, 0, 0.4);
}

.hero-content .tagline[role="alert"] {
  color: #ffdddd;
  border-left-color: #ff8888;
}

.content-section {
  padding: 4rem 0;
  text-align: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  align-items: center;
  text-align: left;
  margin-top: 2rem;
}

.grid-2 img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  object-fit: cover;
  max-height: 400px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.gallery-grid img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
body[data-theme='dark'] .gallery-grid img {
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
body[data-theme='dark'] .gallery-grid img:hover {
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.1);
}

#events {
  background-color: var(--details-bg-color);
}

.no-events-placeholder {
  background-color: var(--bg-color);
  padding: 3rem 2rem;
  border-radius: 8px;
  margin-top: 2rem;
  text-align: center;
  border: 1px dashed var(--accent-color);
}
body[data-theme='dark'] .no-events-placeholder {
  background-color: #3a3a3a;
}

.no-events-placeholder p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.no-events-placeholder p:last-child {
  margin-bottom: 0;
  font-weight: 400;
  color: var(--primary-text);
}


/* --- Contact Section Enhancements --- */
.contact-details {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    font-size: 1.2rem;
    max-width: 400px;
    width: 100%;
}
.contact-info a {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid var(--details-bg-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: rgba(0,0,0,0.02);
}
body[data-theme='dark'] .contact-info a {
    background-color: rgba(255,255,255,0.05);
}

.contact-info a:hover {
    background-color: var(--details-bg-color);
    color: var(--heading-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.social-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
}
.social-links a {
    color: var(--primary-text);
    transition: color 0.3s ease, transform 0.3s ease;
}
.social-links a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}
.social-links svg {
    width: 32px;
    height: 32px;
}


.main-footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
  background-color: var(--details-bg-color);
  margin-top: auto;
}


/* --- Chatbot Styles --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1010;
}
body[data-theme='dark'] .chat-fab {
  color: #2A2A2A;
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-callout {
  position: fixed;
  bottom: 90px; /* Positioned above the FAB */
  right: 20px;
  background-color: var(--heading-color);
  color: white;
  padding: 10px 15px;
  border-radius: 12px 12px 0 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1010;
  animation: fadeInUp 0.5s ease-out;
  font-size: 0.9rem;
}
body[data-theme='dark'] .chat-callout {
    background-color: var(--accent-color);
    color: #2A2A2A;
}


.chat-window {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 90vw;
  max-width: 380px;
  height: 80vh;
  max-height: 600px;
  background-color: var(--bg-color);
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1020;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
}
body[data-theme='dark'] .chat-window {
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.chat-window.open {
  transform: scale(1);
  opacity: 1;
}

.chat-header {
  background-color: var(--heading-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
body[data-theme='dark'] .chat-header {
  background-color: #3a3a3a;
}


.chat-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: white;
  font-weight: 500;
}
body[data-theme='dark'] .chat-header h3 {
  color: var(--heading-color);
}

.chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
body[data-theme='dark'] .chat-header button {
  color: var(--primary-text);
}


.chat-header button:hover {
  opacity: 1;
}

.chat-messages {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  max-width: 85%;
}

.message p {
  padding: 10px 15px;
  border-radius: 18px;
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 0.95rem;
  word-wrap: break-word;
  word-break: break-word;
  display: inline-block;
}

.message p a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.message.bot {
  align-self: flex-start;
}
.message.bot p {
  background-color: var(--details-bg-color);
  color: var(--primary-text);
  border-bottom-left-radius: 4px;
}

.message.user {
  align-self: flex-end;
}
.message.user p {
  background-color: var(--accent-color);
  color: white;
  border-bottom-right-radius: 4px;
}
body[data-theme='dark'] .message.user p {
  color: #2A2A2A;
}

.chat-input {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-top: 1px solid #ddd;
  background-color: #fff;
  flex-shrink: 0;
}
body[data-theme='dark'] .chat-input {
  background-color: #3a3a3a;
  border-top: 1px solid #444;
}

.chat-input input {
  flex-grow: 1;
  border: none;
  outline: none;
  padding: 0.5rem;
  font-size: 1rem;
  background-color: transparent;
  color: var(--primary-text);
}

.chat-input input::placeholder {
  color: #999;
}
body[data-theme='dark'] .chat-input input::placeholder {
  color: #888;
}

.chat-input button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  transition: color 0.2s;
}

.chat-input button:disabled {
  color: #ccc;
  cursor: not-allowed;
}
body[data-theme='dark'] .chat-input button:disabled {
  color: #555;
}

.typing-indicator {
  display: flex;
  align-items: center;
  padding: 10px 15px;
}
.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #888;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-of-type(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-of-type(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-of-type(3) { animation-delay: 0s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}


/* --- Hamburger Menu Styles --- */
.hamburger-menu {
  display: none; /* Hidden by default */
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1050;
  padding: 0.5rem;
}
.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--primary-text);
  transition: all 0.3s ease-in-out;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%; /* Start off-screen */
  width: 70%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 1040;
  transition: right 0.4s ease-in-out;
  padding-top: 6rem;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}
.mobile-nav.open {
  right: 0;
}
.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.mobile-nav a {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--heading-color);
}
.mobile-nav a:hover {
  color: var(--accent-color);
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  z-index: 1030;
}
.nav-overlay.open {
  display: block;
}

/* Open state for hamburger */
.hamburger-menu.open .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.open .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.open .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* Responsive adjustments */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  p { font-size: 0.95rem; }
  
  .container {
    width: 95%;
  }

  .main-nav {
    display: none; /* Hide desktop nav */
  }

  .hamburger-menu {
    display: block; /* Show hamburger */
  }

  .hero {
    min-height: 80vh;
    padding: 3rem 0;
  }
  .hero-logo {
    max-width: 350px;
  }
  .hero-content .hero-intro {
    font-size: 1.1rem;
  }
  .hero-content .tagline {
    font-size: 1.2rem;
    max-width: 100%;
  }

  .content-section {
    padding: 3rem 0;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .grid-2 img {
    max-height: 300px;
  }
  
  .contact-info {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  .hero-logo { max-width: 90%; width: 280px; }
  .btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
  .gallery-grid img { height: 220px; }

  .chat-window {
    width: 100vw;
    height: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  .chat-fab {
    bottom: 15px;
    right: 15px;
  }
  .chat-callout {
    display: none;
  }
}