/* ═══════════════════════════════════════════════════════════════════════════
   ESTÉTICA ASCII - Inspirado em ertdfgcvb
   Fundo branco, caracteres pretos, dinamismo terminal
   Animações inspiradas em nfinitepaper.com e axon-pulse.com
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-muted: #666666;
    --border-color: #cccccc;
    --hover-color: #333333;
    
    /* Paleta de cores DISTINTAS para cada gráfico */
    --chart-green: #00aa55;
    --chart-cyan: #00cccc;
    --chart-blue: #0066cc;
    --chart-teal: #008888;
    
    /* Query 2 - Tons quentes/dourados */
    --chart-gold: #cc9900;
    --chart-amber: #ffaa00;
    
    /* Query 3 - Tons magenta/pink */
    --chart-magenta: #cc0066;
    --chart-pink: #ff66aa;
    
    /* Query 4 - Tons navy/índigo */
    --chart-navy: #003366;
    --chart-indigo: #6666cc;
    
    --sidebar-width: 340px;
    --font-mono: 'Monaco', 'Menlo', 'Lucida Console', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BODY & BACKGROUND
   ═══════════════════════════════════════════════════════════════════════════ */

body {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TELA DE SENHA
   ═══════════════════════════════════════════════════════════════════════════ */

.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.password-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-container {
    text-align: center;
    padding: 3rem;
    max-width: 400px;
    width: 90%;
}

.password-title {
    font-size: 24px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.password-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-transform: lowercase;
}

.password-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.password-field {
    width: 100%;
    max-width: 200px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 18px;
    text-align: center;
    letter-spacing: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: all 0.2s ease;
}

.password-field:focus {
    border-color: var(--text-color);
    box-shadow: 2px 2px 0 var(--text-color);
}

.password-field::placeholder {
    letter-spacing: 4px;
    color: var(--border-color);
}

.password-btn {
    padding: 0.75rem 2rem;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.password-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    box-shadow: 2px 2px 0 var(--border-color);
}

.password-error {
    margin-top: 1rem;
    font-size: 11px;
    color: #cc0000;
    letter-spacing: 1px;
    min-height: 1.5rem;
}

.password-error.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* Canvas para figura ASCII animada */
#ascii-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.12;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EFEITO DE TREMOR (GLITCH) NO TEXTO
   ═══════════════════════════════════════════════════════════════════════════ */

.glitch-text {
    position: relative;
    display: inline-block;
    transition: all 0.1s ease;
}

.glitch-text:hover {
    animation: textGlitch 0.3s ease-in-out infinite;
}

@keyframes textGlitch {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1px, 1px); }
    20% { transform: translate(1px, -1px); }
    30% { transform: translate(-1px, -1px); }
    40% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, 0); }
    60% { transform: translate(1px, 0); }
    70% { transform: translate(0, 1px); }
    80% { transform: translate(0, -1px); }
    90% { transform: translate(1px, -1px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MENU LATERAL
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
    position: absolute;
    left: 4rem;  /* Mais à direita, menos grudado na borda */
    top: 5rem;
    width: auto;
    max-width: 280px;
    background: transparent;  /* Sem fundo branco */
    z-index: 1000;
    overflow-y: visible;
}

.sidebar.active {
    left: 4rem;
}

.sidebar-header {
    padding: 0 0 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 17px;  /* +20% (14 * 1.2) */
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;  /* Negrito para destaque */
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2);
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-menu li {
    border-bottom: none;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 17px;  /* +20% (14 * 1.2) */
    font-weight: 700;  /* Negrito para destaque */
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    position: relative;
}

.nav-menu a::before {
    content: '>';
    position: absolute;
    left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-menu a:hover {
    padding-left: 2rem;
    background: rgba(0, 0, 0, 0.03);
}

.nav-menu a:hover::before {
    opacity: 1;
}

.nav-menu a.active {
    background: rgba(0, 0, 0, 0.05);
    padding-left: 2rem;
}

.nav-menu a.active::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTÃO MENU
   ═══════════════════════════════════════════════════════════════════════════ */

.menu-toggle {
    display: none;  /* Escondido no desktop */
}

.close-btn {
    display: none;  /* Escondido no desktop */
}

@keyframes buttonGlitch {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-2px, 0); }
    40% { transform: translate(2px, 0); }
    60% { transform: translate(-1px, 0); }
    80% { transform: translate(1px, 0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTEÚDO PRINCIPAL
   ═══════════════════════════════════════════════════════════════════════════ */

.main-content {
    max-width: 1200px;  /* Gráficos maiores, centralizados */
    margin: 0 auto;  /* Centraliza horizontalmente */
    padding: 4rem 3rem;  /* Espaço entre Intro, Índice e áreas laterais */
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEÇÕES - ANIMAÇÃO DE ENTRADA GRADUAL (estilo nfinitepaper/axon-pulse)
   ═══════════════════════════════════════════════════════════════════════════ */

.section {
    margin-bottom: 2rem;
    padding: 4rem 0;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    
    /* Estado inicial: invisível e deslocado */
    opacity: 0;
    transform: translateY(80px);
    transition: none;
}

/* Estado visível: animação suave inspirada em nfinitepaper.com */
.section.visible {
    opacity: 1;
    transform: translateY(0);
    transition: 
        opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Atraso escalonado para elementos filhos */
.section.visible .chart-container {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    animation: revealChart 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.3s;
}

.section.visible .chart-title {
    opacity: 0;
    animation: fadeSlideIn 0.6s ease forwards;
    animation-delay: 0.1s;
}

.section.visible .chart-note {
    opacity: 0;
    animation: fadeSlideIn 0.6s ease forwards;
    animation-delay: 0.8s;
}

@keyframes revealChart {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Linha decorativa antes de cada seção */
.section::before {
    content: '════════════════════════════════════════════════════════════════';
    display: block;
    font-size: 10px;
    color: var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.section.visible::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTAINERS DE GRÁFICOS
   ═══════════════════════════════════════════════════════════════════════════ */

.chart-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: 4px 4px 0 var(--text-color);
    transform: translate(-2px, -2px);
}

/* Canto decorativo ASCII */
.chart-container::before {
    content: '┌──';
    position: absolute;
    top: 0;
    left: 0;
    font-size: 12px;
    color: var(--text-muted);
    transform: translate(-1px, -1px);
}

.chart-container::after {
    content: '──┘';
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 12px;
    color: var(--text-muted);
    transform: translate(1px, 1px);
}

#defi-rates-chart-wrapper,
#defi-rates-query2-chart-wrapper,
#defi-rates-query3-chart-wrapper,
#defi-rates-query4-chart-wrapper {
    background: transparent;
    padding: 1rem 0;
    min-height: 420px;  /* Gráficos maiores */
    position: relative;
}

#defi-rates-chart,
#defi-rates-query2-chart,
#defi-rates-query3-chart,
#defi-rates-query4-chart {
    max-height: 600px;  /* Gráficos maiores */
    width: 100% !important;
    height: auto !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEÇÃO INTRODUÇÃO
   ═══════════════════════════════════════════════════════════════════════════ */

.section-intro {
    min-height: auto;
    padding: 12vh 0 4vh 0;  /* Compacto para o Benchmark continuar visível ao abrir */
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-intro::before {
    display: none;  /* Remove a linha decorativa da intro */
}

.intro-container {
    max-width: 700px;
    text-align: center;
    padding: 2rem;
    margin: 0 auto;
}

.intro-title {
    font-size: 28px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.intro-content {
    font-size: 15px;
    line-height: 2;
    color: var(--text-color);
}

.intro-content p {
    margin-bottom: 1.5rem;
}

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

.intro-content strong {
    font-weight: 600;
}

.section.visible .intro-container {
    opacity: 0;
    animation: fadeSlideIn 1s ease forwards;
    animation-delay: 0.2s;
}

/* Wrapper para layout flex no mobile */
.intro-wrapper {
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

/* Índice mobile - escondido no desktop */
.mobile-index {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TÍTULOS E TEXTOS
   ═══════════════════════════════════════════════════════════════════════════ */

.chart-title {
    font-size: 20px;  /* 2x o tamanho da legenda (10px) */
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    position: relative;
}

.chart-title::before {
    content: '// ';
    color: var(--text-muted);
}

.chart-note {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1.5rem;
    letter-spacing: 1px;
}

/* Descrição explicativa de cada seção (abaixo do gráfico) */
.chart-description {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-color);
    margin-top: 2rem;
    padding: 1.5rem 0 0 0;
    border-top: 1px solid var(--border-color);
}

.chart-description p {
    margin-bottom: 1rem;
}

.chart-description p:last-child {
    margin-bottom: 0;
}

.chart-description strong {
    font-weight: 600;
}

.chart-description ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.chart-description li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.chart-description li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.chart-description a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.chart-description a:hover {
    border-bottom-color: var(--text-color);
    background: rgba(0, 0, 0, 0.05);
}

.section.visible .chart-description {
    opacity: 0;
    animation: fadeSlideIn 0.6s ease forwards;
    animation-delay: 0.8s;
}

.chart-note a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.chart-note a:hover {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
    background: rgba(0, 0, 0, 0.05);
}

/* .chart-source removido conforme solicitado */

/* ═══════════════════════════════════════════════════════════════════════════
   LEGENDAS E LABELS HTML CUSTOMIZADOS (com efeito glitch)
   ═══════════════════════════════════════════════════════════════════════════ */

.chart-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: default;
    transition: all 0.2s ease;
}

.chart-legend-item:hover {
    animation: textGlitch 0.3s ease-in-out infinite;
}

.chart-legend-color {
    width: 20px;
    height: 3px;
    display: inline-block;
}

.chart-legend-label {
    color: var(--text-color);
}

/* Labels de eixo removidos conforme solicitado */

/* ═══════════════════════════════════════════════════════════════════════════
   RODAPÉ
   ═══════════════════════════════════════════════════════════════════════════ */

.footer {
    text-align: center;
    padding: 4rem 0 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.footer::before {
    content: '═══════════════════════════════════════════════════════════════';
    display: block;
    font-size: 10px;
    margin-bottom: 2rem;
    color: var(--border-color);
}

.footer p {
    transition: all 0.2s ease;
    cursor: default;
}

.footer p:hover {
    animation: textGlitch 0.3s ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVIDADE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-color);
        border-right: 1px solid var(--border-color);
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-header {
        padding: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .close-btn {
        display: block;
    }
    
    .menu-toggle {
        display: none;  /* Escondido no mobile - índice aparece na intro */
    }
    
    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 11px;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }

    .section {
        min-height: auto;
        padding: 2rem 0;
        margin-bottom: 1rem;
    }

    .chart-container {
        padding: 0.75rem;
    }
    
    .section-intro {
        min-height: auto;
        padding: 3rem 0 2rem 0;
    }
    
    /* Layout lado a lado no mobile */
    .intro-wrapper {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
        max-width: 100%;
        text-align: left;
        padding: 0 0.5rem;
    }
    
    /* Índice mobile visível */
    .mobile-index {
        display: block;
        flex: 0 0 30%;
        padding-top: 0.5rem;
    }
    
    .mobile-index-title {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 2px;
        font-weight: normal;
        margin-bottom: 0.75rem;
        color: var(--text-muted);
    }
    
    .mobile-index-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-index-menu li {
        margin-bottom: 0.4rem;
    }
    
    .mobile-index-menu a {
        display: block;
        color: var(--text-color);
        text-decoration: none;
        font-size: 9px;
        letter-spacing: 1px;
        text-transform: lowercase;
        line-height: 1.4;
    }
    
    .mobile-index-menu a:hover {
        color: var(--text-muted);
    }
    
    /* Intro ocupa 70% */
    .intro-container {
        flex: 0 0 70%;
        padding: 0;
        text-align: left;
    }
    
    .intro-title {
        font-size: 16px;
        letter-spacing: 2px;
        margin-bottom: 1rem;
    }
    
    .intro-content {
        font-size: 13px;
        line-height: 1.8;
    }
    
    #defi-rates-chart-wrapper,
    #defi-rates-query2-chart-wrapper,
    #defi-rates-query3-chart-wrapper,
    #defi-rates-query4-chart-wrapper {
        padding: 0.5rem 0;
        min-height: 280px;
    }

    .menu-toggle {
        top: 1rem;
        left: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 10px;
    }

    .section::before {
        content: '════════════════════════';
        font-size: 8px;
    }
    
    .chart-legend {
        gap: 1rem;
        padding: 0.5rem 0;
    }
    
    .chart-legend-item {
        font-size: 8px;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .section {
        padding: 1.5rem 0;
    }
    
    .chart-container {
        padding: 0.5rem;
    }
    
    #defi-rates-chart-wrapper,
    #defi-rates-query2-chart-wrapper,
    #defi-rates-query3-chart-wrapper,
    #defi-rates-query4-chart-wrapper {
        padding: 0.25rem 0;
        min-height: 240px;
    }
    
    .chart-title {
        font-size: 14px;
        letter-spacing: 1px;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .chart-note {
        font-size: 9px;
        line-height: 1.6;
        margin-top: 1rem;
    }
    
    .chart-legend {
        gap: 0.75rem;
        padding: 0.25rem 0;
        margin-bottom: 0.5rem;
    }
    
    .chart-legend-item {
        font-size: 7px;
        gap: 0.25rem;
    }
    
    .chart-legend-color {
        width: 15px;
        height: 2px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLL SUAVE
   ═══════════════════════════════════════════════════════════════════════════ */

html {
    scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.loading {
    position: relative;
}

.loading::after {
    content: '█';
    animation: blink 0.5s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CANVAS DO GRÁFICO - Estado inicial oculto até scroll
   ═══════════════════════════════════════════════════════════════════════════ */

.chart-canvas-hidden {
    opacity: 0 !important;
    visibility: hidden;
}

.chart-canvas-visible {
    opacity: 1 !important;
    visibility: visible;
    transition: opacity 0.8s ease;
}
