
@import url("desktop.css") screen and (min-width: 1024px);
@import url("tablet.css") screen and (min-width: 690px) and (max-width: 1023px);
@import url("mobile.css") screen and (max-width: 689px);
/* Cafe24 폰트는 @font-face로 로드 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");
/* font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif; */
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* ==========================================
   공통 스타일 (모든 화면 크기에서 사용)
   ========================================== */

* {
    font-family: "Pretendard Variable", Pretendard;
}

html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: start;
    height: 100vh;
    overflow: hidden;
}

header {
    width: 30%;
    height: 100vh;
    overflow: hidden;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 2px solid #000;
}

header img {
    width: auto;
    align-self: center;
    background-color: white;
}

header .header-title-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
    margin: 18px 24px;
    padding-bottom: 18px;
    width: auto;
    white-space: nowrap; /* 텍스트 줄바꿈 방지 */
    overflow: hidden; /* 넘치는 내용 감춤 */
}

header .header-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 2;
    color: #000;
    padding: 0;
    margin: 0;
}

header .header-subtitle {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;
    color: #666;
    padding: 0;
    margin: 0;
    flex: 0 1 120px; /* 필요 시 아래로 내려가도록 */
}

.header-text {
    margin: 0;
    padding: 18px 24px;
}

.korean {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    padding: 0;
    margin: 0;
}

.english {
    font-size: 12px;
    font-weight: 200;
    line-height: 1.3;
    padding: 0;
    margin: 0;
}

.header-footer-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: sticky;
    left: 0;
    bottom: 0;
    font-size: 9px;
    font-weight: 400;
    line-height: 1.5;
    color: #666;
    padding-bottom: 16px;
    background-color: #f3f3f3; /* 스크롤 시 가독성을 위해 배경색 지정 */
    z-index: 10; /* 다른 요소와 겹칠 경우를 대비 */
}

#main-content {
    width: 84%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.main-detail {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    background-color: #000;
}

.main-footer {
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    background-color: #000;
}

.main-detail-toggle, .main-footer-toggle {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-sizing: border-box;
    border-bottom: 1px solid white;
}

.main-detail-title, .main-footer-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    font-family: 'Cafe24AnemoneAir';
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
}

.main-detail-toggle p, .main-footer-toggle p {
    font-family: 'Cafe24AnemoneAir';
    font-size: 16px;
    font-weight: 200;
    color: white;
    padding: 0;
    margin: 0;
    width: fit-content;
}

/* 아코디언 효과 */
.main-detail-content, .main-footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    grid-auto-flow: wrap;
    align-items: start;
    box-sizing: border-box;
    color: white;
    width: 100%;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
}

.main-detail-content.disabled,
.main-footer-content.disabled {
    display: none;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}



/* main-shelf */
.main-shelf {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    width: 100%;
    background-color: #f3f3f3;
    box-sizing: border-box;
}

.main-shelf-stage {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    box-sizing: border-box;
    width: 100%;
}

.main-shelf-stage-header {
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
    width: 100%;
    border-bottom: 2px solid black;
}

.main-shelf-stage-title {
    font-family: "Work Sans", sans-serif;
    margin:0;
    line-height: 1;
    letter-spacing: -0.02em;
}

.main-shelf-stage-subtitle {
    font-family: "Cafe24AnemoneAir", sans-serif;
    margin:0;
    font-weight: 400;
}

.main-shelf-stage-content {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
    width: 100%;
    border-bottom: 2px solid black;
    opacity: 1;
    overflow: visible;
    transition: all 0.35s ease-in-out;
}

.main-shelf-stage-content.disabled {
    display: flex;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.main-shelf-stage-content img {
    cursor: pointer;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

/* Flip 애니메이션 */
@keyframes flipAnimation {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

.flipping {
    animation: flipAnimation 0.6s ease-in-out;
    transition: none !important;
}

.hover-info {
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    gap: 4px;
    position: absolute;
    top: 0;
    left: 0;
}

.hover-info-item {
    border: 1px solid #000;
    background-color: #fff;
    color: #000;
    border-radius: 30px;
    height:32px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0 16px;
}

.hover-info-item-text {
    font-size: 18px;
    font-weight: 400;
}

/* 버튼 컨테이너 - 이미지 하단 중앙에 배치 */
.buttons-container {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 1000;
}

.button {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;    
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.5);
}

.button:hover {
    background-color: rgba(0, 0, 0, 0.75);
}

.disabled {
    display: none;
}

/* 노트 이미지 컨테이너 */
.main-shelf-stage-content-item {
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
}

/* 서명 배경 레이어 스타일 */
.signature-background {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    animation: fadeInSignature 0.3s ease forwards;
}

.signature-background img {
    width: auto;
    object-fit: contain;
}

@keyframes fadeInSignature {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 노트 상세 모달 스타일 */
.note-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.note-detail-modal.show {
    opacity: 1;
    transform: translateY(0);
}

.note-detail-modal.closing {
    opacity: 0;
    transform: translateY(100%);
}

.note-detail-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

.note-detail-header {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: white;
    z-index: 10001;
}

.note-detail-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-detail-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.note-detail-title {
    font-size: 48px;
    font-weight: 600;
    margin: 0;
    color: white;
    font-family: 'Cafe24AnemoneAir', sans-serif;
}

.note-detail-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.note-detail-period,
.note-detail-years,
.note-detail-pages {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.note-detail-navigation {
    margin-top: 8px;
}

.note-detail-navigation-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.note-detail-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.note-detail-image-container {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.note-detail-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: white;
    padding: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.note-detail-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* 이미지 전환 애니메이션 */
.note-detail-image.slide-out-left {
    animation: slideOutLeft 0.3s ease-in-out forwards;
}

.note-detail-image.slide-out-right {
    animation: slideOutRight 0.3s ease-in-out forwards;
}

.note-detail-image.slide-in-left {
    animation: slideInLeft 0.3s ease-in-out forwards;
}

.note-detail-image.slide-in-right {
    animation: slideInRight 0.3s ease-in-out forwards;
}

@keyframes slideOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.note-detail-footer {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    z-index: 10001;
}

.note-detail-page-counter {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.note-detail-date {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

/* Toast 알림 스타일 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    margin: 0;
    text-align: center;
}

/* JavaScript 스타일을 CSS 클래스로 분리 */
.modal-open {
    display: block;
}

.modal-closed {
    display: none;
}

.body-modal-open {
    overflow: hidden;
}

.body-modal-closed {
    overflow: auto;
}

.page-controls-hidden {
    display: none;
}

.page-controls-visible {
    display: flex;
}

.hover-info-positioned {
    position: absolute;
    pointer-events: none;
}

.note-item-hovered {
    z-index: 100;
}

.note-item-hovered img {
    position: relative;
    z-index: 2;
}

.note-item-unhovered {
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.note-item-normal {
    filter: none;
    opacity: 1;
}

.note-image-normal {
    scale: 1;
    filter: none;
}

.toggle-rotated {
    transition: transform 0.3s;
    transform: rotate(180deg);
}

.toggle-normal {
    transition: transform 0.3s;
    transform: rotate(0deg);
}

@font-face {
    font-family: 'Cafe24AnemoneAir';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2202@1.0/Cafe24Ohsquareair.woff') format('woff');
}

