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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
}

.top-bar {
    background: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: #333;
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.top-bar-right {
    display: flex;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 4px;
}

.search-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    padding: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 99;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: 10px;
    padding: 12px 16px;
    gap: 12px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 16px;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.bible-list {
    margin-top: 140px;
    padding: 20px 20px 90px 20px;
}

.book-item-container {
    margin-bottom: 2px;
    scroll-margin-top: 140px;
}

.book-item {
    background: white;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.book-item:hover {
    background: #f5f5f7;
}

.book-item.selected {
    background: #E3F2FD;
    border-left-color: #007AFF;
}

.book-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    padding: 16px 20px;
    background: #f9f9f9;
}

.chapter-btn {
    background: white;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.chapter-btn:hover {
    background: #007AFF;
    color: white;
    border-color: #007AFF;
}

.content-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 200;
    display: none;
    overflow-y: auto;
}

.content-view.active {
    display: block;
}

.content-inner {
    min-height: 100vh;
    padding: 20px 24px 200px 24px; /* 상단 여백을 60px에서 20px로 줄임 */
}

.verse-content {
    max-width: 800px;
    margin: 0 auto;
}

.verse-header {
    text-align: center;
    margin-bottom: 30px; /* 하단 마진을 줄임 */
    padding-top: 10px; /* 상단 여백을 줄임 */
}

.verse-book {
    font-size: 28px;
    color: #999;
    margin-bottom: 20px;
    font-weight: 500;
}

.verse-chapter {
    font-size: 32px; /* 글자 크기를 140px에서 32px로 줄여 구절과 비슷하게 만듦 */
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.bible-frame {
    line-height: 1.8; /* 줄 간격 최적화 (1.8) */
    letter-spacing: 0.05em; /* 글자 간격 최적화 (0.05em) */
    width: 100%;
    min-height: 800px;
    border: none;
    background: white;
}

.navigation-bar {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    padding: 16px 20px;
    z-index: 201;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.navigation-bar.hidden {
    transform: translateY(200%);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-btn {
    background: #007AFF;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #0051D5;
    transform: scale(1.05);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    flex: 1;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e5ea;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 202;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.bottom-nav.hidden {
    transform: translateY(100%);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #666;
    border: none;
    background: none;
    flex: 1;
    padding: 8px;
}

.nav-item.active {
    color: #007AFF;
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: 11px;
}

.main-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e5ea;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
}

.alert {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    display: none;
    z-index: 1000;
}

.alert.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.no-results {
    margin-top: 140px;
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.favorites-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 300;
    display: none;
    flex-direction: column;
}

.favorites-modal.active {
    display: flex;
}

.modal-header {
    background: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.favorite-item {
    background: white;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 아이템 시작점에 정렬 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-direction: column; /* 내용을 세로로 배치 */
}

.favorite-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-group {
    margin-bottom: 30px;
}

.date-group h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    padding-left: 10px;
}

.verse-preview {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 14px;
}
    background: white;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.favorite-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.delete-btn {
    background: #FF3B30;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

.empty-favorites {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
