* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    flex: 1;
    width: 100%;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    color: #ecf0f1;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Playfair Display', serif;
}

.site-description {
    text-align: center;
    color: #bdc3c7;
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-section {
    background: rgba(255, 255, 255, 0.98);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    width: 100%;
}

.search-form {
    margin-bottom: 0;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
    width: 100%;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    width: 100%;
}

.search-form input:focus {
    outline: none;
    border-color: #7f8c8d;
    box-shadow: 0 0 0 3px rgba(127, 140, 141, 0.1);
}

.search-form button {
    padding: 1rem;
    background: #34495e;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.search-form button:hover {
    background: #2c3e50;
    transform: translateY(-1px);
}

.button-group {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
    margin: 1rem 0;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 12px;
    background: rgba(44, 62, 80, 0.3);
    backdrop-filter: blur(5px);
    width: 100%;
    flex-wrap: wrap;
}

.download-btn {
    padding: 0.6rem 1rem;
    background: rgba(127, 140, 141, 0.8);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.download-btn:hover {
    background: rgba(108, 122, 125, 0.9);
    transform: translateY(-1px);
}

.upload-btn {
    padding: 0.6rem 1rem;
    background: rgba(149, 165, 166, 0.8);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    opacity: 0.9;
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.upload-btn:hover {
    background: rgba(127, 140, 141, 0.9);
    opacity: 1;
}

.search-download-btn {
    padding: 0.6rem 1rem;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    opacity: 0.9;
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.search-download-btn:hover {
    background: rgba(41, 128, 185, 0.9);
    opacity: 1;
    transform: translateY(-1px);
}

.books-list {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-top: 1rem;
    width: 100%;
}

.table-container {
    overflow-x: auto;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed;
}

/* 데스크톱에서만 최소 너비 적용 */
@media (min-width: 769px) {
    table {
        min-width: 800px;
    }
}

th:first-child, td:first-child {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

th:nth-child(2), td:nth-child(2) {
    width: 50%;
    min-width: 200px;
}

th:nth-child(3), td:nth-child(3) {
    width: 20%;
    min-width: 208px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th:nth-child(4), td:nth-child(4) {
    width: 12%;
    min-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th:nth-child(5), td:nth-child(5) {
    width: 15%;
    min-width: 100px;
    max-width: 120px;
    white-space: nowrap;
    overflow: visible;
}

th {
    background: rgba(236, 240, 241, 0.9);
    color: #2c3e50;
    font-weight: 600;
    text-align: left;
    padding: 1.2rem 1rem;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #34495e;
}

tr:hover {
    background-color: rgba(236, 240, 241, 0.4);
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: rgba(236, 240, 241, 0.6);
}

.sort-icon {
    margin-left: 0.25rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0.8rem;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
        padding: 0 0.5rem;
    }

    .site-description {
        font-size: 0.85rem;
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }

    .search-section {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    .search-input-group {
        gap: 0.3rem;
    }

    .search-form input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .search-form button {
        padding: 0.8rem;
        font-size: 0.9rem;
        min-width: 60px;
    }

    .button-group {
        margin: 0.8rem 0.5rem;
        padding: 0.4rem;
        gap: 0.3rem;
    }

    .download-btn, .upload-btn, .search-download-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .books-list {
        margin: 0.8rem 0.5rem;
    }

    th:first-child, td:first-child {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }

    th:nth-child(2), td:nth-child(2) {
        width: 45%;
        min-width: 150px;
    }

    th:nth-child(3), td:nth-child(3) {
        width: 23%;
        min-width: 156px;
    }

    th:nth-child(4), td:nth-child(4) {
        width: 18%;
        min-width: 110px;
    }

    th:nth-child(5), td:nth-child(5) {
        width: 20%;
        min-width: 80px;
        max-width: 100px;
        white-space: nowrap;
        overflow: visible;
    }

    th, td {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .footer {
        padding: 0.8rem 0;
        margin-top: 1rem;
    }

    .footer-content {
        padding: 0 0.5rem;
    }
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

.upload-instructions {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.upload-instructions h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.upload-instructions ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.upload-instructions ul ul {
    list-style-type: circle;
    margin: 0.5rem 0;
}

.upload-instructions li {
    margin-bottom: 0.5rem;
}

.password-section {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.password-section input[type="password"] {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.confirm-btn {
    padding: 0.5rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.confirm-btn:hover {
    background-color: #2980b9;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }

    .password-section {
        flex-direction: column;
    }

    .confirm-btn {
        width: 100%;
    }
}

.footer {
    background: #2c3e50;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer p {
    color: #bdc3c7;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .footer {
        padding: 0.8rem 0;
        margin-top: 1rem;
    }

    .footer-content {
        padding: 0 1rem;
    }
}

/* 추천대상 관련 스타일 */
.recommendation-cell {
    line-height: 1.5;
    white-space: nowrap;
    overflow: visible;
}

/* [보기]/[닫기] 버튼 기본 스타일 */
.more-btn {
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: white;
    min-width: 50px;
    text-align: center;
}

/* [보기] 버튼 - 다운로드 버튼 색상 */
.more-btn {
    background: rgba(127, 140, 141, 0.8);
}

.more-btn:hover {
    background: rgba(108, 122, 125, 0.9);
    transform: translateY(-1px);
}

/* [닫기] 버튼 - 검색 버튼 색상 */
.more-btn.close-btn {
    background: #34495e;
}

.more-btn.close-btn:hover {
    background: #2c3e50;
    transform: translateY(-1px);
}

/* 추천대상 확장 행 스타일 */
.recommendation-row {
    background: rgba(52, 152, 219, 0.15);
    border-right: 4px solid #3498db;
    border-left: none;
}

.recommendation-content {
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid #e9ecef !important;
}

.recommendation-detail {
    color: #2c3e50;
    line-height: 1.6;
    font-size: 0.9rem;
    word-wrap: break-word;
    white-space: normal;
    text-align: justify;
}

/* 모바일에서 버튼 크기 조정 */
@media (max-width: 768px) {
    .more-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        min-width: 45px;
    }
    
    .recommendation-content {
        padding: 0.8rem 1rem !important;
    }
    
    .recommendation-detail {
        font-size: 0.85rem;
    }
}

/* 페이지네이션 스타일 - 모던하고 미니멀한 디자인 */
#pagination-container {
    padding: 1.2rem 0;
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    width: 100%;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;
}

.page-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-btn:hover::before {
    opacity: 0.1;
    transform: scale(1);
}

.page-btn:hover {
    color: #2c3e50;
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
    transform: translateY(-1px);
}

.page-btn.active::before {
    display: none;
}

.page-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 73, 94, 0.4);
}

/* 이전/다음 버튼 스타일 */
.page-btn:not([onclick*="goToPage"]):not(.page-dots),
.page-btn[onclick*="◀"],
.page-btn[onclick*="▶"] {
    width: auto;
    padding: 0 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0 0.3rem;
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
}

.page-btn[onclick*="◀"]::before,
.page-btn[onclick*="▶"]::before {
    border-radius: 20px;
}

.page-dots {
    padding: 0 0.5rem;
    color: #bdc3c7;
    font-weight: 600;
    user-select: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    #pagination-container {
        padding: 1rem 0.5rem;
    }
    
    .pagination {
        padding: 0.6rem 1rem;
        gap: 0.2rem;
        border-radius: 20px;
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .page-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .page-btn:not([onclick*="goToPage"]):not(.page-dots),
    .page-btn[onclick*="◀"],
    .page-btn[onclick*="▶"] {
        padding: 0 0.8rem;
        font-size: 0.8rem;
        margin: 0 0.2rem;
        white-space: nowrap;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .page-dots {
        padding: 0 0.3rem;
        font-size: 1rem;
    }
} 