/* ===== 테마 색상 설정 ===== */
/* 적용 대상: #searchButton, #topButton, .highlight, #resultNavigation button */

:root {
    --accent-color: #7dbd74;
}

/* ===== 폰트 ===== */

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-3Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

/* ===== 기본 레이아웃 ===== */

body {
    margin: 0;
    padding: 0;
    font-family: Paperozi;
}

#pageHeader {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 30px;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.sponsor-section {
    padding: 20px 20px 0 20px;
    overflow: hidden;
}

/* ===== 슬라이더 ===== */

.slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 20px;
    aspect-ratio: 16 / 9;
    touch-action: pan-y;
    user-select: none;
}

/* 슬라이드 1개일 때 드래그/슬라이드 비활성화 */
.slider-container.no-slider {
    touch-action: auto;
    user-select: auto;
    pointer-events: none;
}

.slider-wrapper {
    display: flex;
    height: 100%;
    transform: translateX(0);
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.no-slider .slider-wrapper {
    touch-action: auto;
    pointer-events: auto;
    transform: none !important;
    transition: none !important;
    will-change: auto;
}

.slide {
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    -webkit-user-drag: none;
    user-drag: none;
}

.pagination-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: white;
}

/* ===== 섹션 이미지 (슬라이더 외 구분 이미지) ===== */

.sponsor-image {
    width: 100%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    position: relative;
    margin-bottom: 20px;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.sponsor-image img {
    object-fit: cover;
    object-position: top;
}

.sponsor-image.visible {
    opacity: 1;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ===== 검색 ===== */

.search-container {
    display: flex;
    margin-bottom: 10px;
}

#searchInput {
    flex-grow: 1;
    width: 100px;
    padding-left: 10px;
    font-family: Paperozi;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    transition: all 0.3s;
}

#searchInput:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#searchButton {
    padding: 10px 20px;
    font-family: Paperozi;
    font-size: 16px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* ===== 후원자 테이블 ===== */

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

td {
    text-align: center;
    padding: 12px;
    word-wrap: break-word;
    white-space: normal;
    overflow: visible;
    position: relative;
    width: 33.33%;
    height: auto;
    line-height: 1.2;
}

.nickname {
    display: block;
    word-break: break-word;
    hyphens: auto;
}

.highlight {
    background-color: var(--accent-color);
    color: white;
}

/* ===== 알림 ===== */

#notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* ===== 검색 결과 내비게이션 ===== */

#resultNavigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    display: none;
    white-space: nowrap;
    align-items: center;
    gap: 5px;
    z-index: 1000;
}

#resultNavigation button {
    padding: 5px 10px;
    background-color: var(--accent-color);
    font-family: Paperozi;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin: 0 5px;
}

#closeNavigation {
    padding: 5px 10px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* ===== TOP 버튼 ===== */

#topButton {
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    width: 50px;
    height: 50px;
    border: none;
    outline: none;
    background-color: white;
    color: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, background-color 0.3s;
    opacity: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ===== 웰컴 오버레이 ===== */

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.welcome-content {
    text-align: center;
    padding: 20px;
    max-width: 100%;
}

.welcome-mascot {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto 20px;
    aspect-ratio: 4/3;
    background-image: url('images/thanks.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: bounce 1s infinite;
}

.welcome-content h1 {
    font-size: clamp(16px, 5vw, 32px);
    margin-bottom: 16px;
    animation: fadeIn 1s ease-out;
    word-break: keep-all;
    line-height: 1.4;
}

.welcome-content p {
    font-size: clamp(14px, 4vw, 18px);
    color: #666;
    margin-bottom: 24px;
    animation: fadeIn 1s ease-out 0.3s both;
    word-break: keep-all;
    line-height: 1.4;
}

#welcomeCloseBtn {
    padding: 10px 30px;
    font-size: 16px;
    background-color: #9795d4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-out, visibility 1s ease-out;
}

/* ===== 네비게이션 버튼 ===== */

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-button {
    width: auto;
    padding: 15px;
    margin: 0 5%;
    font-size: 16px;
    background-color: white;
    color: black;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

/* ===== 애니메이션 ===== */

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-10px);
    }

    50% {
        transform: translateY(0);
    }
}

/* ===== 푸터 ===== */

#pageFooter {
    background-color: #f9f9f9;
    padding: 40px 20px;
    border-top: 1px solid #eee;
    text-align: center;
    margin-top: 50px;
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #888;
    word-break: keep-all;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}