/* =======================================================
   DISSACRAZIONE - WATCHED STYLESHEET (TEATRO REARRANJADO)
======================================================= */

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

html, body {
    height: 100%;
    overflow: hidden;
    background-color: #0b0b0b;
    background-image: url("../moviesBG.png"); 
    background-size: cover;
    background-position: center;
    font-family: "Jacquard 12", serif;
    cursor: url("../cursor.png") 16 0, auto !important;
}

a, button, .book-item, .category-item {
    cursor: url("../cursor.png") 16 0, pointer !important;
}

/* ==================================== */
/* CONTROLES E ABAS DO TOPO ESQUERDO    */
/* ==================================== */
/* ==================================== */
/* MENU SUPERIOR                        */
/* ==================================== */

.top-left-controls{
    position: fixed;

    top: 24px;          /* desce 4px */
    right: -10px;

    width: 580px;       /* mesma largura da estante */

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 9999;
}

.category-menu{
    display: flex;
    flex-direction: row;

    justify-content: center;
    align-items: center;

    gap: 36px;          /* antes era 28px */
}

.category-item{
    position: relative;
    display: block;
    transition: transform .2s ease, filter .2s ease;
}

.category-item img{
    width: 54px;        /* antes 50px */
    height: 62px;       /* antes 58px */
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.8));
}

.category-item:hover{
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* ---------- TOOLTIP ---------- */

.category-item::after{

    content:attr(data-tooltip);

    position:absolute;

    top:calc(100% + 8px);
    left:50%;

    transform:translateX(-50%);

    padding:6px 12px;

    background:rgba(255,255,255,.82);

    color:#000;

    font-family:"Jacquard 12", serif;
    font-size:28px;

    border-radius:6px;

    white-space:nowrap;

    opacity:0;

    pointer-events:none;

    transition:opacity .2s;
}

.category-item:hover::after{
    opacity:1;
}


/* ==================================== */
/* LAYOUT LAYOUT SPLIT (INVERTIDO)      */
/* ==================================== */
.library-container {
    display: flex;
    /* Inverte a ordem física na tela: Preview vai para a ESQUERDA, Estante para a DIREITA */
    flex-direction: row-reverse; 
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: space-between;
    padding: 0 4% 0 18%; /* Dá espaço para os menus da esquerda não cobrirem o cartaz */
    transition: filter 0.4s ease;
}

.library-container.blurred {
    filter: blur(8px) brightness(0.4);
}

/* ==================================== */
/* ESTANTE NO CANTO INFERIOR DIREITO    */
/* ==================================== */
.shelf-wrapper {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 15px;
    position: absolute;
    bottom: -80px !important;  
    /* RECALIBRADO: Empurra a estante quase nada para a direita */
    right: -10px !important;  
    z-index: 5;
}

.book-shelf {
    position: relative;
    width: 580px;  
    height: 680px; 
}

.shelf-bg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill; 
}

/* Grid interno das prateleiras */
.books-container {
    position: absolute;
    inset: 0;
    padding: 10px 50px 40px 50px; 
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 25px; 
}

.book-item {
    position: relative; 
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: transform 0.2s ease;
}

.book-item .spine-img {
    max-width: 100%;
    max-height: 150px; 
    object-fit: contain;
    filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.6));
}

.book-item:hover {
    transform: translateY(-8px) scale(1.08); 
}

.book-item .fav-star-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: auto;
    z-index: 3;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.9));
    pointer-events: none;
}

/* ==================================== */
/* SETAS CENTRALIZADAS ACIMA DA ESTANTE */
/* ==================================== */
.shelf-wrapper .nav-arrow {
    position: absolute;
    top: -45px; 
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    z-index: 25;
}

.shelf-wrapper .left-arrow {
    left: calc(50% - 85px); 
}

.shelf-wrapper .right-arrow {
    left: calc(50% + 30px);
}


.nav-arrow img {
    width: 55px; 
    height: auto;
    display: block;
    opacity: 0.93 !important; 
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.8));
    transition: opacity 0.2s ease, filter 0.2s ease;
    pointer-events: none; 
}


.nav-arrow:hover {
    transform: scale(1.1); 
}

.nav-arrow:hover img {
    opacity: 1; 
    filter: brightness(1.2) drop-shadow(0px 0px 6px rgba(255, 255, 255, 0.4)); 
}

/* ==================================== */
/* PREVIEW DA CAPA CENTRALIZADO NO PALCO*/
/* ==================================== */
.preview-wrapper {
    position: absolute !important;
    
    /* AJUSTADO: Centralizado perfeitamente na base clara do palco do teatro */
    top: 60% !important;   
    left: 51.5% !important;  
    transform: translate(-50%, -50%) !important;
    
    width: 280px; 
    height: 420px;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 4;
}

/* Tamanho médio perfeito e proporcional para as capas de cinema */
.large-poster-container {
    position: relative; 
    width: 230px !important; /* AJUSTADO: Nem gigante como antes, nem minúsculo como agora */
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#largePreview {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    opacity: 0 !important;
    transition: opacity 0.25s ease-in-out;
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.75));
}

/* Estrelinha ajustada para o novo tamanho proporcional */
.large-poster-container .fav-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px; 
    height: auto;
    z-index: 4;
    opacity: 0 !important; 
    transition: opacity 0.25s ease-in-out;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.9));
    pointer-events: none;
}

#largePreview.active,
.large-poster-container .fav-badge.active {
    opacity: 1 !important;
}

/* Texto em Jacquard descansando confortavelmente perto do rodapé */
#bookInfo {
    font-family: "Jacquard 12", system-ui, serif;
    font-size: 1.35rem; 
    color: #ffffff; 
    text-align: center;
    white-space: nowrap;
    opacity: 0 !important; 
    transition: opacity 0.25s ease-in-out;
    text-shadow: 1px 1px 0px #000, -1px -1px 0px #000, 1px -1px 0px #000, -1px 1px 0px #000;
    pointer-events: none;
    user-select: none;
}

#bookInfo.active {
    opacity: 1 !important;
}




/* ==================================== */
/* POPUP MODAL (MINI REVIEW COM BLUR)   */
/* ==================================== */
.review-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(0px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.review-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.review-modal {
    position: relative;
    max-width: 85vw;
    max-height: 85vh;
    background: #000;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.9);
    transform: scale(0.92);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.review-overlay.show .review-modal {
    transform: scale(1);
}

.review-modal img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #ab0000;
    color: #fff;
    border: 1px solid #fff;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    font-family: monospace;
    z-index: 110;
}
