/* ==========================================
   🎨 E-Book Gallery - Premium Design
   ========================================== */

/* 전역 변수 설정 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-hover: 0 12px 48px rgba(0,0,0,0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
}

/* 메인 컨테이너 */
#inner_box {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 100px;
}

/* 갤러리 그리드 */
.moreBox.gallery_more {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    padding: 20px 0;
}

/* 개별 e-book 카드 */
.ebook_row {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ebook_box {
    height: 100%;
    perspective: 1000px;
}

/* 카드 메인 */
.item_cell {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--border-radius) !important;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.item_cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    z-index: 1;
}

.item_cell:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.item_cell:hover::before {
    opacity: 1;
}

/* 이미지 영역 */
.service-box.item_img {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.service-box.item_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-box.item_img:hover img {
    transform: scale(1.08);
}

/* ==========================================
   📱 PDF 트리거 아이콘 - 고급 버전
   ========================================== */

/* 옵션 1: 모던한 Play 버튼 (추천) */
/* 오버레이 배경 */
.pdf-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Bootstrap Icons 책 아이콘 */
.pdf-trigger::before {
    content: '\F194';
    font-family: 'bootstrap-icons' !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 40px;
    color: var(--color-main);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
    font-weight: normal;
    font-style: normal;
}
.pdf-trigger:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.pdf-trigger:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ============================================ */

/* 옵션 2: "READ" 텍스트 버튼 */
/*
.pdf-trigger::after {
    content: 'READ';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 32px;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pdf-trigger:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
*/

/* ============================================ */

/* 옵션 3: 확대경 아이콘 (SVG 스타일) */
/*
.pdf-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pdf-trigger::before {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 42px;
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
    filter: grayscale(1);
}

.pdf-trigger:hover::after,
.pdf-trigger:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
*/

/* ============================================ */

/* 옵션 4: "OPEN" 텍스트와 화살표 조합 */
/*
.pdf-trigger::after {
    content: 'OPEN';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    padding: 20px 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 3px;
    border-radius: 16px;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
}

.pdf-trigger:hover::after {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
}
*/

/* ============================================ */

/* 옵션 5: 책 펼침 애니메이션 아이콘 */
/*
.pdf-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 70px;
    height: 50px;
    background: 
        linear-gradient(90deg, transparent 48%, #fff 48%, #fff 52%, transparent 52%),
        linear-gradient(to right, #f8f9fa 50%, #e9ecef 50%);
    border-radius: 8px;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 0 3px rgba(52, 152, 219, 0.5);
}

.pdf-trigger:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
*/

/* ============================================ */

/* 옵션 6: 미니멀 원형 + 문서 아이콘 */
/*
.pdf-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    border: 3px solid var(--secondary-color);
}

.pdf-trigger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 32px;
    height: 40px;
    background: 
        linear-gradient(to bottom, transparent 8px, var(--secondary-color) 8px),
        linear-gradient(to right, transparent 24px, transparent 24px, var(--secondary-color) 24px, var(--secondary-color) 32px, transparent 32px);
    border: 2px solid var(--secondary-color);
    border-radius: 2px;
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.pdf-trigger:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.pdf-trigger:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
*/

/* ============================================ */

/* 추가 효과: 펄스 애니메이션 */
@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

.pdf-trigger:hover::after {
    animation: pulse-ring 1.5s ease-out infinite;
}



/* 콘텐츠 영역 */
.item_box {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #fff;
    position: relative;
    z-index: 2;
}

.item_content {
    flex: 1;
}

/* 제목 */
.gall_title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: var(--transition);
    text-decoration: none;
}

.gall_title:hover {
    color: var(--secondary-color);
}

/* 내용 */
.gall_content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 정보 영역 */
.gall_info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid #ecf0f1;
    font-size: 12px;
}

.gall_info small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.gall_info small i {
    font-size: 14px;
    opacity: 0.7;
}

.gall_name {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* 이벤트 배지 */
.event {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    background: var(--bg-light);
}

.event .expect {
    color: #95a5a6;
}

.event .ing {
    color: #27ae60;
}

.event .on {
    color: #f39c12;
}

.event .off {
    color: #e74c3c;
}

.event strong {
    font-size: 16px;
}

/* More 버튼 */
.item_more {
    margin-top: 16px;
}

.item_more a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--color-main);
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 12px #e1e1e1;
}

.item_more a::after {
    content: '→';
    transition: var(--transition);
}

.item_more a:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 16px #b9b8c3;
}

.item_more a:hover::after {
    transform: translateX(4px);
}

/* 공유 버튼 */
.gallery_op_btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    opacity: 0;
    transition: var(--transition);
}

.ebook_row:hover .gallery_op_btn {
    opacity: 1;
}

.share_bnt {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.share_bnt:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: rotate(15deg) scale(1.1);
}

.share_bnt i {
    font-size: 18px;
}

/* 더보기 영역 */
.more_wrap {
    text-align: center;
    margin-top: 60px;
}

.more_btn {
    display: block;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 32px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.more_btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.more_btn:hover::before {
    width: 300px;
    height: 300px;
}

.more_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

/* 빈 리스트 */
.empty_list {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.no_more_message {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 체크박스 (관리자용) */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--secondary-color);
}

/* 보더 스타일 (board_line) */
.board_line_1 {
    border: 2px solid #e8e8e8;
}

.board_line_2 {
    border: 3px solid #d0d0d0;
}

.board_line_3 {
    border: 4px solid #b8b8b8;
    box-shadow: var(--shadow-md);
}

.board_line_4 {
    border: 5px solid #a0a0a0;
    box-shadow: var(--shadow-lg);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .moreBox.gallery_more {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    #inner_box {
        padding: 20px 16px 60px;
    }
    
    .moreBox.gallery_more {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .item_box {
        padding: 16px;
    }
    
    .gall_title {
        font-size: 16px;
    }
    
    .gall_content {
        font-size: 13px;
    }
    
    .gallery_op_btn {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .moreBox.gallery_more {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .item_cell {
        border-radius: 12px !important;
    }
}

/* 로딩 애니메이션 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
}

/* 스크롤바 커스텀 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--secondary-color), #5dade2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
}

/* 다크모드 대응 (선택사항) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ecf0f1;
        --text-secondary: #bdc3c7;
        --bg-light: #2c3e50;
    }
    
    .item_cell {
        background: #34495e;
    }
    
    .item_box {
        background: #34495e;
    }
    
    .gall_info {
        border-top-color: #2c3e50;
    }
}

/* 인쇄 스타일 */
@media print {
    .gallery_op_btn,
    .more_wrap {
        display: none;
    }
    
    .item_cell {
        break-inside: avoid;
        box-shadow: none;
    }
}