html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: top 0.8s ease-in-out; /* top속성이 바뀔 때 애니메이션 효과를 줌 */
}

.container {
    width: 100%;
    height: 100vh;
    display: flex; /* 자식 요소들이 flex아이템 */
    flex-direction: column; /* 자식요소들을 위아래로 정렬 */
    justify-content: center; /* 세로 방향으로 자식요소들을 중앙 정렬 */
    align-items: center; /* 가로 방향으로 자식요소들을 중앙 정렬 */
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 원페이지 스크롤에서 container 첫번째, 두번째 */
.container:nth-child(1),
.container:nth-child(2) {
    background-image: url("../images/backgroundImg1.png");
    z-index: 0; /* 요소들 간에 앞으로 올건지 뒤에 올건지 결정 낮을 수록 우선순위가 낮음 */
}
.container:nth-child(3) {
    background-image: url("../images/공항.jpg");
    z-index: 0;
}

.container .overlay-first {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* not선택자로 오버레이되지 않은 요소들을 위로 보내기위해 z-index: 2로 설정 */
.container > *:not(.overlay-first) {
    position: relative;
    z-index: 2;
}

.container:nth-child(1) h2 {
    font-size: 40px;
    color: white;
}

.animated-text {
    position: relative;
    font-size: 40px;
    font-weight: bold;
    color: white; /* 기본 흰색 텍스트 */
}

/* 글자 위에 덧씌울 분홍색 텍스트 */
.animated-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 0;
    height: 100%;
    color: pink;
    overflow: hidden;
    white-space: nowrap;

    animation: fillText 3s infinite;
    animation-direction: alternate;
    pointer-events: none; /* 마우스 이벤트 방해 안함 */
}

/* 두 글자의 폰트 스타일을 똑같이해야 겹쳐서 원하는 효과대로 나옴 */
.animated-text, .animated-text::before {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 40px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: normal;
    white-space: nowrap;
}

@keyframes fillText {
    to {
        width: 100%;
    }
}

.container:nth-child(1) h2:nth-of-type(2) {
    font-size: 40px;
    color: white;
}

.container:nth-child(1) button {
    width: 200px;
    height: 50px;
    color: white;
    background-color: #FF83A2;
    border: none;
    outline: 3px solid white; /* 외곽선 */
    outline-offset: 10px; /* 요소로부터 떨어뜨림 */
}

.arrow-animate {
    position: absolute;
    top: 100px;
}

.container:nth-child(2) {
    position: relative;
    z-index: 1;
}

.container:nth-child(2) #title {
    position: absolute;
    top: 50px;
    font-size: 40px;
    color: white;
}

.section-wrapper.hover-left .overlay-second {
    background-image: url('../images/일본음식.jpg');
    opacity: 1;
}
.section-wrapper.hover-center .overlay-second {
    background-image: url('../images/culture.png');
    opacity: 1;
}
.section-wrapper.hover-right .overlay-second {
    background-image: url('../images/예절.png');
    opacity: 1;
}

.section-wrapper {
    position: relative;
    display: flex;
    width: 60%;
    height: 50%;
}

#left_section,
#center_section,
#right_section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 15px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#left_section {
    border-bottom-left-radius: 30px;
    border-top-left-radius: 30px;
    border-right: 1px solid white;
}

#right_section {
    border-bottom-right-radius: 30px;
    border-top-right-radius: 30px;
    border-left: 1px solid white;
}

.overlay-second {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover !important; /* 우선순위 최상위 */
    background-position: center !important;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    border-radius: 30px;
}

/* 공통: hover 시 title 및 description */
#left_section .description,
#center_section .description,
#right_section .description {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #ddd;
    font-size: 16px;
    max-width: 200px;
    text-align: center;
    pointer-events: none;
}

#left_section.hovered .title,
#center_section.hovered .title,
#right_section.hovered .title {
    transform: translateY(-30px);
    opacity: 0.7;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: bottom left;
    margin: 0;
}

#left_section.hovered .description,
#center_section.hovered .description,
#right_section.hovered .description {
    opacity: 1;
}

.container:nth-child(3) #title {
    position: absolute;
    top: 50px;
    font-size: 40px;
    color: white;
}

#exchange-container #text_area {
    position: relative;
    margin-top: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#exchange-container textarea {
    font-size: 20px;
    width: 300px;
    height: 70px;
    border: none;
    resize: none; /* 사용자가 크기 조절을 불가능하게 만듬 */
    text-align: center;
    line-height: 70px;
}

#exchange-container button {
    margin-top: 50px;
    margin-bottom: 150px;
    width: 200px;
    height: 50px;
    background-color: #FF83A2;
    border: none;
    outline: 3px solid white;
    outline-offset: 10px;
    color: white;
}

#exchange-container h3 {
    font-size: 40px;
    color: white;
}

#section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 100px;
}

#last-container #title {
    position: absolute;
    top: 30px;
    font-size: 40px;
    color: white;
}

#randomH2 {
    font-size: 50px;
    color: white;
}

.container:nth-child(4) {
    background-image: url("../images/후지산.jpg");
}

#weather {
    display: flex;
    justify-content: center; /* 가로 중앙 */
    align-items: center; /* 세로 중앙 */
    gap: 10px; /* 아이콘과 텍스트 사이 간격 */
}

/* 화살표 움직이는 효과 애니메이션 */
@keyframes floatArrow {
    0% { transform: translateY(0px); }
    50% { transform: translateY(15px); }
    100% { transform: translateY(0px); }
}

.arrow-animate {
    animation: floatArrow 2s ease-in-out infinite;
}