/* Hero Video 组件样式 */
/* 使用组件前缀 video-hero- 避免与其他组件冲突 */

/* Hero Section - 全屏视频容器 */
.video-hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-primary, #333);
    text-align: center;
    background-color: #f8f9fa;
    box-sizing: border-box;
}

/* 使用动态视口高度，避免移动端地址栏影响 */
@supports (height: 100dvh) {
    .video-hero-section {
        height: 100dvh;
    }
}

/* Preload Image - 视频加载前的占位图 */
.video-hero-preload-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.video-hero-preload-img.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Video Background */
.video-hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: opacity;
    display: block;
}

.video-hero-video-bg.loaded {
    opacity: 1 !important;
    z-index: 1;
}

/* Safari 特定修复：确保视频可见 */
@supports (-webkit-appearance: none) {
    .video-hero-video-bg.loaded,
    .video-hero-video-bg[data-loaded="true"] {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Light Overlay for Hero */
.video-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    z-index: 2;
}

/* Hero Content with Glassmorphism Effect */
.video-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 900px;
    padding: 60px 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin: 0 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Hero Slider */
.video-hero-slider {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero Slide */
.video-hero-slide {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-40%);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Active Slide */
.video-hero-slide.active {
    opacity: 1;
    transform: translateY(-50%);
    pointer-events: all;
    position: absolute;
}

/* Hero Title */
.video-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-primary, #333);
    line-height: 1.3;
    text-shadow: none;
}

/* Gradient Text */
.video-hero-gradient-text {
    background: linear-gradient(135deg, #8B5CF6 0%, #FFB6C1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Hero Subtitle */
.video-hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #333;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
}

/* Primary Gradient Button */
.btn-primary-gradient {
    background: linear-gradient(135deg, #8B5CF6 0%, #FFB6C1 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 30px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
    color: #fff;
}

/* Hero Bottom Bar - 初始状态固定在视口底部，视频滚动时跟随视频 */
.video-hero-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(255, 182, 193, 0.9) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 15px 0;
    color: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 10;
    margin: 0;
    border: none;
    box-sizing: border-box;
    transition: none; /* 移除过渡，让JavaScript直接控制 */
}

/* Keywords Links */
.video-hero-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.video-hero-keywords a {
    color: rgba(255, 255, 255, 0.95);
    margin: 0 6px;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
}

.video-hero-keywords a:hover {
    color: #8B5CF6;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* Hero Section Adjustments */
    .video-hero-section {
        position: relative !important;
        height: auto !important;
        min-height: 500px !important;
        padding: 0;
        overflow: hidden !important;
    }

    .video-hero-preload-img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .video-hero-video-bg {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        transform: none !important;
        -webkit-transform: none !important;
        object-fit: cover !important;
    }

    .video-hero-video-bg.loaded {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .video-hero-content {
        padding: 40px 20px !important;
        margin: 0 15px;
        height: auto !important;
        min-height: auto !important;
        border-radius: 20px;
    }

    .video-hero-slider {
        height: auto !important;
        display: block !important;
        position: relative !important;
    }

    .video-hero-slide {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        width: 100% !important;
        display: none !important;
        padding: 10px 0;
        margin: 0 !important;
    }

    .video-hero-slide.active {
        display: block !important;
    }

    .video-hero-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px;
        line-height: 1.3;
        word-wrap: break-word;
        white-space: normal;
    }

    .video-hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 25px;
        line-height: 1.6;
        white-space: normal;
    }

    .btn-primary-gradient {
        padding: 10px 24px;
        font-size: 0.9rem;
        white-space: nowrap;
        display: inline-block;
        margin: 5px;
    }

    .d-flex.gap-3 {
        display: block !important;
        text-align: center;
    }

    .video-hero-bottom-bar {
        padding: 15px 0;
        position: absolute !important;
        bottom: 0 !important;
    }

    .video-hero-keywords {
        width: 100%;
    }

    .video-hero-keywords a {
        margin: 5px 3px;
        font-size: 0.85rem;
        padding: 4px 10px;
    }
}
