:root {
    --primary-dark: #024425;
    --primary-green: #099b57;
    --background-light: #f5f6f5;
    --text-dark: #1a1a1a;
    --text-muted: #666;
    --border-light: #d1d5db;
    --card-bg: #fff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --button-bg: #e0e0e0;
    --primary-dark: rgba(0, 0, 0, 0.7);  
    --primary-green: rgba(2, 95, 2, 0.5); 
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
        background-image: url('../../assets/images/heart.png'); 
        background-size: cover; 
        background-position: center; 
        color: white; 
        padding: 100px 20px; 
        text-align: center;
        
    } */

    .footer-container {
        color: white; 
        padding: 100px 20px; 
        text-align: center;
    }

.search-container {
    margin: 20px 10px 20px 10px;
    display: flex;
    justify-content: center;
}

.search-box {
    display: flex;
    align-items: center;
    width: min(100%, 500px);
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    font-size: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.search-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

.search-btn {
    
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-green);
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: scale(1.2);
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    background: var(--button-bg);
    color: var(--text-dark);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background: var(--primary-green);
    color: var(--card-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.filter-btn.active {
    background: var(--primary-green);
    color: var(--card-bg);
    font-weight: 600;
}

.filter-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    top: 0;
    left: -100%;
    transition: left 0.3s;
}

.filter-btn:hover::after {
    left: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-green);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 80%;
    margin: 0 auto; /* centra horizontalmente */
}


.book-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-align: center;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.book-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.book-card-content {
    padding: 15px;
}

.book-card-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.book-card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .search-box {
        max-width: 100%;
    }

    .category-filters {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 100%;
        max-width: 200px;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .search-input {
        padding: 10px 40px 10px 15px;
    }

    .book-card img {
        height: 200px;
    }
}