/* Hero Video Smart Loading Styles */

.hero__video {
    transition: opacity 0.5s ease-in-out;
}

/* Loading States */
.hero__video[data-smart-loading="true"] {
    position: relative;
}

.hero__video[data-loading="true"] {
    opacity: 0.7;
}

.hero__video[data-loading="false"] {
    opacity: 1;
}

/* Loading Indicator */
.hero__video::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #DC143C;
    border-radius: 50%;
    animation: video-loading-spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.hero__video[data-loading="true"]::before {
    opacity: 1;
}

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

/* Video Quality Badge */
.hero__video-quality-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero__video[data-quality="original"] + .hero__video-quality-badge {
    background: rgba(34, 197, 94, 0.8);
    opacity: 1;
}

.hero__video[data-quality="fallback"] + .hero__video-quality-badge {
    background: rgba(251, 146, 60, 0.8);
    opacity: 1;
}

.hero__video[data-quality="poster"] + .hero__video-quality-badge {
    background: rgba(239, 68, 68, 0.8);
    opacity: 1;
}

/* Fallback Image Transition */
.hero__fallback-image {
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

.hero__fallback-image.active {
    opacity: 1;
}

/* Error State */
.hero__video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    text-align: center;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero__video-error.show {
    opacity: 1;
}

.hero__video-error button {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.hero__video-error button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero__video-quality-badge {
        top: 10px;
        right: 10px;
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .hero__video::before {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    
    .hero__video-error {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Performance Optimizations */
.hero__video {
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .hero__video,
    .hero__video-quality-badge,
    .hero__fallback-image,
    .hero__video-error {
        transition: none;
    }
    
    @keyframes video-loading-spin {
        to {
            transform: translate(-50%, -50%) rotate(360deg);
        }
    }
}