/* 
 * 공통 모달 스타일
 * 단일 페이지와 숏코드 모달에서 공통으로 사용
 */

/* 모달 오버레이 - 테마 간섭 방지 */
.mybook-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    margin: 0 !important;
    padding: 0 !important;
    /* 모바일에서 자돐 스크롤 방지 */
    -webkit-overflow-scrolling: touch !important;
    overflow: hidden !important;
}

.mybook-modal.show {
    display: block !important;
}

/* 모달 배경 오버레이 */
.mybook-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    cursor: pointer !important;
}

/* 모달 컨테이너 - 중앙 정렬 및 스크롤 처리 */
.mybook-modal-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

/* 모달 콘텐츠 기본 스타일 */
.mybook-modal-content-new {
    background: white !important;
    border-radius: 12px !important;
    max-width: 800px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    margin: auto !important;
    position: relative !important;
    animation: modalSlideIn 0.3s ease !important;
}

/* 모달 애니메이션 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 모달 닫기 버튼 - 데스크톱과 모바일 구분 */
.mybook-modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: none !important;
    font-size: 20px !important;
    color: white !important;
    cursor: pointer !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: background-color 0.2s ease !important;
    z-index: 10001 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mybook-modal-close:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* 모바일 전용 뒤로 가기 버튼 - 플로팅 고정 */
.mybook-modal-back-btn {
    display: none !important;
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: none !important;
    font-size: 18px !important;
    color: white !important;
    cursor: pointer !important;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    z-index: 10002 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(8px) !important;
}

.mybook-modal-back-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.05) !important;
}

.mybook-modal-back-btn:active {
    transform: scale(0.95) !important;
}

/* 이미지 섹션 */
.mybook-modal-image-section {
    position: relative; /* absolute 자식 요소의 기준점 */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.mybook-modal-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mybook-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center; /* 중앙 정렬 */
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.mybook-modal-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6c757d;
    font-size: 16px;
}

.mybook-modal-no-image i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 하트 버튼 - 통합 스타일 (모달과 리스트 공통) */
.mybook-heart-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 20px;
    color: #dc3545;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
}

.mybook-heart-btn:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.mybook-heart-btn.liked {
    color: #dc3545;
}

.mybook-heart-btn.liked i {
    color: #ff6b9d;
}

/* 정보 섹션 */
.mybook-modal-info-section {
    padding: 32px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: auto;
    gap: 0; /* 섹션 간 불필요한 여백 제거 */
    justify-content: flex-start; /* 상단 정렬로 하단 여백 방지 */
}

/* 책 기본 정보 */
.mybook-modal-book-info {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid #e8e8e8;
    flex-shrink: 0; /* 기본 정보는 고정 크기 유지 */
    flex-grow: 0; /* 남은 공간을 차지하지 않음 */
}

/* 모달 헤더 - 제목과 편집 링크 */
.mybook-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 16px !important;
}

.mybook-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
    word-break: break-all;
    overflow-wrap: break-word;
}

.mybook-edit-link {
    font-size: 11px !important;
    color: #666 !important;
    text-decoration: none !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    transition: background-color 0.2s ease !important;
    margin-left: 12px !important;
    flex-shrink: 0 !important;
    border: 1px solid #ddd !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: 16px !important;
}

.mybook-edit-link:hover {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    text-decoration: none !important;
    border-color: #bbb !important;
}

.mybook-modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.mybook-modal-author,
.mybook-modal-publisher {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.mybook-modal-author i,
.mybook-modal-publisher i {
    margin-right: 8px;
    width: 16px;
    opacity: 0.7;
}

.mybook-modal-rating {
    justify-self: end;
}

.mybook-modal-stars {
    display: flex;
    gap: 2px;
}

.mybook-modal-stars i {
    color: #ffc107;
    font-size: 14px;
}

.mybook-modal-stars .far {
    color: #ddd;
}

/* 문장수집 섹션 - 남은 공간 전부 활용 */
.mybook-modal-quotes-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 12px;
    flex-shrink: 0;
    flex-grow: 1; /* 남은 공간을 모두 차지 */
    min-height: 0; /* flex 아이템이 축소될 수 있도록 */
}

.mybook-modal-posts-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 16px;
    flex-shrink: 0;
    flex-grow: 0; /* 고정 높이 유지 */
    max-height: 150px; /* 독후감 영역 최대 높이 고정 */
}

.mybook-modal-quotes-title, .mybook-modal-posts-title {
    font-size: 18px;
    font-weight: 600;
    margin: 5px 0 5px 0;
    color: #1a1a1a;
}

.mybook-modal-quotes-content, .mybook-modal-posts-content {
    overflow-y: auto;
    white-space: normal;
    padding-right: 8px;
    word-break: break-all;  /* 글자 단위로 줄바꿈 */
    flex: 1; /* 부모 섹션의 남은 공간 모두 차지 */
    min-height: 0; /* flex 아이템이 축소될 수 있도록 */
}

/* 포스트 섹션 스타일 - 기본 스타일에서 상속 */

.mybook-quotes-item, .mybook-post-item {
    text-align: left;
    padding: 14px 0;
    border-bottom: 1px solid #e8e8e8;
    line-height: 1.8;
    font-size: 15px;
}

.mybook-quotes-item:last-child, .mybook-post-item:last-child {
    border-bottom: none;
}

.quote-source-tag {
    display: inline;
    color: #1976D2;
    font-size: 15px;
    font-weight: 500;
    margin-right: 4px;
}

.quote-text {
    display: inline;
    color: #262626;
    font-size: 15px;
}

/* '더 보기' 버튼 스타일 */
.quote-more {
    display: inline-block;
    color: #8e8e8e;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 0;
    align-self: flex-start;  /* 왼쪽 정렬 */
}

.quote-more:hover {
    color: #262626;
    transform: translateX(3px);
}

/* 언급된 게시물 섹션 */
.mybook-modal-mentions-section {
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #e8e8e8;
    padding-top: 20px;
    margin-top: 20px;
}

.mybook-modal-mentions-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1a1a1a;
}

.mybook-mentions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mybook-mentions-list li {
    margin-bottom: 8px;
}

.mybook-mentions-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.mybook-mentions-list a:hover {
    background: #e9ecef;
}

.mention-type {
    font-size: 12px;
    color: #6c757d;
    background: #dee2e6;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 이전/다음 네비게이션 버튼 */
.mybook-modal-nav-btn {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: none !important;
    font-size: 24px !important;
    color: white !important;
    cursor: pointer !important;
    width: 50px !important;
    height: 80px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    z-index: 10001 !important;
    margin: 0 !important;
    padding: 0 !important;
    backdrop-filter: blur(8px) !important;
    opacity: 0.8 !important;
    /* 기본적으로 숨김 */
    display: none !important;
}

/* visible 클래스가 있을 때만 표시 */
.mybook-modal-nav-btn.visible {
    display: flex !important;
}

.mybook-modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.05) !important;
}

.mybook-modal-nav-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.mybook-modal-prev-btn {
    left: 20px !important;
}

.mybook-modal-next-btn {
    right: 20px !important;
}

/* 네비게이션 버튼 비활성 상태 */
.mybook-modal-nav-btn:disabled {
    display: none !important;
}

/* 스크롤바 스타일 */
.mybook-modal-quotes-content::-webkit-scrollbar,
.mybook-modal-posts-content::-webkit-scrollbar,
.mybook-modal-mentions-section::-webkit-scrollbar {
    width: 6px;
}

.mybook-modal-quotes-content::-webkit-scrollbar-track,
.mybook-modal-posts-content::-webkit-scrollbar-track,
.mybook-modal-mentions-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mybook-modal-quotes-content::-webkit-scrollbar-thumb,
.mybook-modal-posts-content::-webkit-scrollbar-thumb,
.mybook-modal-mentions-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.mybook-modal-quotes-content::-webkit-scrollbar-thumb:hover,
.mybook-modal-posts-content::-webkit-scrollbar-thumb:hover,
.mybook-modal-mentions-section::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 모달 로딩 스타일 */
.mybook-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.mybook-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1976D2;
    border-radius: 50%;
    animation: mybook-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes mybook-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 슬라이드 인 애니메이션 */
@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 0.85;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 0.85;
    }
}

.mybook-modal-loading p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

/* 좋아요 수 스타일 */
.mybook-modal-likes-count {
    margin-left: 4px;
    color: #ff6b9d;
    font-weight: 600;
    font-size: 0.85em;
    background: rgba(255, 107, 157, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    line-height: 1;
}

/* 모바일 하단 여백 요소 - 기본적으로 숨김 */
.mybook-mobile-nav-spacer {
    display: none !important;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    /* 모바일 모달 네비게이션 (768px 이하) */
    .mybook-modal-nav-btn {
        position: fixed !important;
        top: auto !important;
        bottom: 25px !important;
        transform: none !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 24px !important;
        background: rgba(0, 0, 0, 0.8) !important;
        backdrop-filter: blur(10px) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        z-index: 1003 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
        transition: all 0.3s ease !important;
        opacity: 0.85 !important;
    }
    
    .mybook-modal-prev-btn {
        left: 18px !important;
        animation: slideInLeft 0.5s ease-out !important;
    }
    
    .mybook-modal-next-btn {
        right: 18px !important;
        animation: slideInRight 0.5s ease-out !important;
    }
    
    .mybook-modal-nav-btn i {
        color: white !important;
        font-size: 17px !important;
        transition: transform 0.2s ease !important;
    }
    
    .mybook-modal-nav-btn:hover {
        background: rgba(0, 0, 0, 0.9) !important;
        transform: scale(1.05) !important;
        opacity: 1 !important;
    }
    
    .mybook-modal-nav-btn:hover i {
        transform: scale(1.1) !important;
    }
    
    .mybook-modal-nav-btn:disabled {
        opacity: 0.3 !important;
        background: rgba(0, 0, 0, 0.4) !important;
        pointer-events: none !important;
    }
    
    .mybook-modal-container {
        padding: 0 !important;
        align-items: flex-start !important;
        min-height: 100vh !important;
        /* 모바일에서 스크롤 허용 */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        /* iOS Safari에서 더 부드러운 스크롤 */
        overscroll-behavior: contain !important;
    }
    
    .mybook-modal-content-new {
        border-radius: 0 !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important; /* 자동 높이 조정으로 변경 */
        max-width: 100% !important;
        min-height: 100vh !important;
        height: auto !important; /* 내용에 따라 높이 자동 조정 */
        max-height: none !important;
        /* 모바일에서 유연한 높이 허용 */
        overflow: visible !important;
    }
    
    .mybook-modal-image-section {
        max-height: 50vh;
        min-height: 300px;
        /* 이미지 섹션도 유연하게 */
        height: auto !important;
    }
    
    .mybook-modal-info-section {
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 24px !important;
        min-height: auto !important;
        /* 모바일에서 내용이 길 때 자동 확장 */
        flex: 1 !important;
    }
    
    /* 모바일에서만 하단 여백 요소 표시 */
    .mybook-mobile-nav-spacer {
        display: block !important;
        height: 80px !important;
        width: 100% !important;
        flex-shrink: 0 !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .mybook-modal-quotes-section {
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        /* 모바일에서 문장수집 영역 자동 확장 */
        flex: 1 !important;
        min-height: 0 !important;
    }
    
    .mybook-modal-quotes-content {
        overflow: visible !important;
        max-height: none !important;
        padding-right: 0 !important;
        /* 모바일에서 모든 내용 표시 */
        height: auto !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    .mybook-modal-posts-section {
        max-height: none !important;
        overflow: visible !important;
        flex: none !important;
    }
    
    .mybook-modal-posts-content {
        overflow: visible !important;
        max-height: none !important;
    }
    
    .mybook-modal-mentions-section {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .mybook-modal-title {
        font-size: 20px;
        word-break: break-all;
        overflow-wrap: break-word;
    }
    
    .mybook-modal-meta {
        grid-template-columns: 1fr 1fr auto !important;
        gap: 6px !important;
    }
    
    .mybook-modal-author,
    .mybook-modal-publisher {
        font-size: 13px !important;
    }
    
    .mybook-modal-rating {
        font-size: 13px !important;
        justify-self: end !important;
    }
    
    .mybook-modal-stars i {
        font-size: 14px !important;
    }
    
    /* 모바일에서 하트 버튼 크기 조정 */
    .mybook-heart-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .mybook-heart-btn i {
        font-size: 16px !important;
    }
    
    /* 모바일에서는 뒤로 가기 버튼 표시, X 버튼 숨김 */
    .mybook-modal-close {
        display: none !important;
    }
    
    .mybook-modal-back-btn {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .mybook-modal-image-section {
        min-height: 40vh !important;
        max-height: 50vh !important;
    }
    
    .mybook-modal-info-section {
        padding: 16px !important;
        min-height: auto !important; /* 자동 높이로 변경 */
        flex: 1 !important; /* 유연한 높이 조정 */
    }
    
    /* 작은 화면에서 여백 요소 높이 조정 */
    .mybook-mobile-nav-spacer {
        height: 80px !important; /* 일관된 높이 유지 */
    }
    
    .mybook-modal-title {
        font-size: 18px !important;
        word-break: break-all;
        overflow-wrap: break-word;
    }
    
    .mybook-modal-meta {
        gap: 4px !important;
    }
    
    .mybook-modal-author,
    .mybook-modal-publisher {
        font-size: 12px !important;
    }
    
    .mybook-modal-rating {
        font-size: 12px !important;
    }
    
    .mybook-modal-stars i {
        font-size: 12px !important;
    }
    
    .mybook-modal-quotes-content {
        font-size: 14px !important;
    }
    
    /* 작은 화면에서 뒤로가기 버튼 위치 조정 */
    .mybook-modal-back-btn {
        top: 16px !important;
        left: 16px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}

/* 문장수집이 없을 때만 독후감 영역 확장 */
.mybook-modal-info-section.no-quotes .mybook-modal-posts-section {
    max-height: none; /* 높이 제한 제거 */
    flex-grow: 1; /* 남은 공간 활용 */
}

.mybook-post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.mybook-post-item:hover {
    background: #fcfcfc;
}

.mybook-post-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    padding-right: 10px;
}

.mybook-post-title {
    color: #333;
    font-weight: 500;
    flex: 1;
}

.mybook-post-date {
    font-size: 12px;
    color: #999;
    margin-left: 12px;
    white-space: nowrap;
}

.mybook-post-remove-btn {
    padding: 4px;
    background: transparent;
    color: #999;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mybook-post-remove-btn:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.mybook-post-remove-btn i {
    font-size: 12px;
}

/* 처리 중 상태 */
.mybook-post-remove-btn.processing {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 메시지 알림 */
.mybook-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 100000;
    font-size: 14px;
    display: none;
}

/* 모달 내 서재로 이동 버튼 (서재가 아닌 페이지에서만 표시) */
.mybook-modal-library-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mybook-modal-library-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* 모바일에서 서재로 이동 버튼 위치 조정 */
@media (max-width: 768px) {
    .mybook-modal-library-btn {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* 독후감이 없을 때 정보 섹션 바닥 여백 제거 */
.mybook-modal-info-section.no-posts {
    padding-bottom: 32px;
}

/* 문장수집도 없고 독후감도 없을 때 최소 여백 */
.mybook-modal-info-section.no-quotes.no-posts {
    justify-content: flex-start;
    padding-bottom: 32px;
    min-height: auto;
}

/* 내용이 없는 섹션의 여백 최소화 */
.mybook-modal-info-section.minimal-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: auto;
    flex-grow: 0;
}

/* ========================================
   모달 카테고리 표시 스타일
   ======================================== */

/* 모달에서 카테고리 표시 (커버 이미지 왼쪽 상단) */
/* 정보 섹션 - 리스트와 동일한 스타일 */
.mybook-modal-info-section {
    padding: 24px !important;
    overflow-y: auto !important;
    max-height: 90vh !important;
}

.mybook-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 16px !important;
}

.mybook-modal-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #262626 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    flex: 1 !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

.mybook-modal-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
    margin-bottom: 24px !important;
}

.mybook-modal-category,
.mybook-modal-author,
.mybook-modal-publisher,
.mybook-modal-rating {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    color: #6c757d !important;
}

.mybook-modal-category i {
    width: 14px !important;
    font-size: 13px !important;
    color: #6c757d !important;
}

.mybook-modal-author i,
.mybook-modal-publisher i {
    width: 16px !important;
    font-size: 14px !important;
    color: #adb5bd !important;
}

.mybook-modal-stars {
    display: flex !important;
    gap: 3px !important;
}

.mybook-modal-stars i {
    font-size: 16px !important;
    color: #ffd700 !important;
}

.mybook-modal-stars .far {
    color: #dee2e6 !important;
}

/* ========================================
   모달 비공개 책 스타일
   ======================================== */

/* 모달 비공개 책 자물쇠 아이콘 */
.mybook-modal-title .mybook-private-indicator {
    color: #f39c12;
    margin-right: 8px;
    font-size: 0.85em;
    opacity: 0.9;
}

/* 모달 비공개 책 제목 스타일 */
.mybook-modal-title.private {
    color: #e67e22;
}

/* ========================================
   무한 스크롤 스타일
   ======================================== */

.mybook-infinite-scroll {
    margin: 40px 0;
    text-align: center;
    order: 2; /* 검색 폼보다 위에 배치 */
}

.mybook-load-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mybook-load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 120px;
    position: relative;
}

.mybook-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mybook-load-more-btn:active {
    transform: translateY(0);
}

.mybook-load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.mybook-load-more-btn .load-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mybook-load-more-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
