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

body {
  margin: 0;
  padding: 0;
  background-image: url('/static/images/SFONDO_NATURA_MOBILE_OPTIMISED.webp');
  background-size: cover;
  background-position: center;
  font-family: 'Montserrat', sans-serif;
  color: #1F1F1F;
}

header, footer {
  position: fixed;
  width: 100%;
  height: 7vh;
  background-color: #D6BFA4;
  color: #1F1F1F;
  padding: 0 1.4vh;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header {
  top: 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

footer {
  bottom: 0;
  box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
}

.icon {
  width: 5.6vh;
  height: 5.6vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
}

.icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.logo-wrapper img {
  height: 60%;
  object-fit: contain;
}

.chatbox {
  flex: 1;
  height: 70%;
  margin: 0 1.4vh;
  border: none;
  border-radius: 24px;
  padding: 0 10px;
  background-color: #fff;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
  font-size: 1em;
  color: #1F1F1F;
}

.chatbox:focus {
  outline: none;
}

.footer-right {
  cursor: pointer;
}

main {
  padding-top: 7vh;
  padding-bottom: 7vh;
}

#pinned-message {
  position: fixed;
  top: 7vh;
  left: 0;
  width: 100%;
  height: 5vh;
  background-color: #D45A2D;
  color: #FFFFFF;
  font-family: 'Lora', serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 9;
}

#close-pin {
  cursor: pointer;
}

.chat-container {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  font-size: 17px;
  overflow-y: auto;
  max-height: calc(100vh - 14vh);
}

.bubble {
  max-width: 85%;
  padding: 12px 18px;
  margin-bottom: 6px;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  word-wrap: break-word;
}

.bubble img {
  width: 100%;
}

.bubble li {
  display: block;
}

.bubble a {
  color: blue;
  text-decoration: underline;
}

.assistant {
  background-color: #FAF8F5;
  margin-right: auto;
}

.user {
  background-color: #DDD6CE;
  margin-left: auto;
}

.slider-widget {
  background-color: #DDD6CE;
  padding: 6px 0;
  overflow-x: auto;
  box-sizing: border-box;
  margin-bottom: 5px;
  /* Aggiungi questo per migliorare lo scorrimento su dispositivi touch */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.slider-container {
  display: flex;
  gap: 12px;
  padding-left: 10px;
  padding-right: 10px;
}

.slide-item {
  flex: 0 0 33vw;
  min-width: 0;
}

.slide-item img {
  width: 100%;
  border-radius: 24px;
  border: 1px solid #DADADA;
  filter: sepia(10%);
}

.slide-label {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: x-small;
  margin-top: 4px;
  color: #1F1F1F;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timestamp {
  font-size: small;
  color: darkgray;
}

#scannerModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#scannerContainer {
    position: relative;
    width: 90%;
    max-width: 500px;
    height: 60%;
    max-height: 500px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#interactive {
    width: 100%;
    height: 100%;
}

.close-scanner-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-scanner-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}
