/**
 * VideoFullScreenAccessible
 * Componente video fullscreen con controlli accessibili, barra di avanzamento e loop.
 */

/* Video */
.video-fullscreen-accessible video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Progress bar */
.video-fullscreen-accessible .video-full-text-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background-color: var(--website-primary, #0d6efd);
    z-index: 10;
    transition: width 0.1s linear;
}

/* Play/Pause button - stato iniziale (grande, centrato) */
.video-fullscreen-accessible .video-full-text-btn {
    position: absolute;
    z-index: 20;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: width 0.4s ease, height 0.4s ease, bottom 0.4s ease, right 0.4s ease, top 0.4s ease, left 0.4s ease, transform 0.4s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.video-fullscreen-accessible .video-full-text-btn:hover {
    background: rgba(255, 255, 255, 1);
}

/* Stato centrato (grande) */
.video-fullscreen-accessible .video-full-text-btn.is-centered {
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.video-fullscreen-accessible .video-full-text-btn.is-centered svg {
    width: 36px;
    height: 36px;
}

/* Stato in basso a destra (piccolo) - posizione right calcolata via JS */
.video-fullscreen-accessible .video-full-text-btn.is-corner {
    width: 48px;
    height: 48px;
    bottom: 20px;
    right: 76px;
    top: auto;
    left: auto;
    transform: none;
    transition: width 0.4s ease, height 0.4s ease, bottom 0.4s ease, right 0.3s ease, top 0.4s ease, left 0.4s ease, transform 0.4s ease;
}

.video-fullscreen-accessible .video-full-text-btn.is-corner svg {
    width: 20px;
    height: 20px;
}

/* Container controlli audio in basso a destra */
.video-fullscreen-accessible .video-full-text-controls {
    position: absolute;
    z-index: 20;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Volume container */
.video-fullscreen-accessible .video-full-text-volume {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    padding: 0 12px;
    height: 48px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    width: 104px; /* 80px input + 24px padding */
    opacity: 1;
    transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.video-fullscreen-accessible .video-full-text-volume.is-hidden {
    width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

/* Volume range input */
.video-fullscreen-accessible .video-full-text-volume-input {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.video-fullscreen-accessible .video-full-text-volume-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
}

.video-fullscreen-accessible .video-full-text-volume-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #000;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.video-fullscreen-accessible .video-full-text-volume-input::-moz-range-track {
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Bottone audio (mute/unmute) */
.video-fullscreen-accessible .video-full-text-audio-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

.video-fullscreen-accessible .video-full-text-audio-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.video-fullscreen-accessible .video-full-text-audio-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Icona SVG nel bottone */
.video-fullscreen-accessible .video-full-text-btn svg {
    transition: width 0.3s ease, height 0.3s ease;
    fill: currentColor;
}

/* Accessibilità: focus visible */
.video-fullscreen-accessible .video-full-text-btn:focus-visible,
.video-fullscreen-accessible .video-full-text-audio-btn:focus-visible {
    outline: 3px solid var(--website-primary, #0d6efd);
    outline-offset: 3px;
}

.video-fullscreen-accessible .video-full-text-volume-input:focus-visible {
    outline: 3px solid var(--website-primary, #0d6efd);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Riduzione movimento */
@media (prefers-reduced-motion: reduce) {
    .video-fullscreen-accessible .video-full-text-btn,
    .video-fullscreen-accessible .video-full-text-progress,
    .video-fullscreen-accessible .video-full-text-volume {
        transition: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .video-fullscreen-accessible .video-full-text-btn.is-centered {
        width: 64px;
        height: 64px;
    }

    .video-fullscreen-accessible .video-full-text-btn.is-centered svg {
        width: 28px;
        height: 28px;
    }

    .video-fullscreen-accessible .video-full-text-btn.is-corner {
        width: 40px;
        height: 40px;
        bottom: 12px;
    }

    .video-fullscreen-accessible .video-full-text-btn.is-corner svg {
        width: 18px;
        height: 18px;
    }

    .video-fullscreen-accessible .video-full-text-audio-btn {
        width: 40px;
        height: 40px;
    }

    .video-fullscreen-accessible .video-full-text-audio-btn svg {
        width: 18px;
        height: 18px;
    }

    .video-fullscreen-accessible .video-full-text-controls {
        bottom: 12px;
        right: 12px;
        gap: 6px;
    }

    .video-fullscreen-accessible .video-full-text-volume {
        height: 40px;
        padding: 0 10px;
        width: 80px; /* 60px input + 20px padding */
    }

    .video-fullscreen-accessible .video-full-text-volume-input {
        width: 60px;
    }
}
