/* Restablecimiento básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0d1117;
    color: #c9d1d9;
    padding: 2rem;
    display: flex;
    justify-content: center;
	flex-direction: column; /* Alinea los elementos en vertical */
    align-items: center;     /* Centra el contenedor y el footer */
}

/* Ancho ampliado para que quepan las 5 métricas alineadas */
.container {
    width: 100%;
    max-width: 1250px;
}

/* Este es el que controla la altura real del gráfico */
.chart-container {
    position: relative;
    width: 100%;
    height: 250px; /* Adjusta aquí la altura que quieras (450px, 500px, etc.) */
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 1.4rem;
    color: #f0f6fc;
    margin-bottom: 1.2rem;
    text-align: center;
}

/* Buscador */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background-color: #161b22;
    color: #f0f6fc;
    font-size: 1rem;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #58a6ff;
}

.search-box button {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    background-color: #238636;
    color: #ffffff;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-box button:hover {
    background-color: #2ea043;
}

/* Tarjeta principal de información */
.card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #21262d;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

.symbol {
    font-size: 1.1rem;
    font-weight: bold;
    color: #f0f6fc;
}

.price {
    font-size: 1.1rem;
    font-weight: bold;
}



/* Rejilla de métricas: 5 columnas exactas para alinear Apertura */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.metric-item {
    background-color: #0d1117;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #21262d;
}

.metric-label {
    font-size: 0.85rem;
    color: #8b949e;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #c9d1d9;
}

/* Clases dinámicas para tendencias y señales */
.positive { color: #3fb950; }
.negative { color: #f85149; }

.badge-compra {
    background-color: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid #3fb950;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
	display: inline-block;
    margin-top: 4px;
}

.badge-venta {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid #f85149;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
	display: inline-block;
    margin-top: 4px;
}

.badge-neutral {
    background-color: rgba(139, 148, 158, 0.15);
    color: #8b949e;
    border: 1px solid #8b949e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
	display: inline-block;
    margin-top: 10px; /* Ajusta este valor para dar más o menos espacio */
}
.badge-acumulacion {
    background-color: rgba(139, 148, 158, 0.15);
    color: #8b949e;
    border: 1px solid #8b949e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
	display: inline-block;
    margin-top: 10px; /* Ajusta este valor para dar más o menos espacio */
}
.badge-confirmacion{
    display: inline-block;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid var(--signal-color, #238636);
    color: var(--signal-color, #238636);
    background-color: color-mix(in srgb, var(--signal-color) 12%, transparent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-pre-ruptura {
    background-color: rgba(210, 153, 34, 0.15);
    color: #e3b341;
    border: 1px solid #d29922;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    display: inline-block;
    margin-top: 4px;
    text-transform: uppercase;
}

.error-msg {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid #f85149;
    color: #f85149;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-box {
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border: 1px solid transparent;
}

.alert-box.neutral {
    background-color: rgba(33, 38, 45, 0.6);
    border-color: #30363d;
    color: #8b949e;
}

.alert-box.bullish {
    background-color: rgba(63, 185, 80, 0.12);
    border-color: #3fb950;
    color: #3fb950;
    box-shadow: 0 0 12px rgba(63, 185, 80, 0.2);
}

.alert-box.bearish {
    background-color: rgba(248, 81, 73, 0.12);
    border-color: #f85149;
    color: #f85149;
    box-shadow: 0 0 12px rgba(248, 81, 73, 0.2);
}

.alert-title {
    font-weight: bold;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Selector de Timeframes */
.timeframe-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.tf-btn {
    background-color: #21262d;
    color: #8b949e;
    border: 1px solid #30363d;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tf-btn:hover {
    background-color: #30363d;
    color: #c9d1d9;
}

.tf-btn.active {
    background-color: #238636;
    color: #ffffff;
    border-color: #2ea043;
}

/* Adaptabilidad para pantallas reducidas o móviles */
@media (max-width: 992px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}
/* Estilo especial para la alerta de Muelle / Squeeze */
.alert-box.squeeze {
    background-color: rgba(187, 128, 9, 0.12);
    border: 1px solid #d29922;
    color: #e3b341;
    box-shadow: 0 0 12px rgba(210, 153, 34, 0.15);
}

/* Efecto de pulso suave para simular la presión del muelle */
.alert-box.squeeze .alert-title {
    animation: springPulse 1.8s infinite ease-in-out;
}

@keyframes springPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); color: #f2c75c; }
    100% { transform: scale(1); }
}
/* --- ESTADOS Y ANIMACIONES DEL MUELLE --- */

.squeeze-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* 1. Compresión Extrema (Amarillo/Dorado) */
.squeeze-badge.extreme {
    background-color: rgba(212, 167, 44, 0.15);
    border: 1px solid #d4a72c;
    color: #f3d16e;
}
.squeeze-badge.extreme svg {
    animation: springCompress 1.2s infinite ease-in-out;
}

/* 2. Volatilidad Normal (Azul/Verde) */
.squeeze-badge.normal {
    background-color: rgba(56, 139, 253, 0.15);
    border: 1px solid #388bfd;
    color: #79c0ff;
}
.squeeze-badge.normal svg {
    animation: springFloat 2.5s infinite ease-in-out;
}

/* 3. Alta Volatilidad / Expansión (Rojo/Naranja) */
.squeeze-badge.high {
    background-color: rgba(248, 81, 73, 0.15);
    border: 1px solid #f85149;
    color: #ff7b72;
}
.squeeze-badge.high svg {
    animation: springExplode 0.6s infinite ease-in-out;
}

/* --- ANIMACIONES KEYFRAMES --- */

/* Muelle apretándose verticalmente (Pulsión lenta) */
@keyframes springCompress {
    0%, 100% { transform: scaleY(1) scaleX(1); }
    50% { transform: scaleY(0.65) scaleX(1.15); }
}

/* Muelle oscilando suavemente */
@keyframes springFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Muelle vibrando de forma agresiva */
@keyframes springExplode {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-4deg); }
    75% { transform: scale(1.15) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.btn-logout {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f85149;
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.4);
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
    background-color: rgba(248, 81, 73, 0.25);
    border-color: #f85149;
    color: #ffffff;
}
.btn-logout-top-right {
    position: absolute;
    top: 20px;
    right: 25px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: inherit;
    color: #8b949e;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    z-index: 100;
}

/* Efecto hover discreto */
.btn-logout-top-right:hover {
    color: #f0f6fc;
    background-color: #21262d;
    border-color: #8b949e;
}

/* Color del icono SVG */
.btn-logout-top-right svg {
    stroke: #8b949e;
    transition: stroke 0.2s ease;
}

.btn-logout-top-right:hover svg {
    stroke: #f0f6fc;
}
/* --- PIE DE PÁGINA Y DISCLAIMER LEGAL --- */
.main-footer {
    margin-top: 2.5rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid #21262d;
    color: #8b949e;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.5;
}

.main-footer-content {
    max-width: 1250px;
    margin: 0 auto;
}

.main-footer p {
    margin-bottom: 0.5rem;
}

.main-footer p strong {
    color: #c9d1d9;
}

.main-footer-copyright {
    color: #484f58;
    font-size: 0.75rem;
    margin-top: 0.75rem;
}
/* --- PÁGINA DE MI CUENTA / FORMULARIOS --- */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #8b949e;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background-color: #0d1117;
    color: #f0f6fc;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #58a6ff;
}

.form-control:disabled {
    background-color: #161b22;
    color: #484f58;
    cursor: not-allowed;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    background-color: #238636;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #2ea043;
}
.stock-card:hover {
    transform: translateY(-3px);
    border-color: #58a6ff !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}

.btn-analysis:hover {
    background: #30363d !important;
    color: #79c0ff !important;
}
/* Importamos la fuente futurista similar a la del logo */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;800&display=swap');

.logo-container {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    height: 42px; /* Altura ajustada a tu cabecera */
}

.logo-text {
    font-family: 'Orbitron', system-ui, sans-serif;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    
    /* Degradado metálico plateado para "StockPlan" */
    background: linear-gradient(180deg, #ffffff 0%, #d1d5db 45%, #8a939e 80%, #5c636e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* Sombra 3D profunda igual a la imagen */
    filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.9));
}

.logo-ia {
    /* Verde neón brillante */
    background: linear-gradient(180deg, #6ee7b7 0%, #22c55e 50%, #15803d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* Resplandor neón verde alrededor de IA */
    filter: drop-shadow(0px 0px 8px rgba(34, 197, 94, 0.8)) 
            drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.9));
}

.logo-domain {
    font-weight: 800;
    font-size: 28px;
    
    /* Tono metálico un poco más oscuro para el .com */
    background: linear-gradient(180deg, #e5e7eb 0%, #9ca3af 60%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.btn-telegram {
    background: #2AABEE;
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(42, 171, 238, 0.35);
    white-space: nowrap;
}

.btn-telegram:hover {
    background: #229ed9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 171, 238, 0.5);
}

.btn-telegram:active {
    transform: translateY(0);
}

/* ==========================================
   AJUSTES RESPONSIVE PARA MÓVILES (< 768px)
   ========================================== */
@media (max-width: 768px) {

    /* 1. Ajuste del padding del body para ganar espacio lateral */
    body {
        padding: 1rem 0.75rem;
    }

    /* 2. Cabecera y posición del botón superior */
    body {
        position: relative; /* Asegura el contexto de posicionamiento */
    }

    .btn-logout-top-right {
        position: static; /* Quitamos la posición absoluta en móvil */
        display: inline-flex;
        margin: 0 auto 1.5rem auto; /* Lo centramos justo antes del buscador */
        align-self: center;
    }

    /* 3. Redimensionado del Logo */
    .logo-text {
        font-size: 22px;
    }

    .logo-domain {
        font-size: 20px;
    }

    .logo-container {
        height: auto;
        margin-bottom: 0.5rem;
    }

    /* 4. Buscador adaptado al 100% de ancho */
    .search-box {
        flex-direction: column; /* Apila el input y el botón en vertical */
        width: 100%;
        gap: 8px;
    }

    .search-box input[type="text"],
    .search-box button {
        width: 100%;
    }

    /* 5. Métrica e Indicadores del Banner Top 8 */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil en lugar de 5 */
        gap: 0.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* 6. Selector de Timeframes centrados */
    .timeframe-selector {
        justify-content: center;
        flex-wrap: wrap;
    }
}