/* 팝업 배경 */
.brochure-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

/* 팝업 내용 */
.brochure-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90vw;
    max-width: 950px;
    aspect-ratio: 950 / 700;
    box-sizing: border-box;
    overflow: visible;
    z-index: 101;
}

/* 책 영역 */
.brochure-book {
    position: relative;
    width: 100%;
    height: calc(100% - 80px);
    margin: auto;
    perspective: 2000px;
}

.brochure-page {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform-origin: left;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    transition: transform 1s ease, left 1s ease;
    cursor: zoom-in;
}

.brochure-page.flipped {
    transform: rotateY(-180deg);
    left: -100%;
    z-index: 0;
}

/* 버튼 컨트롤 영역 */
.brochure-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
    box-sizing: border-box;
}

/* 버튼 기본 스타일 */
.brochure-button {
    padding: 10px 22px;
    font-size: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #4a90e2, #357ABD);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(53,122,189,0.4);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.brochure-button:hover:not(.hidden) {
    background: linear-gradient(135deg, #357ABD, #2c5aa0);
    box-shadow: 0 6px 10px rgba(44,90,160,0.6);
}

.brochure-button:active:not(.hidden) {
    background: linear-gradient(135deg, #2c5aa0, #24487e);
    box-shadow: 0 2px 4px rgba(24,58,108,0.8);
}

.brochure-button.hidden {
    display: none;
}

/* 닫기 버튼 스타일 */
.brochure-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #e74c3c;
    color: #fff;
    border: none;
    font-size: 1.3rem;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(231,76,60,0.6);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
    z-index: 10;
}

.brochure-close-button:hover {
    background: #c0392b;
    box-shadow: 0 6px 10px rgba(192,57,43,0.8);
}

.brochure-close-button:active {
    background: #992d22;
    box-shadow: 0 2px 4px rgba(73,21,17,0.9);
}

/* 확대 이미지 보기 */
.brochure-zoomed {
    position: fixed;
    z-index: 200;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    border: 5px solid white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    display: none;
    cursor: zoom-out;
}

.brochure-dont-show {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    text-align: center;
}

.brochure-dont-show input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 6px;
    vertical-align: middle;
    cursor: pointer;
}

.brochure-controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    max-width: 100%;
    overflow: visible;
}

/* 모바일 대응 미디어 쿼리 */
@media (max-width: 480px) {
    .brochure-modal-content {
        width: 95vw;
        max-width: none;
        padding: 10px;
        aspect-ratio: 950 / 700;
    }
    .brochure-book {
        height: calc(100% - 60px);
    }
    .brochure-controls {
        gap: 6px;
        overflow-x: auto;
    }
    .brochure-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .brochure-close-button {
        font-size: 1rem;
        padding: 4px 8px;
        top: 8px;
        right: 10px;
    }
    .brochure-dont-show {
        font-size: 13px;
    }
}
