/* assets/css/video-viewer.css */

:root {
    --swiper-pagination-color: #069999;
    --swiper-pagination-bottom: -5px;
    --swiper-pagination-bullet-size: 12px;
    --swiper-pagination-bullet-inactive-color: rgba(0, 0, 0, 0.8);
    --plyr-color-main: #069999;
}

/* --- CURSORE PREFERITI --- */
.toggle-favorite {
    cursor: pointer !important;
    user-select: none;
    text-decoration: none;
}
.toggle-favorite:hover {
    text-decoration: none;
}

/* --- THUMBNAIL NELLA GRIGLIA --- */
.video-thumb {
    position: relative;
    cursor: pointer;
    border-radius: 0.4rem;
    overflow: hidden;
    background: #000;
    z-index: 1;
}
.video-thumb img {
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 2;
}

/* Bottone Play: Cerchio BIANCO */
.video-thumb .play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: #ffffff !important; /* Sfondo sempre Bianco */
    border-radius: 50%;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,.15);
    transition: transform 0.3s ease;
}

/* Animazione Ripple BIANCA */
.video-thumb .play-button-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6); /* Onda Bianca */
    z-index: -1;
    animation: ripple-effect 2s infinite ease-out;
    transform: translate(-50%, -50%);
}

/* Hover: Ingrandisce ma mantiene i colori */
.video-thumb:hover .play-button-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: #ffffff !important; 
}

/* Icona Play: VERDE (Primary) */
.video-thumb .play-button-overlay i {
    font-size: 28px;
    color: #069999 !important; /* Icona sempre Verde */
    margin-left: 4px; 
    line-height: 1;
    margin-top: 0;
}

@keyframes ripple-effect {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* --- REEL OVERLAY --- */
#reel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease-out, border-radius 0.3s ease;
    overflow: hidden;
}

#reel-overlay.active {
    display: block;
    opacity: 1;
}

#reel-overlay .swiper {
    width: 100%;
    height: 100%;
}

#reel-overlay .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

/* Modalità Lettura (Sfondo scuro totale) */
#reel-overlay.reading-mode-active .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 5;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 5;
    pointer-events: none;
    transition: background 0.3s ease;
}

/* Video Wrapper */
.reel-video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.reel-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 100vh;
}

/* UI Overlay */
.reel-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 20px 85px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 80%);
    color: #fff;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.reel-text {
    flex: 1;
    padding-right: 15px;
    pointer-events: auto;
}

.reel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.reel-ui h5 {
    color: #fdd757;
    margin-bottom: 0;
    font-size: 0.85rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    line-height: 1.2;
}

.reel-ui p {
    color: #f0f0f0;
    font-size: 0.8rem;
    margin-bottom: 5px;
    line-height: 1.3;
    max-height: 50vh;
    overflow-y: auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.read-more, .read-less {
    font-weight: 600;
    color: #fdd757;
    cursor: pointer;
    margin-left: 5px;
}

.read-more:hover, .read-less:hover {
    text-decoration: underline;
}

/* Actions */
.reel-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 10px;
    pointer-events: auto;
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.btn-reel-action {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
}

.btn-reel-action:active {
    transform: scale(0.9);
}

.btn-reel-action.active {
    color: #e668b3;
    background: rgba(255, 255, 255, 0.9);
    animation: heartPop 0.3s ease-out;
}

.reel-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

/* Plyr Customization Reel */
#reel-overlay .plyr {
    width: 100%;
    height: 100%;
}

#reel-overlay .plyr__controls {
    padding-bottom: 40px;
}

/* Nasconde il bottone grande NEL REEL (perché c'è tap to play/pause) */
#reel-overlay .plyr__control--overlaid {
    display: none !important;
}

/* Utility Classes */
body.reel-active {
    overflow: hidden !important;
}
body.reel-active .btn-circle, 
body.reel-active #whatsapp-widget,
body.reel-active .tf-v1-sidetab-button { 
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ----------------------------------------------------------- */
/* PLYR OVERRIDES DESKTOP (BOTTONE BIANCO / VERDE BLINDATO) */
/* ----------------------------------------------------------- */

/* Regola unica per Normal, Hover e Focus: Sfondo BIANCO, Icona VERDE */
.plyr--video .plyr__control--overlaid,
.plyr--video .plyr__control--overlaid:hover,
.plyr--video .plyr__control--overlaid:focus {
    background: #ffffff !important;  /* Sfondo Cerchio: BIANCO */
    color: #069999 !important;       /* Colore base: VERDE */
    opacity: 1 !important;           /* Nessuna trasparenza */
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,.15) !important;
    border: none !important;         /* Rimuove eventuali bordi di default */
}

/* Regola specifica per l'icona SVG interna: RIEMPIMENTO VERDE */
.plyr--video .plyr__control--overlaid svg {
    fill: #069999 !important;        /* Icona Play: VERDE */
    stroke: #069999 !important;      /* Bordo Icona: VERDE (per sicurezza) */
}