#maiaChatContainer {
position: fixed;
    bottom: 50px;
    right: 50px;
    background: #e9ecef;
    border: 2px solid transparent;
width: 1000px;
max-width: 370px;
min-width: 370px;
display: none;
    border-radius: 50px;
max-height: 650px;
min-height: 250px;
height: 100%;
box-sizing: border-box;
z-index: 10000;
}

#maiaChatContainer.fullscreen {
max-width: 1000px;
}

#maiaChatContainer section {
background: #fff;
display: block;
}

#maiaChatContainer iframe {
border: none;
border-radius: 10px;
width: 100%;
height: 100%;
position: absolute;
max-height: 750px;
}

#maiaChatOpenButton{
display: block;
position: fixed;
    bottom: 100px;
    right: 300px;
    width: 100px;
    height: 50px;
cursor: pointer;
box-sizing: border-box;
z-index: 99;
}

#maiaChatOpenButtonImage {
    background-image: url(https://platform.maia.chat/storage/bots/111/pvBL8FlG4JRroUvL0gemr7D9CE21QIQuIkFDMDVa.png);
background-repeat: no-repeat;
background-position: center;
background-size: contain;
    width: 100px;
    height: 50px;
}

@media only screen and (max-width: 768px) {
#maiaChatOpenButton {
display: block;
position: fixed;
bottom: 5px;
right: 5px;
width: 30px;
height: 30px;
}

#maiaChatContainer {
display: none;
top: 0;
left: 50%;
width: 99%;
height: 85vh;
transform: translate(-50%, 0);
}

#maiaChatContainer section {
display: block;
height: 90%;
}

#maiaChatContainer iframe {
height: 100%;
width: 100%;
border: none;
}
}

/* Accessibilità: rispetta reduce-motion */
@media (prefers-reduced-motion: reduce) {
  #maiaChatOpenButton { animation: none; transition: none; }
}

/* Pulsante con animazione morbida periodica */
#maiaChatOpenButton {
  z-index: 999;
  bottom: 100px;
  right: 60px;
  height: auto;

  display: inline-block;
  transform-origin: center center;
  will-change: transform;
  animation: chatSoftPulse 8s cubic-bezier(.25,.1,.25,1) infinite;
  transition: transform 0.4s cubic-bezier(.25,.1,.25,1);
}

/* Quando passo sopra il pulsante (o l&#039;immagine dentro),
   fermo l&#039;animazione del pulsante */
#maiaChatOpenButton:hover {
  animation-play-state: paused;
}

/* L’immagine dentro il pulsante */
#maiaChatOpenButtonImage {
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  width: 300px;
  height: 200px;
  margin-left: -140px;

  transition: transform 0.25s ease-out;
}

/* Quando il mouse è sopra il pulsante,
   ingrandisco leggermente SOLO l’immagine */
#maiaChatOpenButton:hover #maiaChatOpenButtonImage {
  transform: scale(1.08);
}

/* Animazione di &quot;pulse&quot; */
@keyframes chatSoftPulse {
  0%   { transform: scale(1); }
  2%   { transform: scale(0.9, 1.1); }
  5%   { transform: scale(1.1, 0.9); }
  7%   { transform: scale(0.96, 1.04); }
  8%   { transform: scale(1); }
  100% { transform: scale(1); }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
  #maiaChatOpenButton {
    animation: none;
    transition: none;
  }
}

/* Mobile */
@media only screen and (max-width: 768px) {
  #maiaChatOpenButton {
    bottom: 50px !important;
    right: 50px !important;
  }
}

#maiaChatContainer{
    border-radius:12px!important;
}

/* Tablet e mobile largo */
@media (max-width: 768px) {
  #maiaChatOpenButton {
    bottom: 110px !important;
    right: 80px !important; /* più verso il centro */
  }

  #maiaChatOpenButtonImage {
    width: 160px !important;
    height: 110px !important;
    margin-left: -80px !important;
  }
}

/* Smartphone normali */
@media (max-width: 480px) {
  #maiaChatOpenButton {
    bottom: 120px !important;
    right: 120px !important; /* ancora più verso sinistra */
  }

  #maiaChatOpenButtonImage {
    width: 180px !important;
    height: 130px !important;
    margin-left: -40px !important;
  }
}

/* Smartphone molto piccoli (es. iPhone SE) */
@media (max-width: 360px) {
  #maiaChatOpenButton {
    bottom: 130px !important;
    right: 135px !important; /* quasi centrale */
  }

  #maiaChatOpenButtonImage {
    width: 160px !important;
    height: 115px !important;
    margin-left: -30px !important;
  }
}

/*div#maiaChatOpenButtonImage {
    transition: width 1s, height 1s, transform 1s;
}

div#maiaChatOpenButtonImage:hover {
    width: 80px;
    height: 80px;
    transform: rotate(180deg);
}

#maiaChatContainer iframe {
    box-shadow: 3px 8px 15px #888888;
}

#maiaChatContainer {
    max-height: 610px;
    min-height: 250px;
}

@media only screen and (max-width: 768px) {
    #maiaChatOpenButton {
        bottom: 50px !important;
        right: 50px !important;
    }
}*/
