/*
 * =========================================================
 * Arbitrage Pro — Visual Enhancements v2.0
 * =========================================================
 * COMO USAR:
 * Copie para: wp-content/themes/arbitrage-pro/assets/css/enhancements.css
 * Depois adicione ao functions.php (tema pai ou filho):
 *
 *   wp_enqueue_style(
 *       'arbitrage-pro-enhancements',
 *       get_template_directory_uri() . '/assets/css/enhancements.css',
 *       ['arbitrage-pro-style'],
 *       '2.0.0'
 *   );
 *
 * OU simplesmente cole todo o conteúdo no final do
 * style.css do tema FILHO — mais simples ainda.
 * =========================================================
 */

/* =========================================
   1. ANIMAÇÕES DE ENTRADA — FADE + SLIDE
   Elementos surgem suavemente ao carregar
   ========================================= */

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

@keyframes fadeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.4); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* Stagger de entrada para cards */
.home-hero          { animation: fadeSlideUp 0.6s ease both; }
.breaking-news      { animation: fadeSlideUp 0.5s 0.1s ease both; }
.section            { animation: fadeSlideUp 0.6s 0.15s ease both; }

.featured-grid .card:nth-child(1) { animation: fadeSlideUp 0.5s 0.05s ease both; }
.featured-grid .card:nth-child(2) { animation: fadeSlideUp 0.5s 0.15s ease both; }
.featured-grid .card:nth-child(3) { animation: fadeSlideUp 0.5s 0.25s ease both; }
.featured-grid .card:nth-child(4) { animation: fadeSlideUp 0.5s 0.10s ease both; }
.featured-grid .card:nth-child(5) { animation: fadeSlideUp 0.5s 0.20s ease both; }
.featured-grid .card:nth-child(6) { animation: fadeSlideUp 0.5s 0.30s ease both; }

.sidebar .widget:nth-child(1) { animation: fadeSlideLeft 0.5s 0.2s ease both; }
.sidebar .widget:nth-child(2) { animation: fadeSlideLeft 0.5s 0.3s ease both; }
.sidebar .widget:nth-child(3) { animation: fadeSlideLeft 0.5s 0.4s ease both; }


/* =========================================
   2. HERO — MAIS IMPACTANTE
   ========================================= */

/* Borda brilhante no hero principal */
.hero-main {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

/* Overlay gradiente mais dramático */
.hero-main-overlay {
    background: linear-gradient(
        to top,
        rgba(26,24,21,0.97) 0%,
        rgba(26,24,21,0.70) 45%,
        rgba(26,24,21,0.15) 75%,
        transparent 100%
    );
}

/* Título do hero com text-shadow para legibilidade */
.post-title-display {
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
    letter-spacing: -0.03em;
}

/* Linha decorativa animada antes do label de categoria no hero */
.hero-main-content .post-category-label {
    position: relative;
    padding-left: 18px;
    margin-bottom: 10px;
}

.hero-main-content .post-category-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

/* Cards laterais do hero — hover polido */
.hero-side-card {
    transition: background-color 0.25s ease;
}
.hero-side-top:hover .hero-side-card,
.hero-side-bottom:hover .hero-side-card {
    background-color: #FAFAF8;
}

.hero-side-card img {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hero-side-top:hover .hero-side-card img,
.hero-side-bottom:hover .hero-side-card img {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}


/* =========================================
   3. CARDS — HOVER MAIS RICO
   ========================================= */

.card {
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
    will-change: transform;
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow:
        0 8px 24px rgba(26,24,21,0.10),
        0 2px 6px rgba(26,24,21,0.06);
    border-color: transparent;
}

/* Linha de destaque colorida no topo do card no hover */
.card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.card { position: relative; overflow: visible; }
.card:hover::after { transform: scaleX(1); }

/* Thumb zoom mais fluido */
.card-thumb img {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.card:hover .card-thumb img {
    transform: scale(1.07);
}

/* Título do card sublinhado no hover */
.post-title-md,
.post-title-lg,
.post-title-sm {
    transition: color 0.2s ease;
    position: relative;
    display: inline;
}

/* Card horizontal melhorado */
.card-horizontal {
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}
.card-horizontal:hover {
    background-color: var(--color-accent-light);
    border-color: var(--color-accent);
    box-shadow: 0 3px 12px rgba(212,66,10,0.10);
    transform: translateX(3px);
}

.card-horizontal img {
    transition: transform 0.3s ease;
}
.card-horizontal:hover img {
    transform: scale(1.05);
}


/* =========================================
   4. BREAKING NEWS — TICKER REFINADO
   ========================================= */

.breaking-news {
    background: linear-gradient(135deg, #C73D08 0%, #D4420A 50%, #C73D08 100%);
    background-size: 200% auto;
    animation: shimmer 4s linear infinite;
    border-top: 2px solid rgba(255,255,255,0.12);
    border-bottom: 2px solid rgba(0,0,0,0.15);
}

.breaking-label {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    letter-spacing: 0.1em;
    font-size: 0.65rem;
    white-space: nowrap;
}

.ticker-item a {
    color: rgba(255,255,255,0.92);
    transition: color 0.2s;
}
.ticker-item a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* =========================================
   5. SECTION TITLE — MAIS EDITORIAL
   ========================================= */

.section-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Substitui o ::after (underline) por uma barra lateral mais elegante */
.section-title::after {
    display: none;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.1em;
    background: linear-gradient(to bottom, var(--color-accent), #FF6B35);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Linha separadora que aparece abaixo do section-header */
.section-header {
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-xl);
}

/* Ver mais — seta deslizante */
.section-link {
    position: relative;
    overflow: hidden;
    padding: 6px 14px 6px 10px;
    border: 1.5px solid var(--color-accent);
    border-radius: 20px;
    font-size: 0.72rem;
    transition: all 0.25s ease;
    background: transparent;
}

.section-link:hover {
    background: var(--color-accent);
    color: #fff;
    gap: 10px;
}


/* =========================================
   6. SIDEBAR — WIDGETS MAIS PREMIUM
   ========================================= */

.widget {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(26,24,21,0.05);
    transition: box-shadow 0.3s ease;
}

.widget:hover {
    box-shadow: 0 4px 20px rgba(26,24,21,0.09);
}

/* Header do widget com gradiente sutil */
.widget-header {
    background: linear-gradient(135deg, var(--color-surface-2) 0%, #EDECEA 100%);
}

/* Widget título com acento animado */
.widget-title::before {
    transition: height 0.3s ease;
}
.widget:hover .widget-title::before {
    height: 22px;
}

/* Popular posts — número com efeito */
.popular-num {
    font-size: 0.7rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-accent-light), #FFE0D4);
    color: var(--color-accent);
    border: 1.5px solid rgba(212,66,10,0.15);
    transition: all 0.2s ease;
}

.popular-item:hover .popular-num {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    transform: scale(1.1);
}

/* Tag cloud */
.tag-item {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tag-item:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 12px rgba(212,66,10,0.2);
}


/* =========================================
   7. NEWSLETTER SECTION — HOME
   ========================================= */

/* CTA newsletter com partículas decorativas */
section[style*="var(--color-dark)"] {
    position: relative;
    overflow: hidden;
}

section[style*="var(--color-dark)"]::before,
section[style*="var(--color-dark)"]::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    pointer-events: none;
}

section[style*="var(--color-dark)"]::before {
    width: 400px;
    height: 400px;
    background: var(--color-accent);
    top: -150px;
    right: -100px;
}

section[style*="var(--color-dark)"]::after {
    width: 250px;
    height: 250px;
    background: var(--color-gold);
    bottom: -80px;
    left: -60px;
}

/* Input focus com glow */
input[type="email"]:focus {
    box-shadow: 0 0 0 3px rgba(212,66,10,0.15);
}

/* Botão com micro-interação */
.btn-gold {
    position: relative;
    overflow: hidden;
}

.btn-gold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-gold:hover::after { opacity: 1; }

.btn-primary {
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn-primary:hover::after { opacity: 1; }


/* =========================================
   8. HEADER — POLIMENTO
   ========================================= */

.site-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.97);
}

/* Logo shimmer no hover */
.site-title {
    transition: opacity 0.2s ease;
}
.site-title:hover { opacity: 0.85; }

/* Nav item com underline animado */
.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
    border-radius: 1px;
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item > a::after {
    transform: scaleX(1);
}

/* Search button com efeito ripple */
.search-btn {
    position: relative;
    overflow: hidden;
}

.search-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--color-accent);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.search-btn:hover::after {
    transform: scale(1);
    opacity: 1;
}

.search-btn svg {
    position: relative;
    z-index: 1;
    transition: color 0.2s;
}

.search-btn:hover svg { color: #fff; }


/* =========================================
   9. TRENDING SECTION — NÚMEROS
   ========================================= */

.trending-number {
    background: linear-gradient(135deg, #E8E6DF, #FAFAF8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.trending-item:hover .trending-number {
    background: linear-gradient(135deg, var(--color-accent), #FF6B35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trending-item {
    padding: 10px 8px;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.trending-item:hover {
    background-color: var(--color-surface);
}


/* =========================================
   10. CATEGORY LABEL — BADGE ANIMADO
   ========================================= */

.post-category-label {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.post-category-label::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.post-category-label:hover::before {
    width: 100%;
}


/* =========================================
   11. READING PROGRESS BAR — GRADIENTE
   ========================================= */

.reading-progress {
    background: linear-gradient(90deg,
        var(--color-accent) 0%,
        #FF6B35 50%,
        var(--color-gold) 100%
    );
    height: 3px;
    box-shadow: 0 1px 6px rgba(212,66,10,0.4);
}


/* =========================================
   12. SOCIAL SHARE — HOVER ELEVADO
   ========================================= */

.share-btn {
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    opacity: 1 !important;
}


/* =========================================
   13. FOOTER — LINKS COM UNDERLINE DESLIZANTE
   ========================================= */

.footer-links a {
    position: relative;
    padding-bottom: 1px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: rgba(255,255,255,0.5);
    transition: width 0.25s ease;
}

.footer-links a:hover::after { width: 100%; }


/* =========================================
   14. PUSH BAR — ANIMAÇÃO MAIS SUAVE
   ========================================= */

.push-bar {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.08);
}

.push-allow {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.push-allow:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212,66,10,0.4);
}


/* =========================================
   15. EXIT POPUP — ENTRADA MAIS DINÂMICA
   ========================================= */

.exit-popup {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.exit-popup-overlay.active .exit-popup {
    transform: scale(1) translateY(0);
}

/* Botão principal do popup */
.exit-popup .btn-primary {
    font-size: 0.95rem;
    padding: 14px 24px;
    border-radius: 30px;
    letter-spacing: 0.02em;
}

.exit-popup .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212,66,10,0.35);
}

/* Emoji flutuante */
.popup-icon {
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}


/* =========================================
   16. PAGINAÇÃO
   ========================================= */

.page-link,
.nav-links .page-numbers {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-link:hover,
.nav-links .page-numbers:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212,66,10,0.2);
}


/* =========================================
   17. AUTHOR BOX — REFINADO
   ========================================= */

.author-box {
    border-left: 4px solid var(--color-accent);
    transition: box-shadow 0.3s ease;
}

.author-box:hover {
    box-shadow: 0 6px 24px rgba(26,24,21,0.08);
}

.author-avatar {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.author-box:hover .author-avatar {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212,66,10,0.25);
}


/* =========================================
   18. SKELETON LOADER — MAIS REALISTA
   ========================================= */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface-2) 0%,
        var(--color-border) 40%,
        var(--color-surface-2) 60%,
        var(--color-border) 100%
    );
    background-size: 300% 100%;
    animation: skeleton-loading 1.8s ease infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -100% 0; }
}


/* =========================================
   19. RESPONSIVO — AJUSTES MOBILE
   ========================================= */

@media (max-width: 768px) {
    /* Cards sem scale no mobile (evita jank) */
    .card:hover {
        transform: translateY(-3px);
    }

    /* Trending sem padding lateral no mobile */
    .trending-item {
        padding: 8px 0;
    }

    /* Hero título menor no mobile */
    .post-title-display {
        font-size: 1.5rem;
    }

    /* Seção link sem borda no mobile */
    .section-link {
        padding: 4px 10px;
        font-size: 0.68rem;
    }
}

@media (max-width: 480px) {
    /* Cards sem animação no mobile fraco */
    .featured-grid .card {
        animation: none;
    }

    .sidebar .widget {
        animation: none;
    }
}


/* =========================================
   20. MODO ESCURO — SUPORTE BÁSICO
   Ativa automaticamente pelo sistema operacional
   ========================================= */

@media (prefers-color-scheme: dark) {
    /* Descomente para ativar modo escuro automático */

    /*
    :root {
        --color-bg: #0F0E0D;
        --color-surface: #1A1815;
        --color-surface-2: #252320;
        --color-border: #332F2A;
        --color-text-primary: #F0EDE8;
        --color-text-secondary: #A09890;
        --color-text-muted: #6E6860;
    }

    .site-header {
        background: rgba(26,24,21,0.95);
        border-bottom-color: var(--color-border);
    }

    .top-bar { background: #0A0908; }

    .card { background: var(--color-surface); }
    .card-horizontal { background: var(--color-surface); }
    */
}


/* =========================================
   21. PREFERÊNCIA: SEM ANIMAÇÕES
   Respeita usuários com sensibilidade a movimento
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ticker-track { animation: none; }
    .reading-progress { transition: none; }
}
