/* ==========================================================
   TENDENCIAS.CSS — Versão 13.4 Master (Full Rank System)
   * Objetivo: Estilo unificado para Ranking Horizontal (Home) e Vertical (Página).
   * Novidades V13.4: Suporte total a Coroa e Badges na página interna.
   ========================================================== */

/* ----------------------------------------------------------
   1. HERO AREA (PÁGINA DE TENDÊNCIAS)
---------------------------------------------------------- */
.trends-hero {
    position: relative;
    padding: 120px 0 90px;
    background: radial-gradient(circle at top center, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    text-align: center;
    overflow: hidden;
    margin-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.trends-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; height: 100%;
    background: url('../img/placeholder-sm.png');
    opacity: 0.1;
    z-index: 0;
    mix-blend-mode: overlay;
}

.badge-live {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 30px;
    border: 1px solid rgba(239, 68, 68, 0.5);
    position: relative; z-index: 2;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    letter-spacing: 1px;
}
.badge-live i { animation: pulseRed 1.5s infinite; }

.hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    margin-bottom: 20px;
    color: #ffffff;
    position: relative; z-index: 2;
    text-shadow: 0 5px 30px rgba(0,0,0,0.8);
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.hero-desc {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.6;
    position: relative; z-index: 2;
    font-weight: 400;
}

@keyframes pulseRed {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* ----------------------------------------------------------
   2. PÁGINA INTERNA: ESTILO DOS CARDS VERTICAIS
   * Agora suporta a Coroa e o Círculo de Rank
---------------------------------------------------------- */
.tendencias-content {
    background: #f8fafc;
    padding-bottom: 80px;
}

.tendencias-content .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
    margin-bottom: 50px;
}

/* Card Vertical */
.tendencias-content .post-card {
    background: #ffffff;
    border-radius: 20px;
    /* IMPORTANTE: overflow visible para a coroa sair do card */
    overflow: visible; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
    height: 100%;
    position: relative;
    margin-top: 15px; /* Espaço para a coroa não cortar */
}

/* Círculo de Ranking (Exclusivo Pag Interna) */
.tendencias-content .post-card .trend-rank-circle {
    position: absolute;
    top: -15px;
    left: -10px;
    z-index: 20;
    width: 42px; height: 42px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.2rem; color: #64748b;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #f1f5f9;
}

/* Rank 1 (Ouro) na Página Interna */
.tendencias-content .post-card.rank-1 { border: 1px solid #fbbf24; box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15); }
.tendencias-content .post-card.rank-1 .trend-rank-circle {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #fff; border: none;
}
/* Coroa Flutuante */
.tendencias-content .post-card.rank-1 .trend-rank-circle::before {
    content: '\f521'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; top: -24px;
    font-size: 1.2rem; color: #fbbf24;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: floatCrown 3s ease-in-out infinite;
}

/* Rank 2 e 3 */
.tendencias-content .post-card.rank-2 .trend-rank-circle { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); color: #fff; border: none; }
.tendencias-content .post-card.rank-3 .trend-rank-circle { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); color: #fff; border: none; }


/* Badge HOT em Chamas (Página Interna) */
.tendencias-content .card-badge-trend {
    position: absolute; top: 15px; right: 15px;
    color: #fff; padding: 5px 12px; border-radius: 50px;
    font-size: 0.7rem; font-weight: 800; z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.tendencias-content .card-badge-trend.hot {
    background: linear-gradient(45deg, #ff4757, #ff6b81);
    animation: hotPulse 2s infinite;
}
.tendencias-content .card-badge-trend.rising {
    background: linear-gradient(45deg, #0ea5e9, #38bdf8);
}

@keyframes hotPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.tendencias-content .post-card:hover {
    transform: translateY(-8px);
    border-color: rgba(13, 110, 253, 0.3);
}

/* Imagem Arredondada no Topo (ajuste pois overflow é visible) */
.tendencias-content .card-thumb {
    height: 220px; width: 100%; position: relative; overflow: hidden;
    border-radius: 20px 20px 0 0; /* Garante borda redonda na imagem */
}

.tendencias-content .card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.tendencias-content .post-card:hover .card-thumb img { transform: scale(1.1); }
.tendencias-content .card-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.tendencias-content .card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; line-height: 1.4; color: #1e293b; }
.tendencias-content .card-meta { margin-top: auto; padding-top: 15px; border-top: 1px solid #f1f5f9; font-size: 0.85rem; color: #64748b; display: flex; gap: 15px; }

/* Status "Atualizado" */
.tendencias-content .text-center p {
    display: inline-flex; align-items: center; gap: 10px;
    background: #ffffff; padding: 10px 25px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #e2e8f0;
    font-weight: 600; color: #64748b !important; font-size: 0.95rem !important;
}
.tendencias-content .text-center i { color: #10b981; animation: spinSlow 4s linear infinite; }
@keyframes spinSlow { 100% { transform: rotate(360deg); } }

/* ----------------------------------------------------------
   3. BLOCO DA HOME: CARDS HORIZONTAIS (RANKING PODIUM)
---------------------------------------------------------- */
.trends-area {
    padding: 80px 0;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #e2e8f0;
}

.trend-header-flex {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 40px; border-bottom: 2px solid #e2e8f0; padding-bottom: 20px;
}

.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* Card Horizontal */
.trend-card {
    background: #ffffff; border-radius: 16px; padding: 20px;
    display: flex; gap: 20px; align-items: flex-start;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
    cursor: pointer; position: relative; overflow: visible;
}

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.trend-rank-circle {
    width: 45px; height: 45px; background: #f8fafc;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800; color: #cbd5e1;
    flex-shrink: 0; border: 2px solid #f1f5f9; position: relative;
}

/* PODIUM POWER: Rank 1 (Coroa + Glow) */
.trend-card.rank-1 {
    border-color: #fbbf24;
    background: linear-gradient(to right, #fff, #fffbeb);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15);
}

.trend-card.rank-1 .trend-rank-circle {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #fff; border: none;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
}

/* Coroa Dourada Flutuante */
.trend-card.rank-1 .trend-rank-circle::before {
    content: '\f521'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; top: -22px; left: 50%;
    transform: translateX(-50%) rotate(-10deg);
    font-size: 1.2rem; color: #fbbf24;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: floatCrown 3s ease-in-out infinite;
}

@keyframes floatCrown {
    0%, 100% { transform: translateX(-50%) rotate(-10deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(-10deg) translateY(-5px); }
}

/* Rank 2 & 3 */
.trend-card.rank-2 .trend-rank-circle { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); color: #fff; border: none; }
.trend-card.rank-3 .trend-rank-circle { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); color: #fff; border: none; }

.trend-content { flex: 1; min-width: 0; }

.trend-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px 0; line-height: 1.3; }
.trend-title a { color: #1e293b; text-decoration: none; }

.trend-stats { margin-top: 12px; }
.trend-bar-bg { width: 100%; height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.trend-bar-fill { height: 100%; background: var(--primary); border-radius: 10px; }
.trend-card.rank-1 .trend-bar-fill { background: linear-gradient(90deg, #fbbf24, #d97706); }

.trend-footer { margin-top: 12px; font-size: 0.75rem; color: #94a3b8; display: flex; gap: 8px; }

/* ----------------------------------------------------------
   4. RESPONSIVIDADE
---------------------------------------------------------- */
@media (max-width: 768px) {
    .trend-header-flex { flex-direction: column; align-items: flex-start; gap: 15px; }
    .trends-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.2rem; }
    .tendencias-content .posts-grid { grid-template-columns: 1fr; gap: 25px; }
    .tendencias-content .card-thumb { height: 200px; }
}
