/* 기본 스타일 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif KR', serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #e94560 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    position: relative;
}

/* 의사 전체화면 시 바디 스크롤 잠금 */
body.pseudo-fullscreen-lock {
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
    animation: divineLight 8s ease-in-out infinite;
}

@keyframes divineLight {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* 성경책 컨테이너 */
.bible-container {
    position: relative;
    width: 100%;
    max-width: 1600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

/* 의사 전체화면 컨테이너 */
.pseudo-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 2147483640; /* 거의 최상위 */
    background: #0f0f1a; /* 화면 가장자리 거슬림 방지 */
}

/* 성경책 표지 */
.bible-cover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 800px;
    background: 
        linear-gradient(145deg, #FFFFFF 0%, #F8F8FF 25%, #FFF8E1 50%, #FFE4B5 75%, #FFD700 100%),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 215, 0, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    border: 15px solid #FFD700;
    border-radius: 20px;
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.3),
        0 0 80px rgba(255, 215, 0, 0.6),
        0 0 120px rgba(255, 255, 255, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.bible-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0%, transparent 70%),
        radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    animation: coverGlow 6s ease-in-out infinite;
}

@keyframes coverGlow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.bible-cover:hover {
    transform: translate(-50%, -50%);
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

.cover-title {
    text-align: center;
    color: #8B4513;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    z-index: 2;
    position: relative;
    margin-bottom: 30px;
}

.cover-title h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 3px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3), 0 0 10px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #8B4513, #DAA520, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cover-title p {
    font-size: 1.3rem;
    font-weight: 400;
    opacity: 0.9;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: #DAA520;
}

/* 책 선택 영역 */
.book-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
    z-index: 2;
    position: relative;
    width: 100%;
    max-width: 600px;
    justify-items: center;
}

.book-option {
    cursor: pointer;
    transition: all 0.3s ease;
}

.book-option:hover {
    transform: none;
}

.book-cover {
    width: 200px;
    height: 150px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.3),
        0 0 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 215, 0, 0.6) 0%, transparent 50%);
    animation: bookGlow 4s ease-in-out infinite;
}

@keyframes bookGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.kjv-cover {
    background: 
        linear-gradient(145deg, #8B4513 0%, #DAA520 25%, #FFD700 50%, #F0E68C 75%, #FFFFFF 100%);
    border: 3px solid #DAA520;
}

.kjv-english-cover {
    background: 
        linear-gradient(145deg, #1E3A8A 0%, #3B82F6 25%, #60A5FA 50%, #93C5FD 75%, #DBEAFE 100%);
    border: 3px solid #3B82F6;
}

.commentary-cover {
    background: 
        linear-gradient(145deg, #2E8B57 0%, #3CB371 25%, #20B2AA 50%, #48D1CC 75%, #E0FFFF 100%);
    border: 3px solid #3CB371;
}

.commentary-english-cover {
    background: 
        linear-gradient(145deg, #7C2D12 0%, #DC2626 25%, #EF4444 50%, #F87171 75%, #FECACA 100%);
    border: 3px solid #DC2626;
}

.book-cover h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    z-index: 1;
    position: relative;
}

.book-cover p {
    font-size: 0.9rem;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    z-index: 1;
    position: relative;
}

.book-option:hover .book-cover {
    box-shadow: 
        0 15px 40px rgba(0,0,0,0.4),
        0 0 30px rgba(255, 215, 0, 0.6);
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.8);
}

.cover-decoration {
    margin-top: 20px;
    z-index: 2;
    position: relative;
}

.glowing-cross {
    width: 100px;
    height: 120px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: crossPulse 3s ease-in-out infinite;
}

@keyframes crossPulse {
    0%, 100% { 
        filter: brightness(1) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
    50% { 
        filter: brightness(1.5) drop-shadow(0 0 40px rgba(255, 215, 0, 1)) drop-shadow(0 0 60px rgba(255, 255, 255, 0.8));
    }
}

.glowing-cross::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 6px;
    background: linear-gradient(90deg, #FFD700, #FFFFFF, #FFD700);
    border-radius: 3px;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 255, 255, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4);
    animation: horizontalGlow 2s ease-in-out infinite;
}

@keyframes horizontalGlow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 60px rgba(255, 215, 0, 0.4);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 1),
            0 0 60px rgba(255, 255, 255, 0.8),
            0 0 90px rgba(255, 215, 0, 0.6);
    }
}

.glowing-cross::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 120px;
    background: linear-gradient(180deg, #FFD700, #FFFFFF, #FFD700);
    border-radius: 3px;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 255, 255, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4);
    animation: verticalGlow 2.5s ease-in-out infinite;
}

@keyframes verticalGlow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 60px rgba(255, 215, 0, 0.4);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 1),
            0 0 60px rgba(255, 255, 255, 0.8),
            0 0 90px rgba(255, 215, 0, 0.6);
    }
}

/* 성경책 본체 */
.bible-book {
    position: relative;
    width: 85vw;
    height: 94vh;
    max-width: 1400px;
    max-height: 1200px;
    display: flex;
    perspective: 1000px;
    transform-style: preserve-3d;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.3),
        0 0 100px rgba(255, 255, 255, 0.1);
}

/* 의사 전체화면일 때 본문 확장 */
.pseudo-fullscreen .bible-book {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
}

/* 페이지 스타일 */
.page {
    position: relative;
    width: 50%;
    height: 100%;
    background: 
        linear-gradient(135deg, #FEFEFE 0%, #F8F8F8 100%),
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    border: 1px solid #E0E0E0;
    box-shadow: 
        0 0 30px rgba(0,0,0,0.15),
        0 0 20px rgba(255, 215, 0, 0.1),
        inset 0 0 0 1px rgba(255,255,255,0.9);
    transform-origin: center left;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    /* 얇은 종이 효과 */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.02) 2px,
            rgba(0,0,0,0.02) 4px
        );
}

.page:hover {
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.2),
        0 0 30px rgba(0,0,0,0.2),
        inset 0 0 0 1px rgba(255,255,255,0.95);
    z-index: 5;
}

.left-page {
    transform-origin: center right;
}

.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
    pointer-events: none;
    animation: pageGlow 6s ease-in-out infinite;
}

@keyframes pageGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.left-page {
    border-radius: 0 5px 5px 0;
    transform: rotateY(0deg);
    z-index: 2;
}

.right-page {
    border-radius: 5px 0 0 5px;
    transform: rotateY(0deg);
    z-index: 1;
}

/* 페이지 내용 */
.page-content {
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.page-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    text-align: justify;
    margin-bottom: 40px;
}

.page-text img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-number {
    position: absolute;
    bottom: 15px;
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.left-page .page-number {
    right: 20px;
}

/* 페이지 가장자리 (금색) */
.page-edge {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #DAA520, #FFD700);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: edgeGlow 3s ease-in-out infinite;
}

@keyframes edgeGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.left-edge {
    right: 0;
}

.right-edge {
    left: 0;
}

/* 책등 */
.spine {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
    background: 
        linear-gradient(90deg, #8B4513, #A0522D, #8B4513),
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    border-radius: 5px;
    box-shadow: 
        0 0 20px rgba(0,0,0,0.3),
        0 0 10px rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3;
    animation: spineGlow 4s ease-in-out infinite;
}

@keyframes spineGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.spine-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: #DAA520;
    font-size: 0.9rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.spine-decoration {
    width: 20px;
    height: 20px;
    background: #DAA520;
    border-radius: 50%;
    margin: 10px 0;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 네비게이션 컨트롤 */
.navigation-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.1),
        0 0 5px rgba(255, 215, 0, 0.05);
    z-index: 100;
    min-width: 250px;
    max-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* 메뉴 헤더 (토글 버튼과 축소 버튼) */
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
}

.menu-toggle-btn {
    flex: 1;
    text-align: left;
}

/* 축소 버튼 */
.minimize-btn {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #FFD700, #DAA520);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(255, 215, 0, 0.3),
        0 0 15px rgba(255, 215, 0, 0.2);
    animation: minimizeGlow 2s ease-in-out infinite;
}

.minimize-btn:hover {
    background: linear-gradient(135deg, #DAA520, #B8860B);
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(255, 215, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes minimizeGlow {
    0%, 100% { 
        box-shadow: 
            0 2px 8px rgba(255, 215, 0, 0.3),
            0 0 15px rgba(255, 215, 0, 0.2);
    }
    50% { 
        box-shadow: 
            0 4px 12px rgba(255, 215, 0, 0.4),
            0 0 20px rgba(255, 215, 0, 0.3);
    }
}

.minimize-icon {
    color: #000;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.navigation-controls.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

/* 메뉴 토글 버튼 (최우측 상단) */
.menu-toggle-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 101;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle-fixed:hover {
    transform: scale(1.1);
}

.glowing-box {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.2),
        0 0 40px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: boxGlow 3s ease-in-out infinite;
}

@keyframes boxGlow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.2),
            0 0 40px rgba(255, 215, 0, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 0.4),
            0 0 60px rgba(255, 215, 0, 0.5),
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

.color-lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.line {
    width: 20px;
    height: 2px;
    border-radius: 1px;
    animation: linePulse 2s ease-in-out infinite;
}

.red-line {
    background: linear-gradient(90deg, #ff4444, #ff6666);
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

.blue-line {
    background: linear-gradient(90deg, #4444ff, #6666ff);
    box-shadow: 0 0 8px rgba(68, 68, 255, 0.6);
}

.white-line {
    background: linear-gradient(90deg, #ffffff, #cccccc);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

@keyframes linePulse {
    0%, 100% { 
        opacity: 0.7;
        transform: scaleX(1);
    }
    50% { 
        opacity: 1;
        transform: scaleX(1.2);
    }
}

/* 메뉴가 숨겨져 있을 때 토글 버튼 표시 */
.menu-toggle-fixed {
    opacity: 1;
    transform: translateX(0);
}

/* 메뉴가 보일 때 토글 버튼 숨김 */
.navigation-controls.show + .menu-toggle-fixed,
.navigation-controls.show ~ .menu-toggle-fixed {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

/* 의사 전체화면에서도 상단에 고정되도록 */
.pseudo-fullscreen .navigation-controls {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2147483641;
}

.page-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.page-controls input, .search-controls input {
    flex: 0.3;
    padding: 8px 12px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    width: 70%;
}

.page-controls input:focus, .search-controls input:focus {
    border-color: #DAA520;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    background: rgba(255, 255, 255, 1);
}

.page-controls button, .search-controls button {
    flex: 0.7;
    padding: 10px 16px;
    background: linear-gradient(135deg, #FFD700, #DAA520);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.3);
    min-width: 60px;
    white-space: nowrap;
}

.page-controls button:hover, .search-controls button:hover {
    background: linear-gradient(135deg, #DAA520, #B8860B);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.toc-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.toc-controls button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #DAA520, #B8860B);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.3);
    min-width: 60px;
    white-space: nowrap;
    margin-right: 0;
    opacity: 0.5; /* 버튼 투명도 50% */
}

.toc-controls button:hover {
    background: linear-gradient(135deg, #B8860B, #8B6914);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.4);
}

.toc-primary-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.toc-primary-buttons button {
    flex: 1 1 0;
}

/* 전체화면 버튼을 첫 줄 두 버튼과 동일 폭(컨테이너 전체폭)으로 */
.toc-controls > #toggleFullscreenBtn {
    width: 100%;
}

/* 책 선택 버튼 스타일 */
#selectBookBtn {
    background: linear-gradient(135deg, #2E8B57, #3CB371);
    color: #FFF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#selectBookBtn:hover {
    background: linear-gradient(135deg, #3CB371, #20B2AA);
}

.page-info {
    color: #FFD700;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #FFD700;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .bible-book {
        width: 90%;
        height: 80vh;
    }
}

@media (max-width: 768px) {
    .bible-container {
        padding: 5px;
        height: 100vh;
    }

    .bible-book {
        width: 95%;
        height: 75vh;
    }

    .page-content {
        padding: 10px;
    }

    .page-text {
        font-size: 0.8rem;
    }

    .navigation-controls {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .page-controls, .search-controls {
        flex-direction: column;
        gap: 5px;
    }

    .page-controls input, .search-controls input {
        font-size: 14px;
        padding: 8px;
    }

    .page-controls button, .search-controls button {
        font-size: 14px;
        padding: 8px 15px;
    }

    .toc-controls button {
        font-size: 14px;
        padding: 8px 15px;
    }

    .page-info {
        font-size: 14px;
    }

    /* 책 선택 화면 모바일 반응형 */
    .bible-cover {
        width: 95%;
        height: 95vh;
        min-height: 500px;
        padding: 20px;
    }

    .cover-title h1 {
        font-size: 2rem;
    }

    .cover-title p {
        font-size: 1rem;
    }

    .book-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        align-items: center;
        justify-content: center;
    }

    .book-cover {
        width: 160px;
        height: 120px;
    }

    .book-cover h3 {
        font-size: 0.9rem;
    }

    .book-cover p {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .bible-cover {
        width: 98%;
        height: 98vh;
        min-height: 450px;
        padding: 15px;
    }

    .cover-title h1 {
        font-size: 1.8rem;
    }

    .book-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .book-cover {
        width: 120px;
        height: 90px;
    }

    .book-cover h3 {
        font-size: 0.8rem;
    }

    .book-cover p {
        font-size: 0.6rem;
    }
}

/* 페이지 슬라이드 애니메이션 */
@keyframes pageSlide {
    0% {
        transform: translateX(0) rotateY(0deg);
        opacity: 1;
    }
    50% {
        transform: translateX(-20px) rotateY(-5deg);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes pageSlideReverse {
    0% {
        transform: translateX(0) rotateY(0deg);
        opacity: 1;
    }
    50% {
        transform: translateX(20px) rotateY(5deg);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) rotateY(0deg);
        opacity: 1;
    }
}

.page.sliding {
    animation: pageSlide 0.6s ease-in-out;
}

.page.sliding-reverse {
    animation: pageSlideReverse 0.6s ease-in-out;
}

/* 스크롤바 스타일링 */
.page-content::-webkit-scrollbar {
    width: 8px;
}

.page-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.page-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFD700, #DAA520);
    border-radius: 4px;
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #DAA520, #B8860B);
}

 