/**
 * DRAGONAUTO - Estilos Específicos
 * Basado en El Ojo del Dragón Design System
 *
 * Paleta de colores:
 * - Primary: #1a1a2e (fondo oscuro)
 * - Secondary: #f7931e (naranja dragón)
 * - Accent: #c75b12 (rojo zorro)
 * - Text: #d8d8d8
 */

/* ============================================
   VARIABLES CSS (Si no están definidas en padre)
   ============================================ */
:root {
    --primary: #1a1a2e;
    --primary-dark: #12121f;
    --primary-light: #252542;
    --secondary: #f7931e;
    --secondary-light: #ffab40;
    --accent: #c75b12;
    --body-text: #d8d8d8;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --success: #00d26a;
    --error: #ff4757;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;

    --shadow-glow: 0 12px 40px rgba(247, 147, 30, 0.25);
    --gradient-primary: linear-gradient(135deg, #f7931e 0%, #c75b12 100%);
    --gradient-dark: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(18, 18, 31, 1) 100%);
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary);
    color: var(--body-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ============================================
   HEADER ESPECÍFICO
   ============================================ */
.dragonauto-header {
    background: var(--gradient-dark);
    padding: var(--spacing-xl) 0;
    border-bottom: 2px solid var(--secondary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
    transition: var(--transition-fast);
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent);
    transform: translateX(-4px);
}

.dragonauto-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: var(--body-text);
    text-align: center;
    margin: 0;
    line-height: 1.2;
}

.dragon-icon {
    font-size: var(--font-size-4xl);
    display: inline-block;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 20px rgba(247, 147, 30, 0.4));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.subtitle {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--secondary);
    margin-top: var(--spacing-sm);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.dragonauto-main {
    background: var(--primary);
    min-height: 100vh;
    padding: var(--spacing-2xl) 0 var(--spacing-3xl) 0;
}

/* ============================================
   SECTIONS
   ============================================ */
.dashboard-section,
.chart-section {
    margin-bottom: var(--spacing-3xl);
}

.section-header {
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--body-text);
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    color: var(--gray-400);
    font-size: var(--font-size-base);
}

/* ============================================
   METRICS GRID (Dashboard Resumen)
   ============================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.metric-card {
    background: linear-gradient(135deg,
                rgba(247, 147, 30, 0.05) 0%,
                rgba(199, 91, 18, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(247, 147, 30, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: var(--transition-base);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--secondary);
}

.metric-icon {
    font-size: 3rem;
    line-height: 1;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.metric-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin: var(--spacing-xs) 0;
    line-height: 1;
}

.metric-value.positive {
    color: var(--success);
}

.metric-value.negative {
    color: var(--error);
}

.metric-detail {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
}

/* ============================================
   CHART CARDS
   ============================================ */
.chart-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(247, 147, 30, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    min-height: 400px;
    position: relative;
}

.chart-card canvas {
    max-height: 500px;
}

/* ============================================
   HEATMAP DE CORRELACIONES
   ============================================ */
.heatmap-grid {
    display: grid;
    gap: 4px;
    font-size: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Matriz 3x3 (para sectores separados) */
.heatmap-grid[data-size="3"] {
    grid-template-columns: 120px repeat(3, 1fr);
}

/* Matriz 6x6 (para vista completa) */
.heatmap-grid[data-size="6"] {
    grid-template-columns: 120px repeat(6, 1fr);
}

.heatmap-cell {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #1a1a2e;
    border-radius: 4px;
    transition: transform 0.2s;
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.heatmap-header,
.heatmap-row-label {
    font-weight: 600;
    color: var(--body-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-align: center;
    padding: 8px;
}

.heatmap-header {
    background: rgba(247, 147, 30, 0.1);
    border-radius: 4px;
}

.heatmap-row-label {
    background: rgba(247, 147, 30, 0.05);
    border-radius: 4px;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   ERROR MESSAGE
   ============================================ */
.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--body-text);
}

.error-message p {
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-lg);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-base);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(247, 147, 30, 0.4);
}

/* ============================================
   SECCIÓN DE INTRODUCCIÓN
   ============================================ */
.intro-section {
    margin-bottom: var(--spacing-3xl);
}

.intro-card {
    background: linear-gradient(135deg,
                rgba(247, 147, 30, 0.1) 0%,
                rgba(199, 91, 18, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(247, 147, 30, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
}

.intro-title {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.intro-content p {
    font-size: var(--font-size-lg);
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
}

.intro-content .highlight {
    color: var(--secondary);
    font-weight: 700;
}

.intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.intro-item {
    background: rgba(26, 26, 46, 0.4);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(247, 147, 30, 0.1);
}

.intro-item h3 {
    font-size: var(--font-size-xl);
    color: var(--secondary-light);
    margin-bottom: var(--spacing-sm);
}

.intro-item p {
    font-size: var(--font-size-base);
    color: var(--body-text);
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   SECCIÓN DE EMPRESAS
   ============================================ */
.empresas-section {
    margin-bottom: var(--spacing-3xl);
}

.empresas-disclaimer {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    color: var(--body-text);
    font-size: var(--font-size-sm);
}

.empresas-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3xl);
}

/* Bloque de cada sector (BANCA o ENERGÍA) */
.empresas-bloque-sector {
    background: linear-gradient(135deg,
                rgba(247, 147, 30, 0.08) 0%,
                rgba(199, 91, 18, 0.03) 100%);
    border: 2px solid rgba(247, 147, 30, 0.25);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
}

.empresas-bloque-titulo {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid rgba(247, 147, 30, 0.2);
}

/* Grid de los 3 mercados dentro de cada sector */
.empresas-mercados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.empresas-mercado {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid rgba(247, 147, 30, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.empresas-mercado-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--body-text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(247, 147, 30, 0.15);
}

.empresas-lista {
    font-size: var(--font-size-sm);
    color: var(--body-text);
    line-height: 1.8;
    margin-top: var(--spacing-sm);
}

.empresas-lista-item {
    padding: 0.25rem 0;
}

.ticker {
    color: #f7931e;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

/* ============================================
   CHART INFO (Explicaciones debajo de gráficos)
   ============================================ */
.chart-info {
    background: rgba(247, 147, 30, 0.05);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.chart-info p {
    margin: 0;
    color: var(--body-text);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.chart-info strong {
    color: var(--secondary);
}

/* ============================================
   SELECTOR DE PERÍODO
   ============================================ */
.periodo-selector {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.btn-periodo {
    background: rgba(26, 26, 46, 0.6);
    border: 2px solid rgba(247, 147, 30, 0.3);
    color: var(--body-text);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-periodo:hover {
    background: rgba(247, 147, 30, 0.1);
    border-color: rgba(247, 147, 30, 0.5);
    transform: translateY(-2px);
}

.btn-periodo.active {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--primary);
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(247, 147, 30, 0.3);
}

.btn-periodo.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(247, 147, 30, 0.4);
}

/* ============================================
   SECCIÓN DE HORARIOS
   ============================================ */
.horarios-section {
    margin-bottom: var(--spacing-3xl);
}

.horarios-card {
    background: rgba(26, 26, 46, 0.4);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
}

.horarios-intro {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-lg);
    background: rgba(247, 147, 30, 0.05);
    border-radius: var(--radius-md);
}

.horarios-intro p {
    margin: 0;
    color: var(--body-text);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.horario-mercado {
    background: rgba(18, 18, 31, 0.6);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.horario-mercado:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.horario-header {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.horario-header.china {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2), rgba(255, 71, 87, 0.05));
    border-bottom-color: rgba(255, 71, 87, 0.3);
}

.horario-header.espana {
    background: linear-gradient(135deg, rgba(247, 147, 30, 0.2), rgba(247, 147, 30, 0.05));
    border-bottom-color: rgba(247, 147, 30, 0.3);
}

.horario-header.eeuu {
    background: linear-gradient(135deg, rgba(42, 82, 152, 0.2), rgba(42, 82, 152, 0.05));
    border-bottom-color: rgba(42, 82, 152, 0.3);
}

.horario-icon {
    font-size: 2rem;
}

.horario-header h3 {
    margin: 0;
    color: var(--heading-text);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.horario-body {
    padding: var(--spacing-xl);
}

.horario-tiempo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.horario-tiempo:last-of-type {
    border-bottom: none;
    margin-bottom: var(--spacing-lg);
}

.horario-label {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.horario-valor {
    color: var(--secondary);
    font-size: var(--font-size-xl);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.horario-nota {
    background: rgba(247, 147, 30, 0.05);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--body-text);
}

.horario-nota strong {
    color: var(--secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.horarios-conclusion {
    background: rgba(247, 147, 30, 0.1);
    border: 2px solid rgba(247, 147, 30, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
}

.horarios-conclusion h4 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--secondary);
    font-size: var(--font-size-xl);
}

.horarios-conclusion p {
    margin: 0;
    color: var(--body-text);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.horarios-conclusion strong {
    color: var(--heading-text);
    font-weight: 700;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .dragonauto-title {
        font-size: var(--font-size-2xl);
    }

    .dragon-icon {
        font-size: var(--font-size-2xl);
    }

    .subtitle {
        font-size: var(--font-size-base);
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: var(--spacing-lg);
    }

    .metric-icon {
        font-size: 2rem;
    }

    .metric-value {
        font-size: var(--font-size-2xl);
    }

    .chart-card {
        padding: var(--spacing-md);
        min-height: 300px;
    }

    .chart-card canvas {
        max-height: 350px;
    }

    .heatmap-grid {
        grid-template-columns: 100px repeat(6, minmax(60px, 1fr));
        font-size: 0.65rem;
    }

    .heatmap-cell {
        padding: 8px 4px;
    }

    .horarios-grid {
        grid-template-columns: 1fr;
    }

    .horarios-card {
        padding: var(--spacing-lg);
    }

    .horario-valor {
        font-size: var(--font-size-lg);
    }
}

@media (min-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dragonauto-main {
        padding: var(--spacing-3xl) 0;
    }
}

@media (min-width: 1280px) {
    .section-title {
        font-size: var(--font-size-3xl);
    }
}

/* ============================================
   TABLA DE DESGLOSE
   ============================================ */

.bloque-tabla {
    margin-bottom: 2rem;
}

.tabla-bloque-titulo {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(247, 147, 30, 0.1);
    border-radius: var(--radius-md);
}

.chart-bloque-container {
    background: rgba(26, 26, 46, 0.4);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: 300px;
}

.chart-bloque-container canvas {
    height: 100% !important;
}

.tabla-desglose-wrapper {
    border-radius: var(--radius-lg);
    background: rgba(26, 26, 46, 0.4);
    padding: 1.5rem;
    position: relative;
}

.tabla-desglose {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    table-layout: fixed;
}

.tabla-desglose thead {
    background: rgba(247, 147, 30, 0.1);
}

.tabla-header-mercado {
    text-align: left;
    padding: 1.25rem 1.5rem;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(247, 147, 30, 0.3);
    background: rgba(26, 26, 46, 0.95);
}

.tabla-header-fecha {
    text-align: center;
    padding: 1rem;
    color: #d8d8d8;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid rgba(247, 147, 30, 0.3);
    cursor: help;
}

.tabla-mercado {
    padding: 1.25rem 1.5rem;
    background: rgba(26, 26, 46, 0.95);
    color: #d8d8d8;
    font-size: 1rem;
    font-weight: 600;
    border-right: 2px solid rgba(247, 147, 30, 0.3);
}

.tabla-celda {
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: help;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tabla-celda:hover {
    background: rgba(247, 147, 30, 0.15);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(247, 147, 30, 0.3);
}

.tabla-celda.positivo {
    color: var(--success);
}

.tabla-celda.negativo {
    color: var(--error);
}

/* Tooltip flotante */
.tabla-tooltip {
    position: absolute;
    z-index: 10000;
    background: rgba(26, 26, 46, 0.98);
    border: 2px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 280px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.tabla-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-header {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: var(--primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.875rem;
}

.tooltip-body {
    padding: 0.75rem 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.tooltip-empresa {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
}

.tooltip-empresa:last-child {
    border-bottom: none;
}

.tooltip-nombre {
    color: #9ca3af;
    flex: 1;
}

.tooltip-valor {
    font-weight: 600;
    margin-left: 1rem;
}

.tooltip-valor.positivo {
    color: var(--success);
}

.tooltip-valor.negativo {
    color: var(--error);
}

.tooltip-footer {
    background: rgba(247, 147, 30, 0.1);
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(247, 147, 30, 0.3);
    text-align: center;
    color: #d8d8d8;
    font-size: 0.875rem;
}

.tooltip-footer strong {
    font-size: 1rem;
}

/* Botón Ver más */
.btn-ver-mas-container {
    text-align: center;
    margin: 2rem 0;
}

.btn-ver-mas {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(247, 147, 30, 0.3);
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-ver-mas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(247, 147, 30, 0.5);
}

.btn-ver-mas:active {
    transform: translateY(0);
}

/* Responsive tabla */
@media (max-width: 768px) {
    .tabla-desglose-wrapper {
        overflow-x: auto;
        padding: 1rem;
    }

    .tabla-desglose {
        font-size: 0.85rem;
    }

    .tabla-header-mercado {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .tabla-header-fecha {
        padding: 1rem 0.5rem;
        font-size: 0.75rem;
    }

    .tabla-mercado {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .tabla-celda {
        padding: 1rem 0.5rem;
        font-size: 0.95rem;
    }

    .tabla-tooltip {
        min-width: 240px;
    }

    .btn-ver-mas {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   SECCIÓN SÍMBOLOS DE EMPRESAS
   ======================================== */

.simbolos-section {
    margin: 3rem 0;
}

.mercado-simbolos {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(247, 147, 30, 0.1);
}

.mercado-simbolos h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.mercado-simbolos.china h3 {
    color: #ff4757;
}

.mercado-simbolos.eeuu h3 {
    color: #5352ed;
}

.mercado-simbolos.espana h3 {
    color: #f7931e;
}

.empresas-simbolos {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.empresa-simbolo {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    transition: all 0.3s ease;
}

.empresa-simbolo:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #ffa500;
    transform: translateX(4px);
}

.empresa-simbolo .ticker {
    font-weight: 700;
    color: #f7931e;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    display: inline-block;
}

.empresa-simbolo .nombre {
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.5rem;
    display: inline-block;
}

.empresa-simbolo .descripcion {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive para símbolos */
@media (min-width: 768px) {
    .empresas-simbolos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .empresas-simbolos {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .empresa-simbolo {
        padding: 1.25rem;
    }
}

/* ========================================
   PESTAÑAS DE EMPRESAS (TABS)
   ======================================== */

.empresas-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(247, 147, 30, 0.1);
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: var(--primary);
    background: rgba(247, 147, 30, 0.1);
}

.tab-count {
    font-size: 0.875rem;
    color: #d1d5db;
    font-weight: 400;
}

.tab-btn.active .tab-count {
    color: #fbbf24;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Pestañas para sección de símbolos */
.tab-content-simbolos {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content-simbolos.active {
    display: block;
}

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

.empresas-mercado-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mercado-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: auto;
}

.empresas-lista-tabs {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.empresa-item-tab {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.empresa-item-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
    border-left-color: #ffa500;
}

.ticker-highlight {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    min-width: 80px;
}

.nombre-empresa {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

/* Responsive para pestañas */
@media (max-width: 768px) {
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .empresas-mercado-header h3 {
        font-size: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .mercado-subtitle {
        margin-left: 0;
    }

    .empresa-item-tab {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ticker-highlight {
        min-width: auto;
    }
}

/* ============================================
   ENERGY REGION CARDS (Top 15 Energía)
   ============================================ */
.energy-region-card:hover {
    border-color: var(--secondary) !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(247, 147, 30, 0.3);
}

.energy-region-card:active {
    transform: translateY(-2px);
}
