/* ============================================================
   NUV Glossário – Front-end Styles
   ============================================================ */

/* ------ Tooltip (inline term highlight) ------ */
.nuv-termo-inline {
    position: relative;
    display: inline;
    cursor: help;
    transition: border-color .2s;
}
.nuv-termo-inline:hover {
    opacity: .85;
}

/* Tooltip bubble */
.nuv-tooltip-bubble {
    display: none;
    position: fixed;
    z-index: 99999;
    background: var(--nuv-tooltip-bg, #1a1a2e);
    color: var(--nuv-tooltip-fg, #ffffff);
    border-radius: 10px;
    padding: 14px 18px;
    max-width: 320px;
    min-width: 200px;
    font-size: .85rem;
    line-height: 1.55;
    box-shadow: 0 8px 32px rgba(0,0,0,.28);
    pointer-events: none;
    word-break: break-word;
    animation: nuvFadeIn .18s ease;
}
.nuv-tooltip-bubble.nuv-visible { display: block; }
.nuv-tooltip-title {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 6px;
    color: #e94560;
    display: block;
}
.nuv-tooltip-body {
    opacity: .92;
}
.nuv-tooltip-arrow {
    position: absolute;
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--nuv-tooltip-bg, #1a1a2e);
    bottom: -8px; left: 20px;
}
.nuv-tooltip-arrow.nuv-arrow-up {
    border-top: none;
    border-bottom: 8px solid var(--nuv-tooltip-bg, #1a1a2e);
    top: -8px; bottom: auto;
}

@keyframes nuvFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ------ Glossary Page Container ------ */
.nuv-glossario-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 0 40px;
    font-family: inherit;
    position: relative;
}

/* ------ Search Bar ------ */
.nuv-glossario-busca-wrap {
    position: relative;
    margin-bottom: 28px;
}
.nuv-glossario-busca-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e0e3ea;
    border-radius: 50px;
    padding: 0 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: border-color .2s, box-shadow .2s;
}
.nuv-glossario-busca-inner:focus-within {
    border-color: #e94560;
    box-shadow: 0 2px 20px rgba(233,69,96,.15);
}
.nuv-busca-icon { font-size: 1.1rem; margin-right: 10px; opacity: .5; }
.nuv-glossario-busca {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 14px 0;
    background: transparent;
    color: #222;
}
.nuv-busca-resultado {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e0e3ea;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    max-height: 340px;
    overflow-y: auto;
    z-index: 100;
}
.nuv-resultado-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f4f4f4;
    transition: background .15s;
}
.nuv-resultado-item:last-child { border-bottom: none; }
.nuv-resultado-item:hover { background: #f9f0f2; }
.nuv-resultado-item strong { color: #e94560; display: block; font-size: .92rem; }
.nuv-resultado-item span { color: #666; font-size: .82rem; display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------ A-Z Navigation ------ */
.nuv-glossario-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
    justify-content: center;
}
.nuv-nav-letra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    transition: all .2s;
}
.nuv-nav-ativo {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(15,52,96,.3);
}
.nuv-nav-ativo:hover {
    background: linear-gradient(135deg, #e94560, #c23152);
    transform: scale(1.12);
}
.nuv-nav-inativo {
    background: #f0f2f5;
    color: #bbb;
    cursor: default;
}

/* ------ Letter Groups ------ */
.nuv-letra-grupo {
    margin-bottom: 36px;
    scroll-margin-top: 80px;
}
.nuv-letra-titulo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}
.nuv-letra-badge-grande {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 900;
    box-shadow: 0 3px 12px rgba(233,69,96,.3);
    flex-shrink: 0;
}

/* ------ Term Cards ------ */
.nuv-termos-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nuv-termo-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    transition: box-shadow .2s, border-color .2s;
}
.nuv-termo-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    border-color: #d0d3db;
}
.nuv-termo-card.nuv-aberto {
    border-color: #e94560;
    box-shadow: 0 4px 20px rgba(233,69,96,.12);
}
.nuv-termo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}
.nuv-termo-titulo {
    font-weight: 600;
    font-size: .95rem;
    color: #1a1a2e;
    flex: 1;
}
.nuv-termo-icone {
    font-size: 1.2rem;
    color: #e94560;
    font-weight: 700;
    transition: transform .25s;
    flex-shrink: 0;
    line-height: 1;
}
.nuv-aberto .nuv-termo-icone { transform: rotate(45deg); }
.nuv-termo-body {
    padding: 0 20px 16px 20px;
    border-top: 1px solid #f4f4f4;
}
.nuv-termo-conteudo {
    font-size: .9rem;
    line-height: 1.7;
    color: #444;
    padding-top: 14px;
}
.nuv-termo-conteudo p { margin: 0; }

/* ------ No result ------ */
.nuv-sem-resultado {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}
.nuv-sem-icone { font-size: 3rem; display: block; margin-bottom: 10px; }

/* ------ Back to top button ------ */
.nuv-voltar-topo {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    z-index: 999;
}
.nuv-voltar-topo.nuv-visible {
    opacity: 1;
    pointer-events: auto;
}
.nuv-voltar-topo:hover { transform: translateY(-3px); }

/* ------ Highlighted search text ------ */
.nuv-destaque { background: #fff3cd; border-radius: 3px; padding: 0 2px; }

/* ------ Responsive ------ */
@media (max-width: 600px) {
    .nuv-nav-letra { width: 30px; height: 30px; font-size: .78rem; }
    .nuv-glossario-busca { font-size: .92rem; }
    .nuv-termo-titulo { font-size: .88rem; }
    .nuv-tooltip-bubble { max-width: 260px; font-size: .8rem; }
    .nuv-voltar-topo { bottom: 16px; right: 16px; }
}
