/* Smooth scroll para TOC */
html { scroll-behavior: smooth; }

:root {
    --font-heading: Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-code: "Courier New", Courier, monospace;
}

/* TOC Links */
.toc-link {
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.toc-link:hover {
    color: #7c3aed !important;
    border-color: #7c3aed !important;
}

/* Prose customizado para conteúdo dinâmico */
.article-content {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #374151;
}

@media (min-width: 768px) {
    .article-content {
        font-size: 1.0625rem;
    }
}

@media (min-width: 1024px) {
    .article-content {
        font-size: 1.125rem;
        line-height: 1.75;
    }
}

.article-content h2 {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
    scroll-margin-top: 6rem;
}

@media (min-width: 768px) {
    .article-content h2 {
        font-size: 1.625rem;
        margin-top: 2.5rem;
        margin-bottom: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .article-content h2 {
        font-size: 1.875rem;
        margin-top: 3rem;
        margin-bottom: 1.5rem;
    }
}

.article-content h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
    scroll-margin-top: 6rem;
}

@media (min-width: 768px) {
    .article-content h3 {
        font-size: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .article-content h3 {
        font-size: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
}

.article-content h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

@media (min-width: 1024px) {
    .article-content h4 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
}

.article-content p {
    font-family: var(--font-body);
    margin-bottom: 1.25rem;
    line-height: 1.7;
    color: #4b5563;
}

@media (min-width: 1024px) {
    .article-content p {
        margin-bottom: 1.5rem;
        line-height: 1.8;
    }
}

.article-content p:last-child {
    margin-bottom: 0;
}

.article-content ul,
.article-content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

@media (min-width: 1024px) {
    .article-content ul,
    .article-content ol {
        margin: 1.5rem 0;
        padding-left: 2rem;
    }
}

.article-content li {
    font-family: var(--font-body);
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

@media (min-width: 1024px) {
    .article-content li {
        line-height: 1.75;
    }
}

.article-content img {
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

@media (min-width: 1024px) {
    .article-content img {
        margin: 2.5rem 0;
        border-radius: 0.75rem;
    }
}

.article-content blockquote {
    border-left: 3px solid #7c3aed;
    padding-left: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
    background-color: #f9fafb;
    border-radius: 0.375rem;
}

@media (min-width: 1024px) {
    .article-content blockquote {
        border-left-width: 4px;
        padding-left: 1.5rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        margin: 2rem 0;
    }
}

.article-content mark {
    background-color: #7c3aed;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.article-content strong {
    font-weight: 700;
    color: #1f2937;
}

.article-content a {
    color: #7c3aed;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #6d28d9;
}

.article-content code {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: var(--font-code);
    color: #1f2937;
}

.article-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #f3f4f6;
}

/* Content Gate - Bloqueio de Conteúdo Premium */
.content-gate-wrapper {
    position: relative;
}

/* Conteúdo borrado por trás (efeito paywall premium) */
.content-blurred {
    position: relative;
    max-height: 300px;
    overflow: hidden;
}

.content-blurred::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Card centralizado e compacto */
.content-gate {
    position: relative;
    margin-top: -120px;
    padding: 0 20px;
    z-index: 10;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Tablet */
@media (min-width: 768px) {
    .content-gate {
        max-width: 480px;
        margin-top: -140px;
        padding: 0;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .content-gate {
        max-width: 550px;
        margin-top: -160px;
    }
}

/* Mobile: Drawer fixo no bottom */
@media (max-width: 767px) {
    .content-blurred {
        max-height: 150px;
    }
    
    .content-gate.content-gate-visible {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 0 12px 0 12px;
        z-index: 9999;
        background: transparent;
        max-width: 100%;
    }
    
    .content-gate-visible .content-gate-card {
        border-radius: 16px 16px 0 0 !important;
        padding: 20px 16px 28px !important;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 -8px 30px rgba(0,0,0,0.35) !important;
    }
    
    /* Indicador de drag (visual apenas) */
    .content-gate-visible .content-gate-card::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        background: rgba(255,255,255,0.3);
        border-radius: 2px;
    }
    
    /* Backdrop escuro no mobile */
    .content-gate-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
}

/* Tablet: inline como desktop mas menor */
@media (min-width: 768px) and (max-width: 1023px) {
    .content-gate {
        max-width: 480px;
    }
}

.content-gate-card {
    background: linear-gradient(145deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 16px 32px -8px rgba(124, 58, 237, 0.35);
    position: relative;
}

@media (min-width: 768px) {
    .content-gate-card {
        padding: 28px 32px;
        border-radius: 16px;
    }
}

@media (min-width: 1024px) {
    .content-gate-card {
        padding: 32px 40px;
    }
}

/* Mobile: ajustes finos */
@media (max-width: 767px) {
    .content-gate-title {
        font-size: 0.9375rem !important;
    }
    
    .content-gate-subtitle {
        font-size: 0.625rem !important;
    }
}

.content-gate-icon {
    display: none;
}

.content-gate-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

@media (min-width: 768px) {
    .content-gate-title {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }
}

@media (min-width: 1024px) {
    .content-gate-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
}

.content-gate-subtitle {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .content-gate-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 14px;
    }
}

@media (min-width: 1024px) {
    .content-gate-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 16px;
    }
    line-height: 1.35;
}

.content-gate-benefits {
    display: none;
}

.content-gate-form {
    max-width: 100%;
    margin: 0 auto;
}

.content-gate-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: white;
    font-size: 0.8125rem;
    margin-bottom: 6px;
    transition: all 0.2s;
}

@media (min-width: 768px) {
    .content-gate-input {
        padding: 10px 14px;
        font-size: 0.875rem;
        margin-bottom: 8px;
        border-radius: 8px;
    }
}

@media (min-width: 1024px) {
    .content-gate-input {
        padding: 12px 16px;
        font-size: 1rem;
        margin-bottom: 10px;
    }
}

.content-gate-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.content-gate-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
}

.content-gate-btn {
    width: 100%;
    padding: 8px 14px;
    background: white;
    color: #7c3aed;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .content-gate-btn {
        padding: 10px 16px;
        font-size: 0.9375rem;
        border-radius: 8px;
    }
}

@media (min-width: 1024px) {
    .content-gate-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.content-gate-btn:hover {
    background: #f8f5ff;
}

.content-gate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.content-gate-note {
    font-size: 0.5625rem;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
}

@media (min-width: 768px) {
    .content-gate-note {
        font-size: 0.6875rem;
        margin-top: 10px;
    }
}

@media (min-width: 1024px) {
    .content-gate-note {
        font-size: 0.75rem;
        margin-top: 12px;
    }
}

.content-gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.5625rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .content-gate-badge {
        padding: 4px 8px;
        font-size: 0.625rem;
        margin-bottom: 10px;
        gap: 4px;
    }
}

@media (min-width: 1024px) {
    .content-gate-badge {
        padding: 5px 10px;
        font-size: 0.6875rem;
        margin-bottom: 12px;
    }
}

/* Gate visível imediatamente */
.content-gate-visible {
    display: block !important;
}

/* Stats do conteúdo bloqueado */
.content-gate-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .content-gate-stats {
        gap: 16px;
        margin-bottom: 10px;
    }
}

@media (min-width: 1024px) {
    .content-gate-stats {
        gap: 20px;
        margin-bottom: 12px;
    }
}

.content-gate-stats span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.5625rem;
    color: rgba(255,255,255,0.6);
}

@media (min-width: 768px) {
    .content-gate-stats span {
        font-size: 0.6875rem;
        gap: 4px;
    }
}

@media (min-width: 1024px) {
    .content-gate-stats span {
        font-size: 0.75rem;
        gap: 5px;
    }
}

.content-gate-stats i {
    font-size: 0.5rem;
}

@media (min-width: 768px) {
    .content-gate-stats i {
        font-size: 0.625rem;
    }
}

@media (min-width: 1024px) {
    .content-gate-stats i {
        font-size: 0.6875rem;
    }
}

/* Fade overlay do gate */
.content-gate-fade {
    height: 40px;
    margin-top: -40px;
    margin-bottom: 0;
}

/* Animações de entrada */

/* Desktop: Fade + Scale suave */
@media (min-width: 768px) {
    .content-gate-animate {
        animation: gateEnterDesktop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    @keyframes gateEnterDesktop {
        0% {
            opacity: 0;
            transform: translateY(40px) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* Mobile: Drawer slide-up */
@media (max-width: 767px) {
    .content-gate-animate {
        animation: gateEnterMobile 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    .content-gate-animate .content-gate-card {
        animation: drawerSlideUp 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    @keyframes gateEnterMobile {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    @keyframes drawerSlideUp {
        0% {
            transform: translateY(100%);
        }
        100% {
            transform: translateY(0);
        }
    }
    
    /* Backdrop animation */
    .content-gate-backdrop-animate {
        animation: backdropFadeIn 0.4s ease-out;
    }
    
    @keyframes backdropFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* Bloquear scroll do body quando gate ativo no mobile */
body.content-gate-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Botão LinkedIn no gate */
.content-gate-btn-linkedin {
    width: 100%;
    padding: 8px 14px;
    background: #0A66C2;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

@media (min-width: 768px) {
    .content-gate-btn-linkedin {
        padding: 10px 16px;
        font-size: 0.9375rem;
        border-radius: 8px;
        gap: 6px;
    }
}

@media (min-width: 1024px) {
    .content-gate-btn-linkedin {
        padding: 12px 20px;
        font-size: 1rem;
        gap: 8px;
    }
}

.content-gate-btn-linkedin:hover {
    background: #004182;
}

.content-gate-btn-linkedin svg {
    width: 14px;
    height: 14px;
}

@media (min-width: 768px) {
    .content-gate-btn-linkedin svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 1024px) {
    .content-gate-btn-linkedin svg {
        width: 18px;
        height: 18px;
    }
}

/* Divider "ou com email" */
.content-gate-divider {
    position: relative;
    text-align: center;
    margin: 8px 0;
}

@media (min-width: 768px) {
    .content-gate-divider {
        margin: 12px 0;
    }
}

@media (min-width: 1024px) {
    .content-gate-divider {
        margin: 14px 0;
    }
}

.content-gate-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.content-gate-divider span {
    position: relative;
    display: inline-block;
    padding: 0 8px;
    background: linear-gradient(145deg, #6d28d9 0%, #5b21b6 100%);
    color: rgba(255,255,255,0.55);
    font-size: 0.5625rem;
    text-transform: uppercase;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.article-content th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #1f2937;
}

/* Grid de estatísticas */
.article-content .not-prose {
    all: unset;
}

/* Navegação TOC - Estilos Flowbite já aplicados via classes */

/* Feedback simplificado - Like/Dislike */
.feedback-like-btn.active {
    border-color: rgb(34, 197, 94) !important;
    background-color: rgb(220, 252, 231) !important;
}

.feedback-like-btn.active i {
    color: rgb(34, 197, 94) !important;
}

.feedback-like-btn.active span {
    color: rgb(22, 163, 74) !important;
    font-weight: 600;
}

.feedback-dislike-btn.active {
    border-color: rgb(239, 68, 68) !important;
    background-color: rgb(254, 226, 226) !important;
}

.feedback-dislike-btn.active i {
    color: rgb(239, 68, 68) !important;
}

.feedback-dislike-btn.active span {
    color: rgb(220, 38, 38) !important;
    font-weight: 600;
}

.feedback-like-btn.hidden,
.feedback-dislike-btn.hidden {
    display: none !important;
}

.article-content-muted {
    color: #666666;
}

.content-gate-sso-wrap {
    margin-bottom: 16px;
}

.content-gate-success {
    text-align: center;
    padding: 30px 20px;
}

.content-gate-success__icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.content-gate-success__title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.content-gate-success__text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
}

.content-gate-success__note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-top: 16px;
}
