/* --- Sezione AI Bio --- */
.ai-bio-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(25deg, #370e8f, #6822ff, #6822ff);
  border-radius: 0;
  box-shadow: none;
  z-index: 10000;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

/* Stato visibile con animazione */
.ai-bio-section.active {
  opacity: 1;
  transform: translateY(0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

/* Stato di chiusura esplicito */
.ai-bio-section:not(.active) {
  opacity: 0;
  transform: translateY(100%);
}

/* Pulsante di chiusura */
.ai-bio-close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ai-bio-close-button:hover {
  background: rgba(0, 0, 0, 0.5);
}

.ai-bio-close-button svg {
  width: 24px;
  height: 24px;
}

/* Adatta elementi interni per schermo intero */
.ai-bio-title {
  font-weight: 600;
  color: #f8f8f8;
  margin-bottom: 0.5rem;
  text-align: center;
}

.ai-bio-description {
  color: #e5e5e5;
  padding-bottom: 1.5rem;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.prompt-slider {
    /* Proprietà esistenti */
    display: flex;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    padding-left: 0.5rem;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    
    /* AGGIUNTA FONDAMENTALE PER GLI PSEUDO-ELEMENTI */
    position: relative; 
}

/* Rimuove la barra di scorrimento visibile per i browser basati su WebKit (Chrome, Safari) */
.prompt-slider::-webkit-scrollbar {
    display: none;
}

/* ===============================
   Contenitore Genitore (per il posizionamento)
   =============================== */
.slider-wrapper {
    /* Fondamentale: imposta l'area di riferimento per l'overlay assoluto */
    position: relative;
    /* Opzionale: assicura che il carosello non fuoriesca (in caso di margini negativi o altri effetti) */
    overflow: hidden; 
}

/* ===============================
   Div Overlay (per la sfumatura)
   =============================== */
.fade-overlay {
    /* ABILITA POSIZIONAMENTO FISSO RISPETTO AL GENITORE */
    position: absolute;
    
    /* POSIZIONAMENTO: copre l'angolo in alto a destra del carosello */
    top: 0;
    right: -1px;
    bottom: 0; /* Si estende per l'intera altezza del contenitore */
    
    /* DIMENSIONI e Z-INDEX */
    width: 100px; /* La larghezza della sfumatura */
    z-index: 10; /* Assicura che sia sopra i prompt */
    
    /* SFUMATURA (Mantengo i tuoi colori) */
    background: linear-gradient(
        to right,
        rgb(104 34 255 / 0%) 0%,
        #6822ff 100% 
    );

    /* ABILITA SCORRIMENTO SOTTO IL GRADIENTE */
    pointer-events: none;
}


.sample-prompt {
 flex: 0 0 auto;
 width: calc((100vw / 2) - 1rem);
 margin-right: 0.6rem;
 scroll-snap-align: start;
 padding: 1rem;
 border-radius: 8px;
 box-shadow: 0 0px 18px rgba(0, 0, 0, 0.1);
 background: #4815b700;
 display: flex;
 flex-direction: column;
   transition: all 0.3s ease;
}

.sample-prompt:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.prompt-slider .sample-prompt:last-child {
   margin-right: calc(100vw - 90vw - 0.5rem); 
  padding-left: 1rem;  /* Calcolo: 100vw (viewport) - 90vw (larghezza prompt) - 0.5rem (padding iniziale) */
}
.sample-prompt h6 {
    margin-top: 0;
}

.sample-prompt h6 {
    color:#ffffffc2;
}
.sample-prompt p {
	font-size:11px;
    color:#ffffffc2;
	margin-bottom:.25 rem;
}

.bulletAi {
    margin-top: -4px;
    margin-left: -2px;
    width: 28px;
    height: 28px;
    background: #ffffff96;
    backdrop-filter: blur(6px);
    border-radius: 100%;
    margin-bottom: 8px;
}

.ai-input-group {
  max-width: 600px;
  width: 100%;
  border: none;
  box-shadow: none;
  position: relative;
  /* min-height: 45px; */ /* Altezza minima per il contenitore */
  margin: 0 auto;
}

.ai-prompt-input {
  border: 1px solid #ced4daab;
  padding: .7rem;
  transition: border-color 0.6s ease, box-shadow 0.2s ease;
   /* Altezza maggiore per simulare una textarea */
  background-color: #ffffff30;
	font-size:13px;
  color: #f8f8f8;
  resize: vertical; /* Permette all'utente di ridimensionare verticalmente */
  width: 100%;
  box-sizing: border-box;
  word-break:break-all;
	transition:.3s;
}

.ai-prompt-input:focus {
  border-color: #31313154;
  box-shadow: 0px 0px 180px #f5f5f58c !important;
background:transparent;
	color:#ffffffe3;
	font-size:12px;
	height:120px;
	border-radius:12px!important;
	transition:.3s;  
	transition: border-color 0.6s ease, box-shadow 0.2s ease;
}

.ai-error-message {
position: fixed;
    bottom: 10px;
    margin: 0 auto;
    min-height: 1.2em;
    font-weight: 500;
    text-align: left;
    width: 100%;
}

/* Stili per la bio generata */
.ai-generated-bio {
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.ai-generated-bio-text {
  color: #f8f8f8;
  font-size: 16px;
  margin-bottom: 1rem;
}

.ai-accept-button {
  background: linear-gradient(45deg, #6822ff, #5136a7);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s ease-out;
}

.ai-accept-button:hover {
  background: linear-gradient(45deg, #9C27B0, #E91E63);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ai-accept-button:active {
  transform: scale(0.98);
}


.ai-prompt-input::-webkit-input-placeholder {
  color: #ffffffbf;
  text-align: left;
  font-size:12px;
  margin-top:20px;
}

.ai-prompt-input::-moz-placeholder {
  color: #ffffffbf;
  text-align: left;
  font-size:12px;
  margin-top:20px;
}

.ai-prompt-input:-ms-input-placeholder {
  color: #ffffffbf;
  text-align: left;
  font-size:12px;
  margin-top:20px;
}

.ai-prompt-input::-ms-input-placeholder {
  color: #ffffffbf;
  text-align: left;
  font-size:12px;
margin-top:20px;
}

.ai-prompt-input::placeholder {
  color: #ffffffbf;
  text-align: left;
  font-size:12px;
margin-top:20px;
}

.ai-generate-button {
  position: absolute !important;
  bottom: .3rem;
  right: .5rem;
  background: linear-gradient(45deg, #6822ff, #5136a7);
  color: white;
  border: none;
  padding: 0.5rem .6rem;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ai-audio-button {
  position: absolute !important;
  bottom: .3rem;
  right: 5.4rem;
  background: transparent;
  background-color: transparent!important;
  color: white;
  border: none;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index:11111!important;
}

.ai-generate-button:hover:not(:disabled) {
  background: linear-gradient(45deg, #9C27B0, #E91E63);
  color: #f8f8f8;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ai-generate-button:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-generate-button:disabled {
  cursor: not-allowed;
  background: #212121;
}

.ai-generate-button .button-content {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.ai-audio-button .button-content-audio{
	  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.ai-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ai-spinner svg {
  display: block;
}

.ai-generate-button.loading .button-content {
  opacity: 0;
  pointer-events: none;
}

.ai-generate-button.loading .ai-spinner {
  display: block !important;
}

.ai-generate-button:not(.loading) .ai-spinner {
  display: none;
}

/* Stili per il pulsante di registrazione audio */
.ai-audio-button.recording {
  background-color: #dc3545 !important;
  animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
}

.recording-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  margin-right: 6px;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
