/* ==========================================================================
   BOOKS PAGES CSS - CLEAN VERSION
   ========================================================================== */

/* ==========================================================================
   1. BOOKS LIST PAGE (.books-page)
   ========================================================================== */

.books-page .search-section {
    margin-bottom: 1.5rem;
}

.books-page .search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.books-page .search-icon {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    font-size: 1.125rem;
    pointer-events: none;
}

.books-page .search-input {
    padding-left: 3rem;
    padding-right: 3rem;
    height: 3rem;
    border-radius: 50px;
    border: 2px solid #e5e7eb;
    font-size: 1rem;
    transition: all 0.3s;
}

.books-page .search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.books-page .btn-clear {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.books-page .btn-clear:hover {
    color: #ef4444;
}

/* Filters Panel */
.books-page .filters-panel {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active Filters Display */
.books-page .active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.books-page .active-filters > span:first-child {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
}

.books-page .active-filters .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 50px;
}

.books-page .active-filters .badge .btn-close {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.books-page .active-filters .badge .btn-close:hover {
    opacity: 1;
}

/* Status Message */
.books-page .alert {
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.books-page .filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.books-page .filters-header h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #1f2937;
    font-weight: 600;
}

.books-page .filters-header h5 i {
    color: #2563eb;
}

.books-page .filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.books-page .filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.books-page .filter-tag:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.books-page .filter-tag.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3);
}

.books-page .filter-tag.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(102, 126, 234, 0.4);
}

.books-page .filter-tag i {
    font-size: 1rem;
}

.books-page .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.books-page .book-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
    aspect-ratio: 2/3;
}

.books-page .book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.books-page .book-card:hover .book-overlay {
    opacity: 1;
}

/* Only show info on hover if there's an image */
.books-page .book-card:has(.book-cover img):hover .book-info {
    opacity: 0;
}

/* Always show info if no image (placeholder) */
.books-page .book-card:has(.book-cover-placeholder) {
    display: flex;
    flex-direction: column;
}

.books-page .book-card:has(.book-cover-placeholder) .book-cover {
    position: static;
    flex: 1;
    min-height: 0;
}

.books-page .book-card:has(.book-cover-placeholder) .book-info {
    transform: translateY(0);
    opacity: 1;
    position: static;
    padding: 1rem;
    background: white;
    color: #1f2937;
    flex-shrink: 0;
}

.books-page .book-card:has(.book-cover-placeholder) .book-title {
    color: #1f2937;
    text-shadow: none;
}

.books-page .book-card:has(.book-cover-placeholder) .book-author {
    color: #6b7280;
    text-shadow: none;
}

.books-page .book-card:has(.book-cover-placeholder) .book-overlay {
    display: none;
}

.books-page .book-card:has(.book-cover-placeholder) .book-actions {
    position: static;
    opacity: 1;
    transform: translateY(0);
    margin-top: 0;
    padding: 0.5rem;
    background: white;
}

.books-page .book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f9fafb;
}

.books-page .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.books-page .book-card:hover .book-cover img {
    transform: scale(1.05);
}

.books-page .book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.books-page .book-cover-placeholder i {
    font-size: 4rem;
    opacity: 0.5;
}

.books-page .book-rating {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.books-page .book-rating i {
    color: #fbbf24;
    font-size: 0.75rem;
}

.books-page .book-rating span {
    color: #1f2937;
    font-size: 0.75rem;
}

.books-page .book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.books-page .book-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    color: white;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s;
}

.books-page .book-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.books-page .book-author {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.books-page .book-actions {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    z-index: 3;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.books-page .book-card:hover .book-actions {
    opacity: 1;
    transform: translateY(0);
}

.books-page .book-actions .btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.books-page .book-actions .btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.books-page .book-actions .btn i {
    font-size: 1rem;
}

/* ==========================================================================
   2. BOOK DETAIL PAGE (.book-detail-page)
   ========================================================================== */

.book-detail-page {
    min-height: 100vh;
    background: #f9fafb;
}

.book-detail-page .book-detail-hero {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

.book-detail-page .book-detail-hero h1 {
    color: #1f2937;
    font-weight: 700;
}

.book-detail-page .book-detail-hero .lead {
    color: #6b7280;
}

.book-detail-page .book-cover-large {
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
}

.book-detail-page .book-cover-large img {
    width: 100%;
    height: auto;
    display: block;
}

.book-detail-page .book-cover-placeholder-large {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.book-detail-page .book-cover-placeholder-large i {
    font-size: 5rem;
    opacity: 0.5;
}

.book-detail-page .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.book-detail-page .btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

.book-detail-page .status-badge {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    color: #2563eb;
}

.book-detail-page .attribute-progress-item {
    background: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.book-detail-page .attribute-label {
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 500;
}

.book-detail-page .attribute-score {
    font-size: 0.875rem;
    font-weight: 700;
    color: #2563eb;
}

.book-detail-page .book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.book-detail-page .content-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

.book-detail-page .content-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.book-detail-page .description-text {
    line-height: 1.8;
    color: #6b7280;
}

.book-detail-page .detail-tabs {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 2rem;
}

.book-detail-page .detail-tabs .nav-link {
    padding: 1rem 1.5rem;
    border: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    background: transparent;
}

.book-detail-page .detail-tabs .nav-link:hover {
    color: #2563eb;
    background: transparent;
}

.book-detail-page .detail-tabs .nav-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: none;
}

.book-detail-page .tab-content-section {
    min-height: 300px;
}

.book-detail-page .review-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    border-left: 4px solid #2563eb;
}

.book-detail-page .review-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.book-detail-page .review-author {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.book-detail-page .review-date {
    font-size: 0.875rem;
    color: #9ca3af;
}

.book-detail-page .star-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0;
}

.book-detail-page .star-rating i {
    font-size: 1rem;
}

.book-detail-page .quote-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2563eb;
}

.book-detail-page .quote-text {
    font-size: 1.125rem;
    font-style: italic;
    color: #1f2937;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.book-detail-page .quote-author {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.book-detail-page .quote-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.book-detail-page .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.book-detail-page .empty-state i {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.book-detail-page .empty-state h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.book-detail-page .empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   3. MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    /* Books list mobile */
    .books-page .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .books-page .book-card {
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        border-radius: 0.5rem;
    }

    .books-page .book-overlay {
        opacity: 0.6;
    }

    .books-page .book-card:has(.book-cover img) .book-overlay {
        opacity: 0.8;
    }

    .books-page .book-info {
        transform: translateY(0);
        opacity: 0;
        padding: 0.75rem;
    }

    .books-page .book-title {
        font-size: 0.8125rem;
    }

    .books-page .book-author {
        font-size: 0.6875rem;
    }

    .books-page .book-actions {
        opacity: 1;
        transform: translateY(0);
        bottom: 0.375rem;
        left: 0.375rem;
        right: 0.375rem;
        gap: 0.25rem;
    }

    .books-page .book-actions .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.25rem;
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, 0.35);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .books-page .book-actions .btn i {
        font-size: 0.875rem;
    }

    .books-page .book-rating {
        top: 0.375rem;
        right: 0.375rem;
        padding: 0.25rem 0.375rem;
    }

    .books-page .book-rating i,
    .books-page .book-rating span {
        font-size: 0.6875rem;
    }

    .books-page .book-card:has(.book-cover-placeholder) {
        display: flex;
        flex-direction: column;
    }

    .books-page .book-card:has(.book-cover-placeholder) .book-cover {
        position: static;
        flex: 1;
        min-height: 0;
    }

    .books-page .book-card:has(.book-cover-placeholder) .book-actions {
        position: static;
        margin-top: 0;
        opacity: 1;
        padding: 0.375rem;
        background: white;
    }

    .books-page .book-card:has(.book-cover-placeholder) .book-info {
        padding: 0.5rem;
        background: white;
    }

    /* Book details mobile */
    .book-detail-page .book-detail-hero {
        padding: 1rem 0;
    }

    .book-detail-page .book-cover-large {
        margin-bottom: 1rem;
    }

    .book-detail-page .action-buttons {
        gap: 0.5rem;
    }

    .book-detail-page .btn-action {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    .book-detail-page .detail-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .book-detail-page .quote-card {
        padding: 1.5rem;
    }

    .book-detail-page .quote-text {
        font-size: 1rem;
    }
}
