/* ============================================================ */
/* TRADING 610 - LATAM TRACK                                    */
/* Custom Styles: Glassmorphism, Animations, Dark Mode           */
/* ============================================================ */

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

html, body {
    background-color: #0B0E14;
    color: #e2e8f0;
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === SCROLLBAR DARK === */
.scrollbar-dark::-webkit-scrollbar {
    width: 5px;
}

.scrollbar-dark::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-dark::-webkit-scrollbar-thumb {
    background: #1E293B;
    border-radius: 10px;
}

.scrollbar-dark::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Firefox */
.scrollbar-dark {
    scrollbar-width: thin;
    scrollbar-color: #1E293B transparent;
}

/* === HEADER GLASS === */
.header-glass {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* === NAV BUTTONS (Header) === */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-btn.active {
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

/* === GLASS CARD === */
.glass-card {
    background: rgba(18, 24, 36, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(30, 41, 59, 0.5);
    border-radius: 14px;
    transition: all 0.25s ease;
}

.glass-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.04);
}

/* === ASSET CARD (Sidebar) === */
.asset-card {
    padding: 12px;
    border-radius: 12px;
    background: rgba(18, 24, 36, 0.4);
    border: 1px solid rgba(30, 41, 59, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.asset-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: all 0.3s ease;
}

.asset-card:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(2px);
}

.asset-card.active {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.08), inset 0 0 30px rgba(59, 130, 246, 0.03);
}

.asset-card.active::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(139, 92, 246, 0.2));
}

/* === SPARKLINE === */
.sparkline-svg {
    width: 100%;
    height: 100%;
}

.sparkline-line {
    fill: none;
    stroke: #10B981;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
}

.sparkline-line.sparkline-down {
    stroke: #EF4444;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.3));
}

/* === TACTICAL BUTTONS === */
.tactical-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tactical-btn:hover {
    color: #e2e8f0;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.tactical-btn.active {
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

/* === CHART TIMEFRAME BUTTONS === */
.chart-tf-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', monospace;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chart-tf-btn:hover {
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.5);
}

.chart-tf-btn.active {
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
}

/* === CHART PLACEHOLDER === */
.chart-placeholder {
    background: linear-gradient(180deg, rgba(18, 24, 36, 0.8) 0%, rgba(11, 14, 20, 1) 100%);
    min-height: 280px;
}

.chart-placeholder canvas {
    display: block;
}

/* === NEWS ITEM === */
.news-item {
    padding: 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(30, 41, 59, 0.3);
    transition: all 0.2s ease;
}

.news-item:hover {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(59, 130, 246, 0.15);
}

/* === NOTE CARD (Bitácora) === */
.note-card {
    padding: 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(30, 41, 59, 0.4);
    transition: all 0.2s ease;
}

.note-card:hover {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* === ANIMATIONS === */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
    }
    50% {
        box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
    }
}

.asset-card.active {
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.asset-card {
    animation: slide-in-left 0.3s ease forwards;
}

.asset-card:nth-child(1) { animation-delay: 0.05s; }
.asset-card:nth-child(2) { animation-delay: 0.10s; }
.asset-card:nth-child(3) { animation-delay: 0.15s; }

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    animation: fade-in-up 0.4s ease forwards;
}

.glass-card:nth-child(1) { animation-delay: 0.1s; }
.glass-card:nth-child(2) { animation-delay: 0.15s; }
.glass-card:nth-child(3) { animation-delay: 0.2s; }

@keyframes chart-draw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* === RESPONSIVE TWEAKS === */
@media (max-width: 1280px) {
    .tactical-btn span:not(.w-4) {
        display: none;
    }
}

@media (max-width: 1024px) {
    aside {
        width: 240px !important;
    }
}

/* === SELECTION HIGHLIGHT === */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* === FOCUS RING === */
button:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* === GRADIENT TEXT UTILITY === */
.text-gradient-blue {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === BADGE PULSE === */
.badge-live {
    position: relative;
}

.badge-live::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #EF4444;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(0.8); }
}

/* ============================================================ */
/* JOURNAL VIEW STYLES                                          */
/* ============================================================ */

/* === JOURNAL TABLE === */
#journal-view table {
    border-collapse: separate;
    border-spacing: 0;
}

#journal-view table th {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10;
}

#journal-view table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.3);
    vertical-align: top;
}

#journal-view table tr:hover td {
    background: rgba(30, 41, 59, 0.3);
}

/* === IMPACT BADGES === */
.impact-alto {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.impact-muy-alto {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    animation: impact-pulse 2s ease-in-out infinite;
}

.impact-medio {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.impact-bajo {
    color: #64748B;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
}

@keyframes impact-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
    50% { box-shadow: 0 0 8px 2px rgba(220, 38, 38, 0.15); }
}

/* === DIRECTION ARROWS === */
.dir-long {
    color: #10B981;
    font-weight: 700;
}

.dir-short {
    color: #EF4444;
    font-weight: 700;
}

.dir-neutral {
    color: #64748B;
    font-weight: 600;
}

/* === THESIS CARD === */
.thesis-card {
    padding: 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(30, 41, 59, 0.4);
    transition: all 0.2s ease;
}

.thesis-card:hover {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.thesis-card.thesis-long {
    border-left: 3px solid #10B981;
}

.thesis-card.thesis-short {
    border-left: 3px solid #EF4444;
}

/* === EVIDENCE ITEM === */
.evidence-item {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(30, 41, 59, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}

.evidence-item:hover {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(6, 182, 212, 0.2);
}

.evidence-strength {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.evidence-strength .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.3);
}

.evidence-strength .dot.filled {
    background: #06B6D4;
}

/* === POST-MARKET RESULT === */
.result-win {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.result-lose {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.result-breakeven {
    color: #64748B;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
}

/* === JOURNAL SELECT === */
#journal-day-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* === JOURNAL ANIMATIONS === */
@keyframes journal-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

#journal-content .glass-card {
    animation: journal-fade-in 0.4s ease forwards;
    opacity: 0;
}

#journal-content .glass-card:nth-child(1) { animation-delay: 0.05s; }
#journal-content .glass-card:nth-child(2) { animation-delay: 0.10s; }
#journal-content .glass-card:nth-child(3) { animation-delay: 0.15s; }
#journal-content .glass-card:nth-child(4) { animation-delay: 0.20s; }
#journal-content .glass-card:nth-child(5) { animation-delay: 0.25s; }
