/* Fundo elegante com gradiente + textura */
.hero-ebooks .hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0b3f2c 0%, #0a5f66 50%, #0a1f2f 100%);
    opacity: 0.95;
    z-index: 0;
    background-size: cover;
    background-blend-mode: overlay;
}

/* Ícone em efeito glass */
.hero-glass-icon {
    width: 95px;
    height: 95px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 2.6rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: glow 3s ease-in-out infinite;
}

/* Brilho suave pulsado */
@keyframes glow {
    0% { box-shadow: 0 0 15px rgba(255,255,255,0.2); }
    50% { box-shadow: 0 0 25px rgba(255,255,255,0.45); }
    100% { box-shadow: 0 0 15px rgba(255,255,255,0.2); }
}

/* Títulos */
.hero-title {
    letter-spacing: 0.5px;
}

/* Linha elegante */
.hero-divider {
    width: 80px;
    height: 4px;
    border-radius: 10px;
    background: rgba(255,255,255,0.6);
}

/* Espaçamentos em telas maiores */
@media (min-width: 992px) {
    .hero-ebooks {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}
.icon-wrapper {
    display: inline-flex;
    padding: 18px;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.12);
    transition: .3s ease;
}

.icon-wrapper:hover {
    transform: scale(1.08);
    background: rgba(40, 167, 69, 0.20);
}

.hero-icon {
    font-size: 4rem;
    color: #28a745;
    opacity: .9;
}

.hero-ebooks h1 {
    font-weight: 800;
    animation: fadeUp 0.6s ease-out;
}

.hero-ebooks p {
    animation: fadeUp 0.9s ease-out;
}

/* FadeUp animation */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================================== */
/* CARDS – Listagem de E-books                               */
/* ========================================================== */

.ebook-card {
    transition: .3s ease;
    border-radius: 20px;
}

.ebook-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
}

.ebook-thumb-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.ebook-thumb {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.ebook-pages {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: .75rem;
    padding: 4px 8px;
}

/* ========================================================== */
/* E-BOOK VIEW – Página individual                            */
/* ========================================================== */

.ebook-cover {
    width: 280px;
    height: 380px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
}

.ebook-view-meta span {
    font-size: .95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ebook-view-description {
    font-size: 1rem;
    line-height: 1.5;
}

/* ---------------------------------------------------------- */
/* SINOPSE                                                    */
/* ---------------------------------------------------------- */

.ebook-sinopse p,
.ebook-sinopse li {
    font-size: 1.05rem;
    line-height: 1.7;
}

.ebook-sinopse ul, .ebook-sinopse ol {
    padding-left: 20px;
}

/* ========================================================== */
/* RESPONSIVIDADE                                             */
/* ========================================================== */

@media (max-width: 768px) {
    .ebook-cover {
        width: 220px;
        height: 300px;
    }

    .hero-icon {
        font-size: 3.2rem;
    }
}

/* ========================================================== */
/* LOGIN BOX – VERSÃO 3 (Borda Premium Warning)               */
/* ========================================================== */

.login-box {
    background: #fffdfa;
    border-radius: 16px;
    padding: 28px;
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    transition: .3s ease;
    border: 1px solid #e4e4e4;
}

.login-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}

/* Destaque premium em torno da caixa */
.login-warning {
    border: 2px solid #ffc107 !important;
    background: #fffdf5;
}

/* Texto */
.login-box h5 {
    font-weight: 700;
    font-size: 1.25rem;
}

.login-box p {
    font-size: .92rem;
    color: #4f4f4f;
}

/* Ícone */
.login-box i {
    font-size: 1.3rem;
    margin-right: 5px;
}

/* Botão */
.login-box .btn-success {
    padding: 10px 22px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(25,135,84,0.22);
    transition: .2s ease;
}

.login-box .btn-success:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(25,135,84,0.32);
}

/* =============================== */
/* CARD DO MATERIAL                */
/* =============================== */

.material-card {
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    transition: .25s ease-in-out;
    border: 1px solid #eee;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

/* =============================== */
/* IMAGEM                          */
/* =============================== */

.material-thumb {
    width: 100%;
    height: 200px;                    /* 🔥 padroniza o tamanho */
    object-fit: cover;                /* 🔥 garante corte uniforme */
    display: block;
}

/* Mobile: imagens ficam menores */
@media (max-width: 768px) {
    .material-thumb {
        height: 160px;
    }
}

/* =============================== */
/* INFORMAÇÕES DO CARD             */
/* =============================== */

.material-info {
    padding: 12px 14px;
    flex: 1;                          /* mantém altura uniforme */
    display: flex;
    flex-direction: column;
}

.material-title {
    font-weight: 700;
    font-size: .95rem;
    color: #222;
    line-height: 1.2;
    min-height: 40px;                 /* 🔥 garante alinhamento */
}

.material-desc {
    font-size: .82rem;
    color: #666;
    margin-top: 4px;
    min-height: 36px;                 /* 🔥 uniformidade entre cards */
}

/* =============================== */
/* BOTÕES, ÍCONES, DATAS           */
/* =============================== */

.material-info .small {
    margin-top: auto;                 /* mantém a data no rodapé */
}

/* =============================== */
/* HERO                            */
/* =============================== */

section.bg-light.border-bottom {
    background: linear-gradient(135deg, #f8faf9 0%, #eef7f0 100%);
    border-bottom: 2px solid #e4efe7;
}

/* ===================================================== */
/* HERO SUAVE                                             */
/* ===================================================== */

.material-hero-light {
    background: linear-gradient(135deg, #f8faf9 0%, #eef7f0 100%);
    border-bottom: 2px solid #e4efe7;
}

/* ===================================================== */
/* IMAGEM PRINCIPAL DO MATERIAL                           */
/* ===================================================== */

.material-cover-large {
    width: 100%;
    max-width: 250px;          /* 🔥 define tamanho ideal */
    height: 330px;             /* 🔥 fixa a proporção */
    object-fit: cover;         /* 🔥 mantém layout uniforme */
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

@media (max-width: 768px) {
    .material-cover-large {
        height: 260px;
        max-width: 200px;
    }
}

/* ===================================================== */
/* CARD – MATERIAIS RELACIONADOS                          */
/* ===================================================== */

.related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9e9e9;
    transition: .25s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.related-thumb {
    width: 100%;
    height: 160px;             /* 🔥 padroniza miniaturas */
    object-fit: cover;
    display: block;
}

/* ===================================================== */
/* TITULO E DESCRIÇÃO RELACIONADOS                        */
/* ===================================================== */

.related-title {
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    min-height: 38px;
}

.related-card .text-muted {
    font-size: .78rem;
}

/* ===================================================== */
/* SIDE BOX LATERAL                                       */
/* ===================================================== */

.side-box {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e6e6e6;
}

/* ===================================================== */
/* CORREÇÃO DO ONERROR – placeholder                      */
/* ===================================================== */

img[src=""], img:not([src]) {
    opacity: 0;
}

/* HERO */
.insights-hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef7f4 100%);
}

/* MÉTRICAS */
.metric-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: .25s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
}

/* RANKING */
.rank-bar {
    background: #e8e8e8;
    height: 8px;
    border-radius: 8px;
    margin-top: 4px;
}

.rank-bar-fill {
    height: 8px;
    background: #198754;
    border-radius: 8px;
}

/* HEATMAP */
.heatmap-table td {
    padding: 6px;
}

.heatbox {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: #d9e8dd;
    transition: .25s ease;
}

.heatbox[data-value="0"] { background: #e9e9e9; }
.heatbox[data-value="1"] { background: #c8e6c9; }
.heatbox[data-value="2"] { background: #a5d6a7; }
.heatbox[data-value="3"] { background: #81c784; }
.heatbox[data-value="4"] { background: #66bb6a; }
.heatbox[data-value="5"] { background: #4caf50; }
.heatbox[data-value="6"] { background: #43a047; }
.heatbox[data-value="7"] { background: #388e3c; }
.heatbox[data-value="8"] { background: #2e7d32; }
.heatbox[data-value="9"] { background: #1b5e20; }

/* KEYWORD CLOUD */
.keyword-cloud {
    padding: 20px;
    line-height: 2.1;
}

.keyword-item {
    margin-right: 10px;
    display: inline-block;
    color: #2c593f;
}

/* TABLE TOP 10 */
.filter-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #eaeaea;
}

.table-hover tbody tr:hover {
    background: #f6fff4;
}

/* INSIGHTS AUTOMÁTICOS */
.insight-box {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eaeaea;
}

/* HERO */
.insights-hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef7f4 100%);
}

/* MÉTRICAS */
.metric-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: .25s ease;
}
.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-value {
    font-size: 2rem;
    font-weight: 700;
}

/* LISTA MAIS ACESSADOS */
.top-item-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e5e5e5;
    transition: .2s ease;
}
.top-item-card:hover {
    background: #f7fbff;
    border-color: #bcdcff;
}
.top-item-thumb {
    width: 95px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

/* FONTES */
.source-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e6e6e6;
}
.source-card:hover {
    background: #f6fff4;
}

/* RANKING */
.rank-bar {
    background: #e8e8e8;
    height: 8px;
    border-radius: 8px;
}
.rank-bar-fill {
    height: 8px;
    background: #198754;
    border-radius: 8px;
}

/* HEATMAP */
.heatmap-table td { padding: 6px; }
.heatbox {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: #e1e1e1;
}
.heatbox[data-value="0"] { background: #e9e9e9; }
.heatbox[data-value="1"] { background: #c8e6c9; }
.heatbox[data-value="2"] { background: #a5d6a7; }
.heatbox[data-value="3"] { background: #81c784; }
.heatbox[data-value="4"] { background: #66bb6a; }
.heatbox[data-value="5"] { background: #4caf50; }
.heatbox[data-value="6"] { background: #43a047; }
.heatbox[data-value="7"] { background: #388e3c; }
.heatbox[data-value="8"] { background: #2e7d32; }
.heatbox[data-value="9"] { background: #1b5e20; }

/* KEYWORDS */
.keyword-cloud { line-height: 2; }

/* TOP 10 */
.filter-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
}
.table-hover tbody tr:hover {
    background: #f6fff4;
}

/* INSIGHTS */
.insight-box {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eaeaea;
}

.chart-container {
    min-height: 320px;
}

.top-item-card {
    min-height: 95px;
}

.heatbar-container {
    height: 18px;
    background: #e9e9e9;
    border-radius: 5px;
    overflow: hidden;
}

.heatbar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b2f2bb, #2f9e44);
}

.rank-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #74c69d, #2f9e44);
    border-radius: 6px;
}
.rank-item:last-child {
    border-bottom: none !important;
}

/* HERO – fundo moderno e suave */
.hero-ebooks {
    background: linear-gradient(
        135deg,
        #f1fff4 0%,
        #e6f7ee 40%,
        #ffffff 100%
    );
    padding-top: 80px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

/* Elementos decorativos suaves */
.hero-ebooks::before,
.hero-ebooks::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
}

.hero-ebooks::before {
    width: 300px;
    height: 300px;
    background: #b2f2bb;
    top: -80px;
    left: -60px;
}

.hero-ebooks::after {
    width: 350px;
    height: 350px;
    background: #d3f9d8;
    bottom: -100px;
    right: -70px;
}

/* Ícone glassmorphism */
.hero-glass-icon {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ------------------------------------------------------- */
/* HERO FAVORITOS                                           */
/* ------------------------------------------------------- */

.hero-favoritos {
    background: linear-gradient(135deg, #0f5132 0%, #198754 100%);
    padding: 90px 0;
    position: relative;
    overflow: hidden;
}

.hero-favoritos .hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 1;
}

.fade-in-hero {
    animation: fadeInUp 0.9s ease forwards;
    opacity: 0;
}

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

/* ------------------------------------------------------- */
/* CARDS DE FAVORITOS                                       */
/* ------------------------------------------------------- */

.fav-card {
    border-radius: 18px;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

.fav-thumb {
    width: 100%;
    aspect-ratio: 16/9; /* muito mais baixo */
    object-fit: cover;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.fav-title {
    line-height: 1.3;
}

/* Remover favorito (botão flutuante) */
.remove-fav-form {
    position: absolute;
    top: 10px;
    right: 10px;
}

.remove-fav-btn {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    border: none;
    padding: 6px 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
}

.remove-fav-btn i {
    font-size: .9rem;
    color: #d6336c;
}

.remove-fav-btn:hover {
    background: rgba(255,255,255,1);
}

/* Responsividade */
@media (max-width: 768px) {
    .fav-thumb { aspect-ratio: 4/5; }
}

.rank-item:last-child {
    border-bottom: none !important;
}

.rank-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #74c69d, #2f9e44);
}
