/* Reset body styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto; /* Enable vertical scrolling */
}

/* Specific styles for sakura.html navbar */
body:has(nav.navbar) .navTitle {
    color: rgb(248, 153, 251); /* Pink color for the title */
}

body:has(nav.navbar) .nav-links li a {
    color: rgb(241, 167, 244); /* Pink color for the links */
}

body:has(nav.navbar) .navbar {
    background: rgba(255, 228, 240, 0.9);
}

body:has(nav.navbar) .nav-links {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 50px;
    justify-content: center;
    width: auto;
}

/* Split reveal animation styles */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
}

.split-left, .split-right {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-image: url('../pic/sakura_cg/Overlay.png');
    background-size: 100vw 100vh;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 1.5s ease-in-out;
}

.split-left {
    left: 0;
    background-position: left center;
    transform: translateX(0);
}

.split-right {
    right: 0;
    background-position: right center;
    transform: translateX(0);
}

/* Add new classes for the animation */
.bg-overlay.hide {
    visibility: hidden;
}

.split-left.reveal {
    transform: translateX(-120%);
}

.split-right.reveal {
    transform: translateX(120%);
}

/* Keep the keyframes for reference but they won't be used directly */
@keyframes hide-overlay {
    to {
        visibility: hidden;
    }
}

@keyframes split-left-reveal {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-120%);
    }
}

@keyframes split-right-reveal {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(120%);
    }
}

.sakura-generator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.page1 {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

.bg1-container {
    width: 100%;
    height: 80vh; /* Fixed height container */
    position: relative;
    overflow: hidden; /* Crop any overflow */
}

.page1 .bg1 {
    position: absolute;
    top: 0; /* Position from top */
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* Align image to top */
    transform-origin: center;
    animation: scaleDown 30s ease-out forwards;
}

@keyframes scaleDown {
    0% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.trailer {
    width: 100%;
    height: 20%;
    background-color: rgba(248, 171, 226, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    gap: 30px; /* Space between the two trailers */
}

.trailer a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 25%; /* Each trailer takes up less than half the width */
    text-decoration: none;
    transition: transform 0.3s ease;
}

.trailer img {
    height: 55%;
    object-fit: contain; /* Changed from cover to contain to maintain aspect ratio */
    z-index: 999;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.trailer a:hover img {
    transform: scale(1.1);
}

.music-container {
    background-color: rgba(255, 228, 240, 0.7);
    border-radius: 15px;
    display: flex;
    padding: 20px 30px;
    position: relative;
    margin: 70px 0;
    z-index: 10;
    margin-bottom: 0%;
}

.img-container {
    position: relative;
    width: 110px;
}

.img-container::after {
    content: "";
    background-color: rgba(255, 228, 240, 0.7);
    border-radius: 50%;
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 15px;
    height: 15px;
    transform: translate(-50%, 50%);
}

.img-container img {
    border-radius: 50%;
    height: 110px;
    width: inherit;
    object-fit: cover;
    position: absolute;
    bottom: 0;
    left: 0;
    /* 封面360°旋转，默认不动 */
    animation: rotate 3s linear infinite;
    animation-play-state: paused;
}

.music-container.play .img-container img {
    /* 播放 */
    animation-play-state: running;
}

/* 定义旋转动画 */
@keyframes rotate {
    from {
        transform: rotate(0);
    }

    to {
        transform: rotate(360deg);
    }
}

.navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.action-btn {
    border: 0;
    background-color: rgba(255, 228, 240, 0.7);
    color: #ff69b4;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    margin: 0 20px;
    border-radius: 15px;
}

.action-btn:focus {
    /* 取消默认样式 */
    outline: 0;
}

.action-btn.action-btn-big {
    color: #fb369f;
    font-size: 30px;
}

.music-info {
    position: absolute;
    top: 0;
    left: 20px;
    width: 50%;
    background-color: rgba(255, 228, 240, 0.7);
    border-radius: 15px 15px 0 0;
    padding: 10px 10px 10px 150px;
    opacity: 0;
    transform: translateY(0%);
    transition: transform 0.3s ease-in, opacity 0.3s ease-in;
    z-index: 0;
}

.music-info h4 {
    /* 取消默认边距 */
    margin: 0;
}

.music-container.play .music-info {
    opacity: 1;
    transform: translateY(-100%);
}

.progress-container {
    background-color: rgba(240, 248, 255, 0.7);
    border-radius: 5px;
    cursor: pointer;
    margin: 10px 0;
    height: 4px;
    width: 100%;
}

.progress {
    background-color: #fb369f;
    border-radius: 5px;
    height: 100%;
    /* 一开始进度条长度为0 */
    width: 0%;
    transition: width 0.1s linear;

}

.page2 {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: rgba(248, 171, 226, 0.2);
    position: relative;
}

.page2::before {
    content: "Art Gallery";
    color: white;
    font-family: 'Courier New', Courier, monospace;
    font-size: 70px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 53%;
    left: 53%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none; /* Ensures text doesn't interfere with painting interactions */
}

.painting-wrapper {
    position: relative;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* Ensures paintings stay above the text */
}

.page2 ul {
    position: relative;
    display: flex;
    list-style: none;
    margin-block-start: 1em;
    margin-block-end: 1em;
    padding-inline-start: 40px;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.page2 li{
    display: list-item;
}

.page2 .painting-img-container {
    position: absolute;
    width: 50%;
    margin: 10%
}

.painting-img-container .frame {
    position: absolute;
    width: 60%;
    margin-left: 35%;
    margin-top: 10%;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 1));
    transition: all 0.3s ease-out;
    border-radius: 8px;
}

.painting-img-container .easal {
    position: absolute;
    width: 50%;
    margin-left: 25%;
    margin-top: -10%;
    transition: all 0.3s ease-out;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.1));
}

.painting-img-container img.painting {
    position: absolute;
    width: 70%;
    margin: 0;
    filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    cursor: pointer;
    transform-origin: center;
}

/* Special style for the vase painting */
.painting-img-container img.painting.vase {
    width: 85%;
    margin-left: -7.5%; /* Center the larger image */
}

/* Hover effects for paintings */
.painting-img-container:hover img.painting {
    filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.6));
}

/* Special hover effect for vase */
.painting-img-container:hover img.painting.vase {
    filter: drop-shadow(0 30px 30px rgba(0, 0, 0, 0.7));
}

/* Add a pseudo-element for additional shadow depth */
.painting-img-container::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    filter: blur(25px);
    transform: translateY(25px) scale(0.9);
    z-index: -1;
    opacity: 0.6;
    transition: all 0.3s ease-out;
    border-radius: 8px;
}

.page2 .painting-wrapper .painting-item:nth-child(1) {
    position: absolute;
    left: 10%;
    top: 10%;
    width: 50%;
    height: 50%;
}

.page2 .painting-wrapper .painting-item:nth-child(2) {
    position: absolute;
    left: 35%;
    top: 5%;
    width: 50%;
    height: 50%;
}

.page2 .painting-wrapper .painting-item:nth-child(3) {
    position: absolute;
    left: 65%;
    top: 8%;
    width: 50%;
    height: 50%;
}

.page2 .painting-wrapper .painting-item:nth-child(4) {
    position: absolute;
    left: 0%;
    top: 42%;
    width: 50%;
    height: 50%;
}

.page2 .painting-wrapper .painting-item:nth-child(5) {
    position: absolute;
    left: 25%;
    top: 60%;
    width: 50%;
    height: 50%;
}

.page2 .painting-wrapper .painting-item:nth-child(6) {
    position: absolute;
    left: 50%;
    top: 57%;
    width: 50%;
    height: 50%;
}

.page2 .painting-wrapper .painting-item:nth-child(7) {
    position: absolute;
    left: 70%;
    top: 40%;
    width: 50%;
    height: 50%;
}

.galgame-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(248, 171, 226, 0.2);
}

.galgame-container {
    position: relative;
    width: 80%;
    height: 80vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    font-family: YakuHanJP, noto-sans-cjk-jp, "Hiragino Kaku Gothic ProN", "游ゴシック", YuGothic, Meiryo, Verdana, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.gal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.name-bar{
    position: absolute;
    bottom: 21%;
    left: 2.5%;
    font-size: 20px;
    color: white;
}

.galgame-text-box {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 20%;
    background-color: rgba(226, 223, 223, 0.9);
    color: white;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    box-sizing: border-box;
}

.galgame-text-box p{
    position: absolute;
    margin: 10px;
    font-size: 20px;
}

.show-text{
    font-size: 15px;
    width: 8%;
    height: 20px;
    text-align: center;
    position: absolute;
    right: 5%;
    top: -15%;
    transition: 0.4s ease;
    cursor: pointer;
    border-radius: 5px;
    background-color: rgba(226, 223, 223, 0.9);
}

.show-text:hover{
    transform: scale(1.15);
}

.show-text-page {
    height: 80%;
    width: 100%;
    background-color: rgba(226, 223, 223, 0.626);
    position: absolute;
    top: 0;
    overflow-y: scroll;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.show-text-box{
    font-size: 20px;
}

.click-continue {
    width: 20px;
    height: 20px;
    position: absolute;
    right: 5%;
    bottom: 15px;
    cursor: pointer;
    animation: bounce 1.2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.page3 {
    width: 100%;
    min-height: 100vh;
    background-color: rgba(248, 171, 226, 0.2);
    padding: 5%;
    column-count: 4;
    column-gap: 30px;
    column-fill: balance;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .page3 {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .page3 {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .page3 {
        column-count: 1;
    }
}

.item {
    break-inside: avoid;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    padding: 10px;
    box-sizing: border-box;
}

.item:hover {
    transform: scale(1.02);
}

.item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.item img:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.page3 .item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.page3 .item::after {
    content: attr(data-song);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    background: linear-gradient(to top, 
        rgba(255, 192, 203, 0.4),  /* Light pink with 40% opacity */
        rgba(255, 192, 203, 0)     /* Transparent */
    );
    color: white;
    font-size: 1.1em;
    opacity: 0;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
    transform: translateY(100%);
    font-family: "Hiragino Kaku Gothic ProN", "游ゴシック", YuGothic, Meiryo, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.page3 .item:hover::after {
    opacity: 1;
    transform: translateY(0);
}


