/* Base tipográfica responsive: más grande en desktop (espacio sobra),
   moderada en móvil (pantallas pequeñas). Tailwind usa rem → escala todo. */
html {
    font-size: 19.5px;
}
@media (max-width: 1024px) {
    html { font-size: 18px; }
}
@media (max-width: 768px) {
    html { font-size: 16.5px; }
}
@media (max-width: 380px) {
    html { font-size: 15.5px; }
}

/* Bump de los tamaños absolutos minúsculos (text-[8px], [9px], [10px]). */
.text-\[8px\],
.md\:text-\[8px\] {
    font-size: 11px !important;
}

.text-\[9px\],
.md\:text-\[9px\] {
    font-size: 12px !important;
}

.text-\[10px\],
.md\:text-\[10px\] {
    font-size: 13px !important;
}

/* En móvil, los micro-textos se reducen un punto más para no saturar */
@media (max-width: 768px) {
    .text-\[8px\],
    .md\:text-\[8px\] { font-size: 10px !important; }
    .text-\[9px\],
    .md\:text-\[9px\] { font-size: 11px !important; }
    .text-\[10px\],
    .md\:text-\[10px\] { font-size: 12px !important; }
}

/* AJUSTES MÓVIL ESPECÍFICOS — auditoría */
@media (max-width: 768px) {
    /* Veredicto principal: text-4xl es excesivo en pantalla pequeña */
    #resVerdict .text-4xl {
        font-size: 1.85rem !important;
        line-height: 1.05 !important;
    }
    /* Precio objetivo grande */
    #targetHighlight .text-5xl {
        font-size: 2.5rem !important;
    }
    #targetHighlight .text-2xl {
        font-size: 1.1rem !important;
    }
    /* Las celdas de la grid de fundamentales más compactas */
    #resultArea .text-xl {
        font-size: 1.05rem !important;
    }
    /* Ticker grande también se reduce */
    #resTicker {
        font-size: 1.65rem !important;
        line-height: 1.1 !important;
    }
    /* Botón flotante de "Apoyar el proyecto": más pequeño y discreto */
    body > a.fixed.bottom-6.right-6 {
        bottom: 0.75rem !important;
        right: 0.75rem !important;
        padding: 0.4rem !important;
    }
    body > a.fixed.bottom-6.right-6 span {
        display: none !important;
    }
}

body {
    background-color: #05070a;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    width: 100%;
}

/* ============================================================
   HEADER STICKY GLOBAL + ANIMACIÓN SCROLL-DRIVEN
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(5, 7, 10, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header-inner {
    position: relative;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.header-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}

/* En cuanto el usuario hace scroll (o en sub-páginas) el logo pasa a la izquierda */
body.has-scrolled .header-logo {
    left: 0;
    transform: translate(0, -50%);
}

.header-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    z-index: 1;
}

.header-nav-link {
    color: rgba(156, 163, 175, 0.85);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color 0.2s ease;
}
.header-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    transition: width 0.25s ease;
}
.header-nav-link:hover,
.header-nav-link.active {
    color: #10b981;
}
.header-nav-link:hover::after,
.header-nav-link.active::after {
    width: 100%;
}

/* RESPONSIVE MÓVIL: el logo siempre a la izquierda (no hay sitio para centrar)
   y nav-links más pequeños / juntos para no desbordar */
@media (max-width: 768px) {
    .header-logo {
        left: 0;
        transform: translate(0, -50%);
        font-size: 1.25rem;
    }
    body.has-scrolled .header-logo {
        left: 0;
        transform: translate(0, -50%);
    }
    .header-nav {
        gap: 0.85rem;
    }
    .header-nav-link {
        font-size: 9px;
        letter-spacing: 0.18em;
    }
    /* Chart de TradingView más compacto en móvil */
    #tvChartContainer {
        height: 280px !important;
    }
    /* Padding extra al main del landing para que el hero no choque con el header */
    .hero-content {
        margin-top: 1rem !important;
    }
}

.chart-interval-btn {
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.chart-interval-btn:hover {
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.05);
}

.chart-interval-active {
    border-color: rgba(16,185,129,0.6) !important;
    background: rgba(16,185,129,0.1) !important;
    color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16,185,129,0.2);
}

/* Radio cards del formulario de feedback */
.feedback-radio {
    cursor: pointer;
    text-align: center;
    padding: 12px 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    color: #6b7280;
    font-size: 11px;
    letter-spacing: 0.2em;
    font-weight: 700;
    transition: all 0.2s ease;
    display: block;
}
.feedback-radio:hover {
    border-color: rgba(16,185,129,0.3);
    color: #ffffff;
    background: rgba(16,185,129,0.03);
}
.feedback-radio:has(input:checked) {
    border-color: rgba(16,185,129,0.6);
    background: rgba(16,185,129,0.08);
    color: #10b981;
    box-shadow: 0 0 12px rgba(16,185,129,0.15);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.info-trigger {
    position: relative;
}

@media (max-width: 768px) {
    .info-trigger::after {
        width: 140px;
        font-size: 10px;
        left: auto;
        right: 0;
        transform: translateY(10px);
    }

    .info-trigger:hover::after {
        transform: translateY(0);
    }
}

.info-trigger::after {
    z-index: 9999 !important;
    pointer-events: none;
    white-space: normal;
}

#targetHighlight {
    overflow: visible !important;
}

@media (max-width: 640px) {
    #resultArea .grid-cols-3 {
        grid-template-cols: repeat(1, minmax(0, 1fr)) !important;
        gap: 1.5rem !important;
    }

    #resTicker {
        font-size: 1.875rem;
    }

    #resPrice {
        font-size: 0.875rem;
    }

    .glass {
        padding: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .wave-container {
        height: 50vh;
    }

    .waves {
        height: 80px;
        min-height: 80px;
    }
}

main {
    position: relative;
    z-index: 10 !important;
}

.glass {
    background: rgba(17, 19, 22, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 20;
}

.neon-border {
    box-shadow: 0 0 15px rgba(5, 255, 161, 0.2);
    border: 1px solid rgba(5, 255, 161, 0.5);
}

.gradient-text {
    background: linear-gradient(90deg, #05ffa1, #00e5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-2 {
    background: linear-gradient(90deg, #bcccc6, #d2d7d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

}

.animate-marquee {
    display: inline-flex;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.overflow-hidden {
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.wave-container {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: -100 !important;
    pointer-events: none;
    background: transparent !important;
    display: flex;
    align-items: flex-end;
}

.waves {
    width: 100%;
    height: 25vh;
    min-height: 150px;
    max-height: 300px;
}

.parallax>use {
    animation: move-forever 35s cubic-bezier(.55, .5, .45, .5) infinite;
}

.parallax>use:nth-child(1) {
    fill: rgba(5, 255, 161, 0.04);
    animation-duration: 12s;
}

.parallax>use:nth-child(2) {
    fill: rgba(5, 255, 161, 0.07);
    animation-duration: 18s;
}

.parallax>use:nth-child(3) {
    fill: rgba(5, 255, 161, 0.1);
    animation-duration: 22s;
}

.parallax>use:nth-child(4) {
    fill: rgba(5, 255, 161, 0.15);
    animation-duration: 30s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }

    100% {
        transform: translate3d(85px, 0, 0);
    }
}

@media (max-width: 768px) {
    .waves {
        height: 40px;
        min-height: 40px;
    }
}

.info-trigger {
    width: 14px;
    height: 14px;
    border: 1px solid #4b5563;
    color: #4b5563;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: help;
    transition: all 0.3s ease;
}

.info-trigger:hover {
    border-color: #10b981;
    color: #10b981;
}

.info-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    width: 180px;
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
}

.info-trigger:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: -0.02em;
}

footer a {
    text-decoration: none;
    letter-spacing: 2px;
}

.info-trigger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #6b7280;
    font-weight: bold;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 100;
}


.font-mono span {
    position: relative;
    padding-left: 10px;
}

.font-mono span::before {
    content: ">";
    position: absolute;
    left: 0;
    color: #374151;
    font-size: 8px;
}

.text-emerald-400\/90 {
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(400%);
        opacity: 0;
    }
}

.target-glow-green {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.target-glow-red {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

#resTarget {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

#reqTickerInput::placeholder {
    color: #374151;
    text-transform: none;
    letter-spacing: normal;
}

.btn-loading {
    background: #111827 !important;
    color: #10b981 !important;
    border: 1px solid #10b981 !important;
    cursor: wait;
}

.btn-success {
    background: #10b981 !important;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4) !important;
}

@keyframes coffee-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.1);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.coffee-pulse {
    animation: coffee-pulse 2s infinite;
}

#ia-writing-area {
    padding-left: 0;
    border-left: none !important;
}

.info-trigger {
    margin-left: 6px;
    cursor: help;
}

/* --- CSS CORREGIDO PARA EVITAR HOVER RARO --- */

/* Contenedor del icono: relativo para posicionar el tooltip */
.info-trigger {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 20;
    /* Asegura que esté por encima del fondo del botón */
}

/* El texto del Tooltip: oculto por defecto */
.tooltip-text {
    visibility: hidden;
    width: 200px;
    /* Un poco más ancho para que respire el texto */
    background-color: rgba(5, 7, 10, 0.98);
    /* Fondo casi negro puro y opaco */
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 12px;
    position: absolute;
    z-index: 30;
    /* Por encima de todo */

    /* POSICIONAMIENTO CORREGIDO: Más arriba para no tocar el puntero */
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    /* Empieza un poco más abajo */

    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Transición suave */

    font-size: 10px;
    /* Un pelín más grande para leer mejor */
    font-family: 'Inter', sans-serif;
    text-transform: none;
    /* No gritar en mayúsculas */
    line-height: 1.5;
    border: 1px solid rgba(16, 185, 129, 0.4);
    /* Borde neón */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    /* Sombra profunda */

    /* LA SOLUCIÓN MÁGICA: Evita que el ratón interactúe con el tooltip */
    pointer-events: none;
}

/* Mostrar el tooltip al hacer hover en el ICONO de info */
.info-trigger:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    /* Sube suavemente */
}

/* Triángulo del tooltip (Opcional, si no te gusta cómo queda, quítalo) */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    /* En la base del tooltip */
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.4) transparent transparent transparent;
}

.terminal-cursor::after {
    content: "_";
    /* O use "|" si prefieres */
    animation: blink-cursor 0.8s step-end infinite;
    color: #10b981;
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink-cursor {

    from,
    to {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

#ia-writing-area {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    height: auto;
    /* Permite que crezca con el texto */
}

/* Efecto de resplandor para el veredicto COMPRA FUERTE */
.text-emerald-500.transition-all {
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}