/* ========================================
   Web4WPW TV Widget Shorts And Videos - CSS
   ======================================== */

/* ========================================
   IMAGE EN-TÊTE (optionnelle)
   ======================================== */
.shorts-header-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 10px 5px;
}

.shorts-header-image img {
    max-width: 80%;
    height: auto;
    display: block;
}

.shorts-footer-image {
    padding: 5px 10px 10px;
}

.shorts-header-urgent {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 10px 5px;
}

.shorts-header-urgent .shorts-button-urgent {
    color: red !important;
    font-weight: bold !important;
}


.shorts-button-urgent {
    color: #c00000 !important;
}

@media screen and (max-width: 768px) {
    .shorts-header-image img {
        max-width: 70%;
    }
}

@media screen and (max-width: 480px) {
    .shorts-header-image {
        padding: 8px 8px 4px;
    }
    .shorts-header-image img {
        max-width: 65%;
    }
    .shorts-header-urgent {
        padding: 8px 8px 4px;
    }
}

.shorts-widget {
    margin: 20px;
    padding: 10px;
    margin-bottom: 15px;
    background: white;
    border-radius: 20px !important;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 10px rgba(0, 0, 0, 0.25)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.18));
}

@media screen and (max-width: 768px) {
    .shorts-widget {
        margin: 5px;
        font-size: 12px;
    }
}

/* ========================================
   FRAME & SCREEN
   ======================================== */
.shorts-frame {
    position: relative;
    height: 0;
    overflow: hidden;
    border-radius: 15px;
    max-width: 100%;
    margin: 0 auto;
}

.shorts-ratio-9-16 .shorts-frame {
    padding-bottom: 177.78%;
    max-width: 350px;
}

@media screen and (min-width: 768px) {
    .shorts-ratio-9-16 .shorts-frame { max-width: 400px; }
}

@media screen and (min-width: 992px) {
    .shorts-ratio-9-16 .shorts-frame { max-width: 450px; }
}

.shorts-ratio-16-9 .shorts-frame {
    padding-bottom: 56.25%;
}

.shorts-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #141314;
    display: block;
    border-radius: 15px;
    overflow: hidden;
}

.shorts-video-container {
    width: 100%;
    height: 100%;
}

.shorts-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   CONTRÔLES
   ======================================== */
.shorts-controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.shorts-button {
    display: inline-block;
    padding: 6px 20px;
    text-decoration: none;
    font-size: 1em;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    border-radius: 20px 0 !important;
}

.shorts-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5);
}

.shorts-sound-btn {
    display: inline-block;
    padding: 6px 20px;
    text-decoration: none;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-radius: 50% !important;
    border: none !important;
    touch-action: manipulation;
}

.shorts-sound-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5);
}

.shorts-sound-btn .shorts-sound-icon {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    pointer-events: none;
}

/* ================================================================
   CLASSEUR MODE
   ================================================================ */
.shorts-anim-book .shorts-frame {
    overflow: visible;
}

/* ================================================================
   RELIURE : Masquee
   ================================================================ */
.shorts-book-binding {
    display: none;
}

/* ================================================================
   PAGES DU CLASSEUR : Masquees
   ================================================================ */
.shorts-book-pages {
    display: none;
}

/* ================================================================
   ÉCRAN VIDÉO - Pleine largeur (comme standard)
   ================================================================ */
.shorts-anim-book .shorts-screen {
    left: 0;
    width: 100%;
    border-radius: 15px;
    z-index: 10;
}

/* ================================================================
   ANIMATION - Page qui tourne
   ================================================================ */
.shorts-book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    perspective: 2500px;
    overflow: visible;
}

.shorts-book-page-turn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform: rotateY(0deg);
    opacity: 0;
    border-radius: 0 8px 8px 0;
    /* Par défaut page blanche, remplacé par JS avec la miniature vidéo */
    background-color: #141314;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: none;
    backface-visibility: hidden;
    overflow: hidden;
}

/* Léger assombrissement sur le bord gauche (effet pli) */
.shorts-book-page-turn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.15), transparent);
    z-index: 1;
}

/* Coin corné */
.shorts-book-page-turn::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, rgba(20,19,20,0.6) 42%, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.9) 100%);
    border-radius: 0 0 8px 0;
}

.shorts-book-overlay.shorts-book-turning .shorts-book-page-turn {
    animation: shortsPageTurn 2.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes shortsPageTurn {
    0%   { transform: rotateY(0deg) scale(1); opacity: 1; }
    10%  { transform: rotateY(-12deg) scale(1.005); opacity: 1; }
    25%  { transform: rotateY(-40deg) scale(1.01); opacity: 1; }
    40%  { transform: rotateY(-72deg) scale(1.012); opacity: 1; }
    50%  { transform: rotateY(-90deg) scale(1.008); opacity: 1; }
    65%  { transform: rotateY(-118deg) scale(1); opacity: 0.8; }
    80%  { transform: rotateY(-152deg); opacity: 0.4; }
    100% { transform: rotateY(-180deg); opacity: 0; }
}

.shorts-book-overlay.shorts-book-turning::after {
    display: none;
}

/* ================================================================
   RESPONSIVE - Tablette
   ================================================================ */
@media screen and (max-width: 768px) {
    .shorts-controls-container { gap: 8px; }
}

/* ================================================================
   RESPONSIVE - Mobile
   ================================================================ */
@media screen and (max-width: 480px) {
    .shorts-controls-container { gap: 6px; }
    .shorts-ratio-9-16 .shorts-frame { max-width: 100%; }
}
