/**
 * Videohub360 Plugin Integration Styles
 * 
 * Custom styling for Videohub360 video player and components
 * 
 * @package Videohub360_Theme
 * @since 1.0.0
 */


/* ==========================================================================
   Single Video Template Theme Surface
   ========================================================================== */

/*
 * The core plugin uses --vh360-bg-white for the single video wrapper.
 * Override it here so the single video page follows the theme Customizer
 * Main Background color instead of forcing the plugin white surface.
 */
.single-videohub360 .videohub360-main-wrapper {
    background: var(--bg-color, transparent);
}

/* ==========================================================================
   Video Grid Layout
   ========================================================================== */

.video-archive-layout .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem 1.5rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .video-archive-layout .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Video Card Styling
   ========================================================================== */

.video-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.video-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.video-thumbnail {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

/* Live Badge */
.live-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: #e53935;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 10;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

/* Support for custom badge colors via data attribute */
.live-badge[data-badge-color] {
    background: var(--badge-color, #e53935);
}

/* Set custom badge color from data attribute via inline style override if needed */
.live-badge {
    background-color: var(--badge-color, #e53935);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Play Button */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: var(--transition);
    pointer-events: none;
}

.video-item:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Info */
.video-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.video-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.video-title a {
    color: var(--text-color);
    text-decoration: none;
}

.video-title a:hover {
    color: var(--primary-color);
}

.video-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.video-meta > span:not(:last-child)::after {
    content: '•';
    margin-left: 0.75rem;
    color: var(--border-color);
}

/* ==========================================================================
   Video Meta Container
   ========================================================================== */

.videohub360-meta-container {
    padding: 1.5rem 0;
}

.videohub360-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.videohub360-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.videohub360-views-info {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ==========================================================================
   Chat Integration
   ========================================================================== */

.videohub360-live-chat {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.videohub360-chat-header {
    padding: 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.videohub360-chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.videohub360-chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .videohub360-title {
        font-size: 1.5rem;
    }
    
    .videohub360-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.videohub360-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-light);
}

.videohub360-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
