/* Books Section Styles */
.books-section {
    padding: 20px 40px;
    animation: fadeIn 0.5s ease;
}

.books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.books-mode-selector {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn svg {
    width: 18px;
    height: 18px;
}

.mode-btn.active {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.mode-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.search-container-books {
    position: relative;
    width: 300px;
}

.search-container-books input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.search-container-books input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.search-container-books button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.book-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.4);
}

.book-cover {
    position: relative;
    width: 100%;
    height: 270px;
    overflow: hidden;
    background: #1a1a1a;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.1);
}

.book-cover.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.book-cover.no-image svg {
    width: 60px;
    height: 60px;
    color: rgba(255, 255, 255, 0.2);
}

.book-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.book-badge.online {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
}

.book-badge.offline {
    background: rgba(168, 85, 247, 0.9);
    color: #fff;
}

.book-badge.library {
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
}

.book-size {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.book-info {
    padding: 15px;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 12px 0;
}

.book-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.read-btn {
    background: #3b82f6;
    color: #fff;
}

.read-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.download-btn {
    background: #a855f7;
    color: #fff;
}

.download-btn:hover {
    background: #9333ea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.library-btn {
    background: #22c55e;
    color: #fff;
}

.library-btn:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3);
}

.book-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.books-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.books-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.books-empty p {
    font-size: 1.1rem;
}

/* Loader */
.books-loader {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Download Modal */
.book-download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.book-download-content {
    background: #121218;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.book-download-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.book-download-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.download-path {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-path code {
    color: #a855f7;
    font-size: 0.85rem;
    word-break: break-all;
    user-select: all;
}

.download-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 25px;
}

.download-actions {
    display: flex;
    gap: 15px;
}

.cancel-btn, .download-now-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.download-now-btn {
    background: #a855f7;
    color: #fff;
}

.download-now-btn:hover {
    background: #9333ea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
