/**
 * RV GDrive Player — Custom Styles
 *
 * Shared design system with RV YT Player (accent blue, Plyr overrides).
 * Includes watermark overlay, loading state, login screen.
 *
 * @package RV_GDrive_Player
 * @version 1.0.0
 */

/* ==============================
   Container
   ============================== */
.rv-gdrive-player-wrap {
    position: relative;
    width: 100%;
    margin: 1.5em auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    background: #000;
    transition: box-shadow 0.3s ease;
    -webkit-clip-path: inset(0 round 12px);
    clip-path: inset(0 round 12px);
    aspect-ratio: 16 / 9;
}

.rv-gdrive-player-wrap:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* ==============================
   Plyr Overrides — same as RV YT
   ============================== */

/* Accent color — brand blue */
.rv-gdrive-player-wrap .plyr {
    --plyr-color-main: #00b3ff;
    --plyr-video-control-color: #fff;
    --plyr-video-control-color-hover: #fff;
    --plyr-video-control-background-hover: rgba(0, 179, 255, 0.7);
    border-radius: 0 !important;
    height: 100%;
}

.rv-gdrive-player-wrap .plyr__video-wrapper {
    height: 100%;
}

/* Remove border-radius from inner Plyr elements */
.rv-gdrive-player-wrap .plyr__video-wrapper,
.rv-gdrive-player-wrap .plyr__poster,
.rv-gdrive-player-wrap .plyr__controls {
    border-radius: 0 !important;
}

/* Smooth fade for controls */
.rv-gdrive-player-wrap .plyr__controls {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)) !important;
    padding: 40px 10px 10px !important;
    transition: opacity 0.4s ease;
}

/* Progress bar */
.rv-gdrive-player-wrap .plyr__progress__buffer {
    background: rgba(255, 255, 255, 0.25);
}

/* Tooltip styling */
.rv-gdrive-player-wrap .plyr__tooltip {
    background: rgba(0, 0, 0, 0.85);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* Big play button */
.rv-gdrive-player-wrap .plyr__control--overlaid {
    background: rgba(0, 179, 255, 0.9) !important;
    border-radius: 50%;
    padding: 20px;
}

.rv-gdrive-player-wrap .plyr__control--overlaid:hover {
    background: #00b3ff !important;
    transform: translate(-50%, -50%) scale(1.1);
}

/* ==============================
   Loading State
   ============================== */
.rv-gdrive-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111;
    z-index: 5;
    color: #aaa;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    gap: 12px;
}

.rv-gdrive-loading.hidden {
    display: none;
}

.rv-gdrive-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 179, 255, 0.2);
    border-top-color: #00b3ff;
    border-radius: 50%;
    animation: rvgd-spin 0.8s linear infinite;
}

@keyframes rvgd-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==============================
   Watermark Canvas Overlay
   ============================== */
.rv-gdrive-watermark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.rv-gdrive-watermark.active {
    opacity: 1;
}

/* ==============================
   Login Required Screen
   ============================== */
.rv-gdrive-login-required {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.rv-gdrive-login-message {
    text-align: center;
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rv-gdrive-login-message svg {
    stroke: #00b3ff;
    margin-bottom: 12px;
}

.rv-gdrive-login-message p {
    font-size: 16px;
    margin: 0;
}

.rv-gdrive-login-message a {
    color: #00b3ff;
    text-decoration: none;
    font-weight: 600;
}

.rv-gdrive-login-message a:hover {
    text-decoration: underline;
}

/* ==============================
   Error State
   ============================== */
.rv-gdrive-error {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    color: #ff6b6b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    z-index: 6;
    padding: 20px;
    text-align: center;
}

.rv-gdrive-error.active {
    display: flex;
}

/* ==============================
   No Rounded Corners Variant
   ============================== */
.rv-gdrive-player-wrap.rv-gdrive-no-radius {
    border-radius: 0;
    -webkit-clip-path: none;
    clip-path: none;
}

/* ==============================
   Fullscreen — remove clip
   ============================== */
.rv-gdrive-player-wrap .plyr--fullscreen-fallback,
.rv-gdrive-player-wrap .plyr:-webkit-full-screen {
    border-radius: 0 !important;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 600px) {
    .rv-gdrive-player-wrap {
        border-radius: 8px;
        -webkit-clip-path: inset(0 round 8px);
        clip-path: inset(0 round 8px);
        margin: 1em auto;
    }

    .rv-gdrive-player-wrap .plyr__control--overlaid {
        padding: 15px;
    }

    .rv-gdrive-no-radius {
        border-radius: 0;
        -webkit-clip-path: none;
        clip-path: none;
    }
}