/**
 * PIP (Picture-in-Picture) Widget Styles
 */

.tbvw-pip-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000;
}

.tbvw-pip-widget:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Size variations */
.tbvw-pip-widget.size-small {
    width: 100px;
    height: 180px;
}

.tbvw-pip-widget.size-medium {
    width: 120px;
    height: 220px;
}

.tbvw-pip-widget.size-large {
    width: 150px;
    height: 270px;
}

/* Video container */
.tbvw-pip-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.tbvw-pip-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video info overlay */
.tbvw-pip-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 10px;
    color: #fff;
    font-size: 11px;
    transition: opacity 0.3s ease;
}

.tbvw-pip-widget:not(:hover) .tbvw-pip-overlay {
    opacity: 0;
}

/* Progress bar */
.tbvw-pip-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
}

.tbvw-pip-progress-bar {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

/* Close button - Top right corner INSIDE widget */
.tbvw-pip-close {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    width: 32px !important;
    height: 32px !important;
    min-height: var(--btn-height, 25px) !important;
    color: #333 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    z-index: 999999 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.tbvw-pip-close:hover {
    background: #f0f0f0 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.tbvw-pip-close .dashicons,
.tbvw-pip-close .dashicons-before:before {
    line-height: 1 !important;
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    color: #333 !important;
    vertical-align: middle !important;
}

/* Unmute button - Top left corner INSIDE widget */
.tbvw-pip-unmute {
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    width: 32px !important;
    height: 32px !important;
    min-height: var(--btn-height, 25px) !important;
    color: #333 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    z-index: 999999 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.tbvw-pip-unmute:hover {
    background: #f0f0f0 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.tbvw-pip-unmute .dashicons,
.tbvw-pip-unmute .dashicons-before:before {
    line-height: 1 !important;
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    color: #333 !important;
    vertical-align: middle !important;
}

/* Play/Pause overlay */
.tbvw-pip-play-pause {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tbvw-pip-widget.paused .tbvw-pip-play-pause {
    opacity: 1;
}

/* Loading state */
.tbvw-pip-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tbvw-spin 0.8s linear infinite;
}

@keyframes tbvw-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade in animation */
@keyframes tbvw-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tbvw-pip-widget.tbvw-fade-in {
    animation: tbvw-fade-in 0.5s ease forwards;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tbvw-pip-widget {
        bottom: 10px;
        left: 10px;
    }
    
    .tbvw-pip-widget.size-small {
        width: 80px;
        height: 144px;
    }
    
    .tbvw-pip-widget.size-medium {
        width: 100px;
        height: 180px;
    }
    
    .tbvw-pip-widget.size-large {
        width: 120px;
        height: 216px;
    }
    
    .tbvw-pip-close,
    .tbvw-pip-unmute {
        width: 28px !important;
        height: 28px !important;
        top: 3px !important;
        border-radius: 6px !important;
    }
    
    .tbvw-pip-close {
        right: 3px !important;
    }
    
    .tbvw-pip-unmute {
        left: 3px !important;
    }
    
    .tbvw-pip-close .dashicons,
    .tbvw-pip-unmute .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
}

/* Hidden state */
.tbvw-pip-widget.hidden {
    display: none;
}

