/**
 * Streaming Lazy Load Styles
 * 
 * Styles for lazy-loaded streaming iframes with loading placeholders
 * and platform-specific theming.
 * 
 * Requirements: 14.5
 */

/* ============================================
   Lazy Load Container
   ============================================ */

.streaming-lazy-container {
    position: relative;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.streaming-lazy-container.loading {
    cursor: wait;
}

.streaming-lazy-container.loaded {
    background-color: transparent;
}

.streaming-lazy-container.error {
    background-color: #1a1a1a;
}

/* ============================================
   Streaming Iframe
   ============================================ */

.streaming-iframe {
    border: none;
    border-radius: 8px;
}

.streaming-iframe-youtube {
    /* YouTube-specific styles if needed */
}

.streaming-iframe-facebook {
    /* Facebook-specific styles if needed */
}

/* ============================================
   Placeholder Base Styles
   ============================================ */

.streaming-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    z-index: 1;
    transition: opacity 0.3s ease-out;
}

.streaming-placeholder-content {
    text-align: center;
    color: #fff;
    padding: 2rem;
}

.streaming-placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: placeholder-icon-pulse 2s ease-in-out infinite;
}

@keyframes placeholder-icon-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.streaming-placeholder-spinner {
    margin-bottom: 1rem;
}

.streaming-placeholder-spinner .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
}

.streaming-placeholder-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ============================================
   Platform-Specific Placeholders
   ============================================ */

/* YouTube Placeholder */
.streaming-placeholder-youtube {
    background: linear-gradient(135deg, #1a1a1a 0%, #282828 50%, #1a1a1a 100%);
}

.streaming-placeholder-youtube .streaming-placeholder-icon {
    color: #FF0000;
}

.streaming-placeholder-youtube::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 0, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Facebook Placeholder */
.streaming-placeholder-facebook {
    background: linear-gradient(135deg, #1a1a1a 0%, #1e3a5f 50%, #1a1a1a 100%);
}

.streaming-placeholder-facebook .streaming-placeholder-icon {
    color: #1877F2;
}

.streaming-placeholder-facebook::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(24, 119, 242, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================
   Error State
   ============================================ */

.streaming-error {
    text-align: center;
    color: #fff;
    padding: 2rem;
}

.streaming-error i {
    font-size: 3rem;
    color: #ffc107;
    margin-bottom: 1rem;
    display: block;
}

.streaming-error p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.streaming-error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.streaming-error-actions .btn {
    min-width: 120px;
}

/* ============================================
   Loading Animation
   ============================================ */

.streaming-lazy-container.loading .streaming-placeholder::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent 100%
    );
    animation: loading-bar 1.5s ease-in-out infinite;
}

@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   Skeleton Loading (Alternative Style)
   ============================================ */

.streaming-skeleton {
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
}

.streaming-skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .streaming-placeholder-icon {
        font-size: 3rem;
    }
    
    .streaming-placeholder-content {
        padding: 1.5rem;
    }
    
    .streaming-placeholder-text {
        font-size: 0.85rem;
    }
    
    .streaming-error i {
        font-size: 2.5rem;
    }
    
    .streaming-error p {
        font-size: 0.9rem;
    }
    
    .streaming-error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .streaming-error-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .streaming-placeholder-icon {
        font-size: 2.5rem;
    }
    
    .streaming-placeholder-content {
        padding: 1rem;
    }
    
    .streaming-placeholder-spinner .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .streaming-placeholder-icon,
    .streaming-lazy-container.loading .streaming-placeholder::after,
    .streaming-skeleton::before {
        animation: none;
    }
    
    .streaming-placeholder {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .streaming-placeholder {
        background: #000;
        border: 2px solid #fff;
    }
    
    .streaming-placeholder-text {
        color: #fff;
    }
    
    .streaming-error {
        background: #000;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .streaming-lazy-container {
        display: none;
    }
}
