/* 
  Danmaku Stylesheet for the Anniversary Site
*/

#blessings .blessings-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: auto; /* Enable clicks on danmaku */
    z-index: 10; /* Higher z-index to ensure clickability */
}

.danmaku-card {
    position: absolute;
    transform: translateX(100vw); /* Start off-screen to the right */
    background: linear-gradient(120deg, rgba(238, 119, 102, 0.3) 0%, rgba(233, 178, 142, 0.2) 100%);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
    animation-name: danmaku-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    cursor: pointer; /* Add cursor pointer to indicate clickable */
    z-index: 15; /* Higher z-index for individual cards */
    transition: all 0.3s ease;
}

/* 初始弹幕样式 - 从30%处开始 */
.danmaku-card.initial {
    animation-name: danmaku-scroll-initial;
}

/* 选中状态的弹幕样式 */
.danmaku-card.selected,
.blessing-bubble.selected {
    background: linear-gradient(120deg, rgba(199, 32, 45, 0.8) 0%, rgba(238, 119, 102, 0.6) 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(199, 32, 45, 0.5), inset 0 1px 2px rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* 移动端弹幕样式 */
.blessing-bubble {
    position: absolute;
    background: linear-gradient(120deg, rgba(238, 119, 102, 0.4) 0%, rgba(233, 178, 142, 0.3) 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(3px);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    animation: bubble-float 15s linear infinite;
}

/* 初始移动端弹幕样式 - 从30%处开始 */
.blessing-bubble.initial {
    animation-name: bubble-float-initial;
}

@keyframes bubble-float {
    0% {
        transform: translateX(100vw) translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(-100%) translateY(-20px);
        opacity: 0;
    }
}

/* 初始弹幕动画 - 从30%处开始 */
@keyframes bubble-float-initial {
    0% {
        transform: translateX(20vw) translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(-100%) translateY(-20px);
        opacity: 0;
    }
}

@keyframes danmaku-scroll {
    from {
        transform: translateX(100vw);
    }
    to {
        transform: translateX(-100%);
    }
}

/* 初始弹幕动画 - 从30%处开始 */
@keyframes danmaku-scroll-initial {
    from {
        transform: translateX(30vw);
    }
    to {
        transform: translateX(-100%);
    }
}

/* === View-switching for Blessings section (New Implementation) === */

#blessings {

}

.blessing-view-slider {
    width: 100%;
    height: 100%;
}

.blessing-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.7s;
}

.text-view {
    transform: translateX(0);
    opacity: 1;
    z-index: 2; /* Start on top */
}

.video-view {
    transform: translateX(100%); /* Start off-screen to the right */
    opacity: 0;
    z-index: 1;
}

/* When .video-mode is active, slide the views */
#blessings.video-mode .text-view {
    transform: translateX(-100%); /* Slide out to the left */
    opacity: 0;
    z-index: 1;
}

#blessings.video-mode .video-view {
    transform: translateX(0); /* Slide in from the right */
    opacity: 1;
    z-index: 2; /* Come to the front */
}

/* === Navigation Buttons === */

.video-blessing-btn, .back-to-danmaku-btn {
    position: absolute;
    z-index: 10;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    backdrop-filter: blur(8px);
    transition: background-color 0.3s, transform 0.4s ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.video-blessing-btn:hover, .back-to-danmaku-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
/* Specific transform for vertical button */
.video-blessing-btn:hover {
     transform: translateY(-50%) scale(1.05);
}

.video-blessing-btn {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 35px 18px;
    border-radius: 60px 0 0 60px;
    border-right: none;
    font-size: 1.15rem;
    letter-spacing: 3px;
    font-weight: 300;
}
.video-blessing-btn span::after {
    content: ' ›';
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
}

#blessings.video-mode .video-blessing-btn {
    transform: translate(100%, -50%); /* Hide the button when video is active */
}

.back-to-danmaku-btn {
    border-radius: 50px;
    padding: 15px 35px;
    margin-top: 30px;
    font-size: 1rem;
    font-weight: 500;
}
.back-to-danmaku-btn:hover {
    transform: scale(1.1);
}

/* === Video View Styles === */

.video-gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}
.video-gallery-container .section-title h2 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    width: 100%;
    max-width: 900px;
}
.video-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}
.video-thumb:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.video-thumb:hover img {
    transform: scale(1.1);
}
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}
.play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 18px;
    border-color: transparent transparent transparent white;
    margin-left: 4px;
}
.video-thumb:hover .play-icon {
    background-color: #c7202d;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .video-gallery-container {
        padding: 20px;
    }
    .video-gallery-container .section-title h2 {
        font-size: 2rem;
    }
    .video-blessing-btn {
        padding: 25px 12px;
        font-size: 1rem;
    }
    .back-to-danmaku-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .video-gallery {
        grid-template-columns: 1fr;
    }
}