/* --- DISEÑO PREMIUM - ACTIVOS DIGUETI --- */

:root {
    --bg-primary: #0a0d14;
    --bg-secondary: #111520;
    --bg-glass: rgba(17, 21, 32, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    
    /* Sentimiento / Alerta Colors */
    --color-positive: #10b981;
    --color-negative: #ef4444;
    --color-insider-sell: #f97316;
    --color-insider-buy: #059669;
    --color-regulatory: #8b5cf6;
    --color-neutral: #6b7280;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* --- LAYOUT STRUCTURE --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-area h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.logo-area h1 span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-item {
    background: none;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-primary);
    background-color: rgba(59, 130, 246, 0.15);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.tracked-list-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 1rem;
}

.tracked-list-box h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.tracked-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-right: 0.25rem;
}

/* Tracked items styling inside sidebar */
.sidebar-asset-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-asset-link:hover {
    border-color: var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-asset-link .symbol {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
}

.sidebar-asset-link .name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-asset-link .price-info {
    text-align: right;
}

.sidebar-asset-link .price {
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-asset-link .change {
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    min-height: calc(100vh - 80px); /* Leave room for footer */
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    gap: 2rem;
}

.header-search {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.header-search input {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.7rem 1rem 0.7rem 2.7rem;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.header-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-positive);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Welcome Box */
.welcome-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 1.8rem 2rem;
    margin-bottom: 0.5rem;
}

.welcome-box h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.welcome-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 800px;
}

/* Sections */
.section {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Assets cards grid */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Cards styling */
.asset-card {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.asset-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title h4 {
    font-size: 1.15rem;
    font-weight: 700;
}

.card-title span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

.type-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
}

.type-badge.stock {
    background-color: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.type-badge.crypto {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fde047;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.price-box .price {
    font-size: 1.6rem;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.price-box .change {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.sparkline-box {
    width: 90px;
    height: 35px;
}

/* Green & Red status styles */
.text-up {
    color: var(--color-positive) !important;
}

.text-down {
    color: var(--color-negative) !important;
}

.badge-up {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--color-positive);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-down {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--color-negative);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dashboard double column */
.dashboard-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.col-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.col-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* News List Stream */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.news-card {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease;
}

.news-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.news-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-asset-tag {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
}

.news-asset-tag:hover {
    text-decoration: underline;
}

.news-source {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.news-card h4 {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.news-card h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-card h4 a:hover {
    color: var(--accent);
}

.news-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.8rem;
    margin-top: 0.4rem;
}

.sentiment-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sentiment-badge.positivo {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-positive);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sentiment-badge.negativo {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-negative);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sentiment-badge.neutral {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.sentiment-badge.insider_sell {
    background-color: rgba(249, 115, 22, 0.1);
    color: var(--color-insider-sell);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.sentiment-badge.insider_buy {
    background-color: rgba(5, 150, 105, 0.1);
    color: #34d399;
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.sentiment-badge.regulatory {
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--color-regulatory);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Post News Correlation styling */
.news-correlation-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
}

.correlation-metric {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.correlation-metric span {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.correlation-metric strong {
    font-size: 0.85rem;
}

/* Alerts Sidebar List */
.alerts-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-item {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-left: 4px solid var(--color-insider-sell);
    border-radius: var(--radius-sm);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.alert-item.regulatory-alert {
    border-left-color: var(--color-regulatory);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-color: rgba(139, 92, 246, 0.15);
}

.alert-item.negative-alert {
    border-left-color: var(--color-negative);
}

.alert-item.positive-alert {
    border-left-color: var(--color-positive);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-color: rgba(16, 185, 129, 0.15);
}

.alert-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.alert-item-header strong {
    color: var(--text-primary);
}

.alert-item h5 {
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.alert-item h5 a {
    color: inherit;
    text-decoration: none;
}

.alert-item h5 a:hover {
    text-decoration: underline;
}

.alert-item-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Detail view styling */
.back-nav {
    margin-bottom: 0.5rem;
}

.detail-header-card {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.detail-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.detail-icon-circle {
    width: 60px;
    height: 60px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.detail-title-info h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.detail-title-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.detail-header-right {
    text-align: right;
}

.detail-header-right .price {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -1px;
}

.detail-header-right .change {
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

/* Chart block */
.chart-container-box {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    backdrop-filter: blur(10px);
    width: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

.chart-header h3 {
    font-size: 1.3rem;
}

.chart-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.canvas-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Admin/Config View */
.config-container {
    max-width: 900px;
}

.config-container h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.config-container p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.config-card {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.config-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input, .form-group select {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent);
}

.field-help {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.system-status-box {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.status-row span {
    color: var(--text-secondary);
}

.status-row strong, .status-row code {
    color: var(--text-primary);
}

.status-row code {
    background-color: rgba(255,255,255,0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Button Classes */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.2);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
}

.btn-text:hover {
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Ecosistema Interconnected Footer */
.digueti-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    margin-left: 280px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-family: var(--font-heading);
    font-weight: 500;
    transition: color 0.25s ease;
    position: relative;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-links a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 1.5px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.25s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-tagline strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Loading animations */
.loading-small {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .app-container {
        flex-direction: column;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .digueti-footer {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-search {
        max-width: 100%;
    }
}
