/* ==========================================================================
   SIDE ANCHOR MENU (MENU FIXO LATERAL VERTICAL DESKTOP + MODAL MOBILE)
   Ateliê José Augusto Novas e Júlio César Mota Petrucci
   ========================================================================== */

/* --- CONTAINER FIXO DA SIDEBAR (ENGLEBA OS 2 CARTÕES SEPARADOS) --- */
.side-menu-sidebar-container {
    position: fixed;
    top: 105px; /* Afasta os cartões do menu superior (pill) */
    left: 16px; /* Margem estreita para aproveitar melhor a área lateral */
    z-index: 995;
    width: min(clamp(250px, 24vw, 305px), calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    display: flex;
    flex-direction: column;
    gap: 16px; /* ZONA NEUTRA TRANSPARENTE ENTRE OS DOIS CARTÕES DE PAPEL */
    pointer-events: none; /* Permite interagir com o fundo transparente da zona neutra */
}

/* --- CARTÕES DE PAPEL INDEPENDENTES (BOX 1 NAVEGAÇÃO E BOX 2 STREAMING) --- */
.side-anchor-menu,
.side-streaming-card {
    pointer-events: auto; /* Reativa cliques nos cartões */
    width: 100%;
    
    /* Textura e tom de papel antigo artesanal */
    background-color: var(--color-paper, #fdfbf7);
    background-image: linear-gradient(135deg, rgba(253, 251, 247, 0.97) 0%, rgba(245, 240, 230, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Moldura em traço fino de pátina de papel com sombra elegante */
    border: 1px solid var(--border-color, rgba(51, 63, 52, 0.18));
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(181, 154, 106, 0.22), 
                0 10px 30px rgba(44, 48, 29, 0.08), 
                0 2px 8px rgba(0, 0, 0, 0.04);
    
    padding: clamp(12px, 1.5vh, 18px) clamp(10px, 1vw, 15px);
    font-family: 'EB Garamond', Garamond, serif;
    user-select: none;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Efeito sutil de elevação ao passar o mouse */
.side-anchor-menu:hover,
.side-streaming-card:hover {
    box-shadow: inset 0 0 0 1px rgba(181, 154, 106, 0.38), 
                0 14px 38px rgba(44, 48, 29, 0.12), 
                0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Cabeçalho do Menu Lateral */
.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(181, 154, 106, 0.35);
}

.side-menu-title {
    font-family: 'EB Garamond', serif;
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-green, #2c301d);
}

/* Área de Navegação com Scroll Vertical Suave (Sem Scroll Horizontal) */
.side-menu-nav {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(181, 154, 106, 0.4) transparent;
}

.side-menu-nav::-webkit-scrollbar {
    width: 4px;
}

.side-menu-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-menu-nav::-webkit-scrollbar-thumb {
    background: rgba(181, 154, 106, 0.4);
    border-radius: 4px;
}

/* Lista de Itens do Menu */
.side-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-menu-item {
    position: relative;
    border-radius: 8px;
    transition: background-color 0.25s ease;
}

.side-menu-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--primary-green, #2c301d);
    text-decoration: none;
    font-size: clamp(1.15rem, 1.2vw, 1.35rem);
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.25s ease, background-color 0.25s ease, padding-left 0.25s ease;
}

.side-menu-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover e Foco */
.side-menu-link:hover {
    color: #8c734b;
    background-color: rgba(181, 154, 106, 0.1);
    padding-left: 16px;
}

/* Estado Ativo (Seção em Exibição) */
.side-menu-item.active .side-menu-link {
    color: var(--primary-green, #2c301d);
    font-weight: 700;
    background-color: rgba(181, 154, 106, 0.18);
    padding-left: 16px;
}

/* Ponto Dourado Indicador da Seção Ativa */
.side-menu-item.active::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-gold, #b59a6a);
    box-shadow: 0 0 8px rgba(181, 154, 106, 0.8);
}

/* Ocultar elementos de mobile no desktop */
.mobile-anchor-chip,
.mobile-anchor-modal-overlay {
    display: none;
}

/* ==========================================================================
   BOX DE PLATAFORMAS DE STREAMING (BOX SEPARADO 2) - 100% CENTRALIZADO
   ========================================================================== */

.side-streaming-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.side-streaming-header {
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(181, 154, 106, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
}

.side-streaming-title {
    font-family: 'EB Garamond', serif;
    font-size: clamp(0.92rem, 1.05vw, 1.08rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--primary-green, #2c301d);
    text-transform: none;
    text-align: center;
    display: block;
    width: 100%;
    word-wrap: break-word;
}

/* Pill Badge com Outline e Lupa à Esquerda - Totalmente Responsivo sem Corte */
.side-streaming-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px auto 10px auto;
    padding: 5px 10px;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--primary-green, #2c301d);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    flex-wrap: wrap;
    row-gap: 4px;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    cursor: default;
}

.side-streaming-pill:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: #8c734b;
    transform: translateY(-1px);
}

.side-streaming-search-icon {
    color: var(--primary-green, #2c301d);
    flex-shrink: 0;
    opacity: 0.85;
    width: 13px;
    height: 13px;
}

.side-streaming-pill-text {
    font-family: 'EB Garamond', serif;
    font-size: clamp(0.74rem, 0.9vw, 0.95rem);
    font-weight: 700;
    color: var(--primary-green, #2c301d);
    letter-spacing: 0.2px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    text-overflow: clip;
}

.side-streaming-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding: 2px 0;
    width: 100%;
    margin: 0 auto;
}

.side-streaming-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.side-streaming-img {
    height: 25px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    opacity: 0.85;
    transition: transform 0.25s ease;
}

.side-streaming-link:hover .side-streaming-img {
    transform: scale(1.25);
    opacity: 1;
}

/* Box adicional com embed de Spotify */
.side-spotify-embed-card {
    display: none;
    width: 100%;
    pointer-events: auto;
    background-color: var(--color-paper, #fdfbf7);
    background-image: linear-gradient(135deg, rgba(253, 251, 247, 0.97) 0%, rgba(245, 240, 230, 0.95) 100%);
    border: 1px solid var(--border-color, rgba(51, 63, 52, 0.18));
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(181, 154, 106, 0.22),
                0 10px 30px rgba(44, 48, 29, 0.08),
                0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 8px 8px 6px 8px;
    box-sizing: border-box;
}

.side-spotify-embed-card iframe {
    display: block;
    width: 100%;
    height: 152px;
    min-height: 152px;
    border: 0;
    background: transparent;
}

/* Exibe o novo box apenas em iPad na vertical e telas maiores com espaço suficiente */
@media (min-width: 768px) and (max-width: 1024px) and (min-height: 900px) and (orientation: portrait) {
    .side-spotify-embed-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
}

/* ==========================================================================
   OTIMIZAÇÃO PARA NOTEBOOKS E TELAS DE ALTURA REDUZIDA
   ========================================================================== */

@media (max-width: 1200px) {
    .side-menu-sidebar-container {
        left: 14px;
        top: 100px;
        width: clamp(170px, 17vw, 230px);
    }
}

@media (max-height: 750px) {
    .side-menu-sidebar-container {
        top: 92px;
    }
    
    .side-menu-header {
        padding-bottom: 6px;
        margin-bottom: 6px;
    }
    
    .side-menu-nav {
        max-height: calc(100vh - 250px);
    }
    
    .side-menu-link {
        padding: 5px 8px;
        font-size: 1.1rem;
    }
    
    .side-menu-list {
        gap: 2px;
    }
}

/* ==========================================================================
   VERSÃO MOBILE (CELULARES <= 768px - CHIP FLUTUANTE + MODAL GAVETA)
   ========================================================================== */

@media (max-width: 768px) {
    /* Oculta o container lateral completo em celulares para dar lugar ao botão SEÇÕES */
    .side-menu-sidebar-container {
        display: none !important;
    }

    /* Exibe o Botão Flutuante (Chip) para acionar o Modal em Celulares */
    .mobile-anchor-chip {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 20px;
        right: 16px;
        z-index: 1000;
        
        background-color: var(--color-paper, #fdfbf7);
        background-image: linear-gradient(135deg, rgba(253, 251, 247, 0.98) 0%, rgba(245, 240, 230, 0.95) 100%);
        border: 1px solid rgba(181, 154, 106, 0.4);
        border-radius: 28px;
        box-shadow: inset 0 0 0 1px rgba(181, 154, 106, 0.2),
                    0 8px 24px rgba(44, 48, 29, 0.15);
        
        padding: 8px 18px;
        font-family: 'EB Garamond', serif;
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: 2px;
        color: var(--primary-green, #2c301d);
        text-transform: uppercase;
        cursor: pointer;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .mobile-anchor-chip:active {
        transform: scale(0.95);
    }

    /* Modal Overlay com Backdrop Blur */
    .mobile-anchor-modal-overlay {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 2000;
        
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-anchor-modal-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Conteúdo Gaveta Bottom-Sheet do Modal */
    .mobile-anchor-modal-content {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 80vh;
        
        background-color: var(--color-paper, #fdfbf7);
        background-image: linear-gradient(135deg, rgba(253, 251, 247, 0.98) 0%, rgba(245, 240, 230, 0.95) 100%);
        border-top: 1px solid rgba(181, 154, 106, 0.4);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
        
        padding: 24px 20px 30px 20px;
        box-sizing: border-box;
        
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
    }

    .mobile-anchor-modal-overlay.show .mobile-anchor-modal-content {
        transform: translateY(0);
    }

    /* Header do Modal */
    .mobile-anchor-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 1px dashed rgba(181, 154, 106, 0.35);
    }

    .mobile-modal-title {
        font-family: 'EB Garamond', serif;
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--primary-green, #2c301d);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .mobile-modal-close {
        background: transparent;
        border: none;
        font-size: 1.8rem;
        line-height: 1;
        color: #888;
        cursor: pointer;
        padding: 0 8px;
    }

    /* Lista Nav dentro do Modal */
    .mobile-modal-nav {
        overflow-y: auto;
        max-height: 55vh;
    }

    .mobile-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .mobile-menu-list .side-menu-link {
        font-size: 1.3rem;
        padding: 10px 14px;
    }

    .mobile-streaming-box {
        margin-top: 18px;
        padding-top: 14px;
        border-top: 1px dashed rgba(181, 154, 106, 0.35);
    }
}
