/* Default theme variables (News Red) */
:root {
    --bg-color: #e2e8f0;
    --news-blue: rgba(0, 32, 70, 0.9);
    --news-red: #c80000;
    --news-gold: #f2ae00;
    --accent: #00ff88;
    --danger: #ff3e3e;
}

/* Tema Corporativo Plata/Azul */
.theme-corp-silver {
    --news-blue: rgba(30, 58, 95, 0.9);
    --news-red: #d1d5db; /* Plata */
    --news-gold: #3b82f6; /* Azul brillante */
    --bg-color: #f1f5f9;
}

/* Tema Dark Gold */
.theme-dark-gold {
    --news-blue: rgba(0, 0, 0, 0.9);
    --news-red: #d4af37; /* Oro */
    --news-gold: #ffffff;
    --bg-color: #1a1a1a;
}

:root {
    --text-main: #1e293b;
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Estilos base ajustados para el plugin */
.bankoi-ticker-wrapper {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

/* Adaptación para pantalla completa (Demo Mode) */
.full-screen-demo .widget-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* Ocupa todo el alto para evitar separaciones; el ticker se superpone al final */
    bottom: auto;
    border-bottom: none;
    border-right: 15px solid var(--news-red);
}

/* Widget Flotante */
.widget-card {
    position: fixed;
    bottom: 120px; /* Posicionado más alto */
    left: 40px;   /* Posicionado a la izquierda */
    width: 1200px; /* Un poco más ancho para el escalonado */
    height: 650px; /* Más alto para albergar los datos debajo del título */
    background-image: url('FondoWallStreetPlaceholder.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 0;
    box-shadow: var(--card-shadow);
    border-bottom: 8px solid var(--news-red);
    overflow: hidden;
    z-index: 99999; /* Encima de todo */
    display: flex;
    flex-direction: column; /* Cambiamos a columna para poner datos bajo el título */
}

.diagonal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--news-blue);
    clip-path: polygon(0 0, 45% 0, 65% 100%, 0% 100%); 
    z-index: 1;
}

.widget-header-news {
    position: relative;
    z-index: 2;
    padding-top: 8vh;
    margin-bottom: 5vh;
    display: flex;
    align-items: center;
    padding-left: 5vw;
}

.market-title {
    color: white;
    font-weight: 900;
    font-size: 6.5vw; /* Aumentado ligeramente */
    line-height: 1.1;
    text-transform: uppercase;
    border-left: 1.5vw solid var(--news-red);
    padding-left: 2vw;
    background: var(--news-red);
    padding: 15px 25px;
}

.widget-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding-left: 8vw; 
    transition: opacity 0.5s ease-in-out;
}

.asset-item {
    margin-bottom: 7vh; /* Espaciado mayor para 4 elementos */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Evita que el bloque se estire al ancho total */
}

/* El rectángulo blanco que ahora contiene precio y cambio */
.asset-data {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 10px 30px;
    gap: 1.5vw;
    min-width: 28vw; /* Caja un poco más ancha */
    box-shadow: 8px 8px 0px var(--news-red);
    transition: all 0.3s ease;
}

/* Escalado proporcional para pantalla completa (5 items) */
.asset-item:nth-child(1) { margin-left: 5vw; }
.asset-item:nth-child(2) { margin-left: 10vw; }
.asset-item:nth-child(3) { margin-left: 15vw; }
.asset-item:nth-child(4) { margin-left: 20vw; }

.asset-symbol {
    font-size: 2.5vw; /* Símbolo más grande */
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.asset-price {
    color: #1a1a1a;
    font-size: 4.2vw; /* Precio más grande */
    font-weight: 900;
}

.asset-change {
    font-size: 3.5vw; /* Porcentaje más grande */
    font-weight: 900;
    text-shadow: none; /* Quitamos la sombra ya que ahora está sobre fondo blanco */
}

/* Ticker Footer */
.ticker-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--news-red);
    color: white;
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 100000; /* Un nivel por encima del widget para seguridad */
}

.ticker-wrapper {
    display: inline-flex;
    white-space: nowrap;
    animation: scroll-ticker 30s linear infinite;
}

.ticker-element {
    padding: 0 30px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.val-up { color: #00ff88; }
.val-down { color: #ff0f0f; }

/* ==========================================================================
   RESPONSIVE DESIGN (Escalado para PC 1080p y Tablets)
   ========================================================================== */

/* Ajustes para PC Estándar (Full HD - 1080p) */
@media (max-width: 1920px) {
    .widget-card {
        width: 850px;
        height: 620px; /* Ajustado para 4 campos grandes */
        bottom: 80px;
        left: 30px;
    }

    .market-title {
        font-size: 38px;
        border-left-width: 8px;
        padding: 10px 20px;
    }

    .widget-header-news {
        padding-top: 30px;
        padding-left: 40px;
        margin-bottom: 30px;
    }

    .asset-symbol {
        font-size: 22px;
    }

    .asset-data {
        padding: 8px 20px;
        min-width: 320px;
    }

    .asset-price {
        font-size: 28px;
        min-width: 130px;
        padding: 6px 15px;
    }

    .asset-change {
        font-size: 24px;
    }

    /* Ajuste de escalonado para 1080p */
    .asset-item:nth-child(1) { margin-left: 20px; }
    .asset-item:nth-child(2) { margin-left: 75px; }
    .asset-item:nth-child(3) { margin-left: 130px; }
    .asset-item:nth-child(4) { margin-left: 185px; }
}

/* Ajustes para Tablets y Pantallas Pequeñas */
@media (max-width: 1024px) {
    .widget-card {
        width: 600px;
        height: 480px; /* Ajustado para 4 campos */
        bottom: 60px;
        left: 20px;
    }

    .asset-data {
        padding: 5px 10px;
        box-shadow: 3px 3px 0px var(--news-red);
        min-width: 220px;
    }

    .market-title {
        font-size: 28px;
        border-left-width: 6px;
    }

    .asset-price {
        font-size: 22px;
    }

    /* Ajuste de escalonado para Tablets */
    .asset-item:nth-child(1) { margin-left: 15px; }
    .asset-item:nth-child(2) { margin-left: 55px; }
    .asset-item:nth-child(3) { margin-left: 95px; }
    .asset-item:nth-child(4) { margin-left: 135px; }
}

@keyframes scroll-ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}
