/* Books Page Styles */

.books-section {
    padding: 80px 0;
    background: white;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.book-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.book-cover {
    position: relative;
    width: 100%;
    padding-bottom: 130%;
    background: linear-gradient(135deg, #ff9500 0%, #d946a6 50%, #0066cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    overflow: hidden;
}

.book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-category {
    display: inline-block;
    font-size: 0.75rem;
    color: #ff9500;
    font-weight: 600;
    margin-bottom: 8px;
    background: #fff5e6;
    padding: 4px 12px;
    border-radius: 4px;
}

.book-year {
    float: right;
    font-size: 0.875rem;
    color: #999;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 8px 0 4px 0;
    line-height: 1.4;
    clear: both;
}

.book-author {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.book-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-description.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.book-more-btn {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 10px;
    font-weight: 500;
    text-align: left;
}

.book-more-btn:hover {
    text-decoration: underline;
}

.book-rating {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9375rem;
}

.book-stars {
    color: #ff9500;
    margin-right: 8px;
}

.book-award {
    display: flex;
    align-items: center;
    font-size: 0.9375rem;
    color: #666;
    margin-bottom: 16px;
}

.book-award-icon {
    margin-right: 8px;
}

.book-purchase-btn {
    width: 100%;
    padding: 8px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    margin-top: auto;
}

.book-purchase-btn:hover {
    background: #0052a3;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .book-info {
        padding: 12px;
    }

    .book-title {
        font-size: 0.9rem;
    }

    .books-section {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .book-cover {
        padding-bottom: 120%;
    }

    .book-info {
        padding: 10px;
    }

    .book-title {
        font-size: 0.9rem;
        margin: 6px 0 4px 0;
    }

    .book-category {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .book-purchase-btn {
        padding: 8px;
        font-size: 0.85rem;
    }
}


/* Books Section Header */
.books-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.books-section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.books-section-header .btn {
    padding: 12px 24px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.books-section-header .btn:hover {
    background: #0052a3;
    transform: translateY(-2px);
}

/* Book Actions Overlay */
.book-actions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    gap: 8px;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-actions-overlay {
    opacity: 1;
}

.book-actions-overlay .btn {
    flex: 1;
    padding: 8px 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.book-actions-overlay .btn:hover {
    background: #0052a3;
}

.book-actions-overlay .btn-danger {
    background: #dc2626;
}

.book-actions-overlay .btn-danger:hover {
    background: #b91c1c;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #1a1a1a;
}

/* Form Styles */
.book-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-size: 0.9375rem;
}

.form-group input,
.form-group textarea {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.image-preview {
    margin-top: 12px;
    display: none;
}

.image-preview.show {
    display: block;
}

.image-preview img {
    max-width: 100%;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.form-actions .btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-actions .btn-primary {
    background: #0066cc;
    color: white;
}

.form-actions .btn-primary:hover {
    background: #0052a3;
}

.form-actions .btn-secondary {
    background: #e5e7eb;
    color: #1a1a1a;
}

.form-actions .btn-secondary:hover {
    background: #d1d5db;
}

/* Responsive */
@media (max-width: 768px) {
    .books-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .books-section-header h2 {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* Admin Area Styles */
.admin-area {
    margin-top: 3rem;
    text-align: center;
    padding: 1.5rem 0;
}

.btn-outline-admin {
    padding: 10px 24px;
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-admin:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* Book Category Tag */
.book-category-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #FF8C42;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.book-year {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 2;
}

/* Star Rating */
.stars {
    display: inline-flex;
    gap: 2px;
    margin-right: 8px;
}

.star {
    color: #ddd;
    font-size: 1rem;
}

.star.filled {
    color: #ff9500;
}
