/* ========================================= */
/* CONFIGURAÇÃO DO CENÁRIO (TRANSPARENTE) */
/* ========================================= */
.info-container {
    background: transparent;
    min-height: 90vh;
    display: flex;
    align-items: flex-start;
    /* AJUSTE AQUI: Alinha o conteúdo ao topo */
    justify-content: center;
    padding: 10px 0;
    /* AJUSTE AQUI: Reduz o padding vertical */
    perspective: 1500px;
    overflow: hidden;
}

/* ========================================= */
/* O LIVRO ABERTO (CONTAINER) */
/* ========================================= */
.book-container {
    position: relative;
    width: 1100px;
    height: 750px;
    background-color: #5e3b24;
    /* Capa de couro marrom */
    border-radius: 15px;
    box-shadow:
        inset 0 0 0 10px #3e2716;
    display: flex;
    padding: 15px 20px 20px 20px;
    margin: auto;
    max-width: 95vw;
}

/* Lombada central */
.book-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 40px;
    margin-left: -20px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1) 40%, rgba(255, 255, 255, 0.1) 50%, rgba(0, 0, 0, 0.2));
    z-index: 5;
    border-radius: 5px;
}

/* ========================================= */
/* AS PÁGINAS */
/* ========================================= */
.page-area {
    flex: 1;
    background-color: #fdfbf7;
    height: 100%;
    position: relative;
    /* DISTÂNCIA: Padding vertical ajustado para afastar os livros das bordas */
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    /* DISTÂNCIA: Space-between força um livro pro topo e um pro fundo */
    justify-content: space-between;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#page-left {
    border-radius: 5px 0 0 5px;
    border-right: 1px solid #ddd;
    background: linear-gradient(to right, #e3dfd3 0%, #fdfbf7 15%);
}

#page-right {
    border-radius: 0 5px 5px 0;
    border-left: 1px solid #ddd;
    background: linear-gradient(to left, #e3dfd3 0%, #fdfbf7 15%);
}

/* ========================================= */
/* EFEITO DE VIRAR PÁGINA (FLIPPER) */
/* ========================================= */
.flipper {
    position: absolute;
    top: 15px;
    bottom: 20px;
    width: calc(50% - 20px);
    background-color: #fdfbf7;
    z-index: 100;
    transform-origin: left center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    pointer-events: none;
    opacity: 0;
    display: none;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 5px 5px 0;
}

.flipper.turning-next {
    display: block;
    opacity: 1;
    right: 20px;
    animation: flipNext 0.9s ease-in-out forwards;
    background: linear-gradient(to left, #e3dfd3 0%, #fdfbf7 10%);
}

@keyframes flipNext {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(-180deg);
        opacity: 0;
    }
}

.flipper.turning-prev {
    display: block;
    opacity: 1;
    left: 20px;
    transform-origin: right center;
    animation: flipPrev 0.9s ease-in-out forwards;
    background: linear-gradient(to right, #e3dfd3 0%, #fdfbf7 10%);
}

@keyframes flipPrev {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(180deg);
        opacity: 0;
    }
}

/* ========================================= */
/* ESTILO DOS CARDS DENTRO DO LIVRO */
/* ========================================= */
.book-item-wrapper {
    /* Altura fixa para controlar o layout */
    height: 40%;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Dentro da seção de CSS */
.livro-card-no-link {
    cursor: default !important; /* Muda o cursor para o padrão */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Remove o hover para evitar sugestão de clique */
}

.livro-card-no-link:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Impede a mudança de sombra no hover */
    transform: none; /* Impede a animação de subir */
    border-color: #e0e0e0; /* Impede a mudança de cor da borda */
}

.livro-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.livro-card:hover {
    box-shadow: 0 8px 20px rgba(24, 155, 174, 0.2);
    transform: translateY(-3px);
    border-color: #189bae;
}

.livro-img-container {
    width: 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 10px;
}

.livro-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}

.livro-content {
    width: 65%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.livro-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.livro-link {
    font-size: 0.9rem;
    color: #189bae;
    text-decoration: none;
    font-weight: bold;
}

/* ========================================= */
/* BOTÕES DE NAVEGAÇÃO (SETAS) */
/* ========================================= */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #189bae;
    color: #ffffff !important;
    /* Força cor branca */
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 200;
    transition: all 0.3s;

    /* Centralização do texto (seta) */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Tamanho da seta */
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.nav-btn:hover {
    background-color: #0e446a;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:disabled {
    background-color: #ccc;
    color: #eee !important;
    cursor: not-allowed;
    transform: translateY(-50%);
    box-shadow: none;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Contador de páginas */
.page-number {
    position: absolute;
    bottom: 20px;
    font-size: 14px;
    color: #888;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
}

.left-num {
    left: 30px;
}

.right-num {
    right: 30px;
}

/* ========================================= */
/* VERSÃO MOBILE (LIVRO EM PÁGINA ÚNICA) */
/* ========================================= */
@media (max-width: 992px) {

    .info-container {
        padding: 40px 0;
        align-items: center;
    }

    .book-container {
        /* Reduz a largura para caber uma página e ajusta padding */
        width: 450px;
        max-width: 90vw;
        height: 700px;
        /* Altura ajustada para mobile */

        /* Remove a moldura marrom, mas mantém a sombra para destacar */
        background: transparent;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        padding: 0;
    }

    .book-spine {
        /* Oculta a lombada central, pois não há página direita */
        display: none;
    }

    .flipper {
        display: none !important;
    }

    /* A página direita é totalmente ocultada */
    #page-right {
        display: none;
    }

    /* A página esquerda ocupa todo o espaço do container */
    #page-left {
        flex: 1;
        width: 100%;
        border: 10px solid #5e3b24;
        /* Adiciona uma borda marrom para simular a capa fechada */
        border-radius: 10px;
        background: #fdfbf7;
        padding: 30px 20px;
        box-shadow: none;
    }

    /* Ajusta a sombra para o lado do livro aberto */
    #page-left::after {
        content: '';
        position: absolute;
        top: 0;
        right: -10px;
        /* Posição à direita da página */
        bottom: 0;
        width: 10px;
        /* Largura da sombra */
        background: rgba(0, 0, 0, 0.1);
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
        border-radius: 0 10px 10px 0;
    }

    .book-item-wrapper {
        height: 300px;
        /* Aumenta a altura de cada card para melhor visualização */
        margin-bottom: 20px;
    }

    .nav-btn {
        top: 50%;
        /* Mantém centralizado verticalmente */
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }

    /* Oculta a numeração de páginas, pois agora é página única */
    .page-number {
        display: none;
    }
}