/**
 * LIBRARY STYLES - APRIMORIZZE
 * Estilos específicos para a página "Minha Biblioteca"
 */

/* ===== HERO SECTION ===== */
.library-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.library-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-pattern.svg') repeat;
    opacity: 0.1;
    z-index: 1;
}

.library-hero .container {
    position: relative;
    z-index: 2;
}

.library-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.library-hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.library-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 120px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== FILTROS E BUSCA ===== */
.library-filters {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filters-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-group {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.search-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.livros-count {
    color: #6b7280;
    font-size: 0.9rem;
    margin-left: auto;
}

/* ===== CARDS DE LIVROS ===== */
.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.book-cover {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.book-cover img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 4px;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.book-badge.rh {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.book-badge.financas {
    background: linear-gradient(135deg, #10b981, #059669);
}

.book-badge.gestao {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.book-badge.carreira {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.book-badge.tecnologia {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.blog-post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-metadata {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item i {
    color: var(--primary-color);
    width: 16px;
}

.book-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
    line-height: 1.4;
}

.book-card p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.book-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.library-sidebar {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #f3f4f6;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3 i {
    color: var(--primary-color);
}

/* Categorias */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 0.5rem;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-link:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-count {
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

/* Livros em destaque */
.featured-book-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f9fafb;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.featured-book-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.featured-book-cover {
    width: 60px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.featured-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-book-info {
    flex: 1;
    min-width: 0;
}

.featured-book-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1f2937;
    line-height: 1.3;
}

.book-author {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* Aviso legal */
.affiliate-disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.875rem;
    color: #92400e;
}

.affiliate-disclaimer h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.affiliate-disclaimer p {
    margin: 0;
    line-height: 1.5;
}

/* ===== PAGINAÇÃO ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination button {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* ===== ESTADOS ESPECIAIS ===== */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.no-results i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.fallback-content {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.fallback-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.fallback-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #374151;
}

.fallback-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .library-hero h1 {
        font-size: 2rem;
    }
    
    .library-stats {
        gap: 1rem;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-group {
        min-width: auto;
    }
    
    .livros-count {
        margin-left: 0;
        text-align: center;
    }
    
    .book-actions {
        flex-direction: column;
    }
    
    .library-sidebar {
        position: static;
        margin-top: 2rem;
    }
    
    .featured-book-item {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-book-cover {
        width: 80px;
        height: 100px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .library-hero {
        padding: 2rem 0;
    }
    
    .library-hero h1 {
        font-size: 1.75rem;
    }
    
    .library-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-item {
        min-width: auto;
    }
    
    .book-metadata {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: fadeInUp 0.6s ease-out;
}

.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.2s; }
.book-card:nth-child(4) { animation-delay: 0.3s; }
.book-card:nth-child(5) { animation-delay: 0.4s; }
.book-card:nth-child(6) { animation-delay: 0.5s; }

/* ===== UTILITÁRIOS ===== */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }