/* --- Layout Principale Verticale --- */
.takePicOverlay {
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: 100000;
    top: 0;
    left: 0;
    background-color: #5c0b0b;
    /*background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url("img.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    */
    /* Cambiato in colonna per mettere la gallery sopra il video */
    display: flex;
    flex-direction: column; 
    align-items: center;
    overflow: hidden;
}

/* --- Nuova Galleria Orizzontale Superiore --- */
.sideImageGallery {
    width: 95% !important; /* Quasi tutta la larghezza */
    height: 680px !important; /* Altezza fissa per le anteprime */
    margin-top: 20px;
    margin-bottom: 10px;
    
    /* Layout orizzontale per le foto */
    display: flex !important;
    flex-direction: row !important;
    justify-content: center; /* Centra le foto se sono poche */
    align-items: center;
    
    overflow-x: auto !important; /* Scroll orizzontale se sono tante */
    overflow-y: hidden !important;
    
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 10px 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px; /* Spazio tra le foto */
}

/* --- Anteprime Grandi nella Galleria --- */
.sideImageGallery img {
    height: 120px; /* Altezza generosa */
    width: auto;   /* Mantiene le proporzioni */
    min-width: 160px; /* Larghezza minima per l'impatto visivo */
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Impedisce alle immagini di rimpicciolirsi */
    animation: imageAppendAnim 0.4s ease-out;
}

.sideImageGallery img:hover {
    transform: scale(1.08);
    border-color: #19b5fe;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* --- Container Video (sotto la gallery) --- */
.videoContainer {
   background-color: #5c0b0b;
	flex: 1; /* Prende tutto lo spazio rimanente */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 10px; /* Spazio per i tasti in fondo */
}

.titoloGallery {
    position: absolute;
    top: 0;             /* <--- Cambiato da 20px a 0 per allinearlo on top */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;

    /* Stile visuale */
    font-family: dashicons;
    font-size: 60px;
    color: white;
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    
    display: flex;
    flex-direction: row;
    align-items: center;    /* Centra l'icona verticalmente nel box da 100px */
    justify-content: center;
    
    width: 500px;
    height: 100px;
    
    box-shadow: 0 10px 35px rgba(255, 75, 43, 0.5);
    border: 4px solid white;
    
    /* Se vuoi che i bordi inferiori siano arrotondati ma quelli sopra dritti */
    border-radius: 0 0 25px 25px; 
    
    line-height: 0;
}

#videoStream {
    width: 100%;
    max-width: 1000px;
    /*max-height: 60vh; /* Evita che diventi troppo alto su schermi piccoli */
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    border: 2px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
}

/* --- Barra Comandi Inferiore (Home e Scatta) --- */
.controlBar {
	background-color: #5c0b0b;
    position: absolute;
    bottom: 30px;
    left: 50%; /* Centra la barra orizzontalmente */
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

#captureButton:before {
    font-family: dashicons;
    content: "\f306";
    font-size: 100px; /* Ridotto leggermente per stare nel cerchio */
    color: white;
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    
    /* Per un cerchio perfetto: */
    width: 250px;
    height: 250px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    box-shadow: 0 10px 35px rgba(255, 75, 43, 0.5);
    border: 4px solid white;
    line-height: 0; /* Evita discrepanze di allineamento del font */
}

#takePicClose:before {
    font-family: dashicons;
    content: "\f102";
    font-size: 100px;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Supporto Safari */
    
    /* Per un cerchio perfetto: */
    width: 250px;
    height: 250px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    border: 4px solid rgba(255, 255, 255, 0.3);
    line-height: 0;
}
/* --- Scrollbar personalizzata per la gallery orizzontale --- */
.sideImageGallery::-webkit-scrollbar {
    height: 6px;
}
.sideImageGallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}
/*AAAAAAAAAAAAAAAAAA*/

#takePicButton{
	text-decoration:none !important;
	  /*margin-left:31.5%;*/	 
}


#takePicButton::before{
    	
	font-family:dashicons;
	content: "\f235";
	
	/*background : url("camera.png") center no-repeat ;*/
	 background-size: 100%;
	
	font-size:400px;
	color: rgba(255,0,0,0);
	 -webkit-transition: height 3s ; /* Safari */
       transition:  height 3s;
       transition: 0.8s ease;
      -webkit-transition: 0.8s ease;
      -moz-transition: 0.8s ease;
      -ms-transition: 0.8s ease;
	 text-decoration:none !important;
}
#takePicButton:hover:before{
		color:rgba(25, 181, 254, 0.7);
    	 text-decoration:none !important;
      -webkit-transition: height 3s ; /* Safari */
       transition:  height 3s;
       transition: 0.8s ease;
	   color: rgba(0,0,0,0);
      -webkit-transition: 0.8s ease;
      -moz-transition: 0.8s ease;
      -ms-transition: 0.8s ease;
     
}


#takePicFilterContainer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.filterVideoStream {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.filterVideoStream:hover, .filterVideoStreamActive {
    border-color: #19b5fe;
    transform: translateY(-3px);
}

/* --- Animazioni --- */
@keyframes imageAppendAnim {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Nascondi canvas di servizio */
#grabFrameCanvas, #imageCaptureCanvas {
    display: none;
}

/* Fix per Mobile */
@media (max-width: 768px) {
    .takePicOverlay {
        flex-direction: column;
    }
    .sideImageGallery {
        width: 100% !important;
        height: 20% !important;
        flex-direction: row;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .sideImageGallery img {
        width: 120px;
    }
}