/* Componente totalmente encapsulado - todos os estilos aplicados dentro do container */

/* Seção do título e subtítulo */
.bookshelf-section {
    margin-bottom: 2rem;
    text-align: center;
}

.bookshelf-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.bookshelf-section .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.bookshelf-container {
    /* Fundo escuro para destacar a prateleira */
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

/* Container dos livros - comportamento responsivo principal */
.bookshelf-container .books {
    position: relative;
    margin-bottom: 20px;
    /* Em desktop: comporta-se como container normal */
    overflow: visible;
}

/* Trilho dos livros - layout padrão para desktop */
.bookshelf-container .slider-track {
    /* Desktop: Grid com 3 colunas */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-items: center;
    align-items: end;
    padding: 0 20px;
}

/* Estilos dos livros */
.bookshelf-container .book {
    width: 120px;
    height: 180px;
    background-image: var(--cover-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
    
    /* Efeito de borda para simular a lombada do livro */
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    border-right: 2px solid rgba(0, 0, 0, 0.3);
}

/* Efeito hover nos livros */
.bookshelf-container .book:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 15px 25px rgba(0, 0, 0, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Prateleira com efeito 3D */
.bookshelf-container .shelf {
    height: 25px;
    background: linear-gradient(
        to bottom,
        #8B4513 0%,
        #A0522D 20%,
        #CD853F 50%,
        #A0522D 80%,
        #654321 100%
    );
    border-radius: 4px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    margin: 0 10px;
    
    /* Efeito de profundidade */
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 10px,
            rgba(0, 0, 0, 0.1) 10px,
            rgba(0, 0, 0, 0.1) 11px
        );
}

/* Sombra da prateleira para criar profundidade */
.bookshelf-container .shelf::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 4px;
    right: 4px;
    height: 8px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        transparent 100%
    );
    border-radius: 0 0 50% 50%;
}

/* RESPONSIVIDADE: Media query para telas menores que 768px */
@media (max-width: 767px) {
    .bookshelf-container {
        padding: 30px 15px;
    }

    /* Container dos livros vira uma 'janela' do slider */
    .bookshelf-container .books {
        overflow-x: auto;
        overflow-y: hidden;
        /* Oculta a barra de rolagem visualmente */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer/Edge */
        
        /* Implementa scroll-snap para travar nos livros */
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
    }

    /* Oculta barra de rolagem no WebKit (Chrome, Safari) */
    .bookshelf-container .books::-webkit-scrollbar {
        display: none;
    }

    /* Trilho dos livros vira um slider horizontal */
    .bookshelf-container .slider-track {
        /* Remove o grid e usa flexbox para slider */
        display: flex;
        grid-template-columns: none;
        gap: 15px;
        padding: 0 15px;
        
        /* Largura maior que o container para permitir scroll */
        width: max-content;
        align-items: end;
    }

    /* Livros no mobile com scroll-snap */
    .bookshelf-container .book {
        /* Cada livro ocupa cerca de 70% da largura da tela */
        width: 70vw;
        max-width: 200px;
        min-width: 140px;
        height: calc(70vw * 1.5); /* Mantém proporção */
        max-height: 300px;
        min-height: 210px;
        
        /* Implementa scroll-snap para centralizar cada livro */
        scroll-snap-align: center;
        flex-shrink: 0; /* Impede que os livros encolham */
    }

    /* Prateleira no mobile */
    .bookshelf-container .shelf {
        margin: 0 5px;
    }
}

/* Media query adicional para telas muito pequenas */
@media (max-width: 480px) {
    .bookshelf-section h2 {
        font-size: 1.5rem;
    }

    .bookshelf-section .subtitle {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .bookshelf-container {
        padding: 20px 10px;
    }

    .bookshelf-container .book {
        width: 75vw;
        max-width: 160px;
        height: calc(75vw * 1.5);
        max-height: 240px;
    }

    .bookshelf-container .slider-track {
        padding: 0 10px;
        gap: 10px;
    }
}