/* --------------------------------
   1. TEMPO DE LEITURA
   -------------------------------- */

.reading-time {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #6c757d;
    margin: 1rem 0;
    border-left: 3px solid #3498db;
    text-align: center;
}

.reading-time span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --------------------------------
   2. MODAL PARA ZOOM DE IMAGENS
   -------------------------------- */

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: scaleIn 0.3s ease forwards;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: -45px;
    right: 0;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #3498db;
}

/* --------------------------------
   3. BOTÃO DE COPIAR CÓDIGO
   -------------------------------- */

pre {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* --------------------------------
   4. NÚMEROS DE LINHA NO CÓDIGO
   -------------------------------- */

.line-number {
    display: inline-block;
    width: 2.5em;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9em;
    user-select: none;
    text-align: right;
    padding-right: 1em;
}

/* --------------------------------
   5. ANIMAÇÕES DE ENTRADA
   -------------------------------- */

.elementor-widget-theme-post-content > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.elementor-widget-theme-post-content > *.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------
   6. CAIXAS DE DESTAQUE AUTOMÁTICAS
   -------------------------------- */

.elementor-widget-theme-post-content .info-box,
.elementor-widget-theme-post-content p.info-box {
    background: linear-gradient(135deg, #e8f4f8, #f8f9fa);
    border-left: 4px solid #3498db;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
    position: relative;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1);
}

.elementor-widget-theme-post-content .info-box::before {
    content: '💡';
    position: absolute;
    top: 1rem;
    left: -12px;
    background: white;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 1.2em;
}

/* Caixas de atenção */
.elementor-widget-theme-post-content .warning-box,
.elementor-widget-theme-post-content p[data-type="warning"] {
    background: linear-gradient(135deg, #fff5e6, #fdf2e9);
    border-left: 4px solid #f39c12;
}

.elementor-widget-theme-post-content .warning-box::before,
.elementor-widget-theme-post-content p[data-type="warning"]::before {
    content: '⚠️';
}

/* Caixas de sucesso */
.elementor-widget-theme-post-content .success-box,
.elementor-widget-theme-post-content p[data-type="success"] {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-left: 4px solid #27ae60;
}

.elementor-widget-theme-post-content .success-box::before,
.elementor-widget-theme-post-content p[data-type="success"]::before {
    content: '✅';
}

/* --------------------------------
   7. MELHORIAS NO CURSOR
   -------------------------------- */

.elementor-widget-theme-post-content img {
    cursor: zoom-in;
}

.image-modal {
    cursor: zoom-out;
}

.elementor-widget-theme-post-content a {
    cursor: pointer;
}

/* --------------------------------
   8. SMOOTH SCROLLING GLOBAL
   -------------------------------- */

html {
    scroll-behavior: smooth;
}

/* --------------------------------
   9. KEYFRAMES PARA ANIMAÇÕES
   -------------------------------- */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

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

/* --------------------------------
   10. BOTÃO VOLTAR AO TOPO
   -------------------------------- */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2980b9;
    transform: translateY(-2px);
}


/* --------------------------------
   12. OPTIMIZAÇÕES DE PERFORMANCE
   -------------------------------- */

/* Melhora a performance em dispositivos móveis */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Força aceleração de hardware para elementos animados */
.elementor-widget-theme-post-content img,
.back-to-top,
.elementor-widget-theme-post-content *[class*="animate"] {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}