/* Modern Geometric Color System & Variables */
:root {
    --bg-dark: #07090e;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-purple: #818cf8;
    --accent-cyan: #22d3ee;
    --green: #22c55e;
    --red: #f43f5e;
    --border-color: rgba(56, 189, 248, 0.15);
    --border-glow: rgba(56, 189, 248, 0.4);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Global Reset & Geometric Background Pattern */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    /* Cyber-grid geometric background pattern */
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 50%);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 1. Header & Navigation (High Contrast Tone) */
.navbar {
    background-color: #030509;
    background-image: 
        /* Subtle circuit/dot intersection grid */
        radial-gradient(rgba(56, 189, 248, 0.25) 1px, transparent 1px),
        /* Diagonal accent tech lines */
        linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, transparent 40%),
        /* Linear grid texture */
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 20px 20px, 100% 100%, 10px 10px, 10px 10px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
}

.brand-svg {
    width: 32px;
    height: 32px;
}

.brand-title {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.65rem;
    letter-spacing: 2.5px;
    color: var(--accent-cyan);
    font-weight: 700;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    position: relative;
    padding: 0.4rem 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent-blue);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

/* Mobile & Tablet Header Responsive Overrides */
@media (max-width: 850px) {
    .nav-container {
        flex-direction: column;
        align-items: center;
        padding: 0.6rem 1rem 0.4rem 1rem;
        gap: 0.6rem;
    }

    .brand-logo {
        margin-bottom: 0.1rem;
    }

    .nav-links {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.4rem;
        gap: 0.75rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }

    .nav-item {
        font-size: 0.825rem;
        padding: 0.35rem 0.6rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(56, 189, 248, 0.1);
        border-radius: 6px;
    }

    .nav-item.active {
        background: rgba(56, 189, 248, 0.12);
        border-color: rgba(56, 189, 248, 0.4);
    }

    .nav-item.active::after {
        display: none; /* Replaced with full background highlight on mobile */
    }
}

/* Ticker Tape Bar (High Contrast Tone) */
.ticker-tape {
    background: #010307;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    overflow: hidden;
    white-space: nowrap;
    padding: 0.6rem 0;
    font-size: 0.85rem;
}

.ticker-track {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 2.5rem;
    font-weight: 600;
}

.badge-up { color: var(--green); }
.badge-down { color: var(--red); }

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Containers & Geometric Glass Cards */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

.page-view { display: none; }
.page-view.active { display: block; }

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    border-color: var(--border-glow);
}

.hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.hero-card h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.hero-card p { color: var(--text-muted); }

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.news-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: #00b4d8;
}

.news-image-wrapper img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.news-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 8px;
}

.news-title {
    font-size: 1.05rem;
    color: #f8fafc;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-summary {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-link-btn {
    display: inline-block;
    color: #00b4d8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
}

.news-link-btn:hover {
    text-decoration: underline;
}

.card-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.bg-blue { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); }
.bg-purple { background: rgba(129, 140, 248, 0.15); color: var(--accent-purple); }
.bg-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }

/* Buttons & Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: #020617;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

/* 2. Short Term Stocks Section (Custom Contrast Styling) */
#page-short-term {
    padding-top: 0.5rem;
}

/* High-contrast Macro Summary Card */
#macro-summary-box {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
    border-left: 4px solid var(--accent-cyan);
    border-top: 1px solid rgba(34, 211, 238, 0.3);
    border-right: 1px solid rgba(34, 211, 238, 0.2);
    border-bottom: 1px solid rgba(34, 211, 238, 0.2);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
}

#macro-summary-box h3 {
    color: var(--accent-cyan);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

#macro-text-content {
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* High-contrast Upcoming Events Card */
#events-summary-box {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
    border-left: 4px solid var(--accent-purple);
    border-top: 1px solid rgba(129, 140, 248, 0.3);
    border-right: 1px solid rgba(129, 140, 248, 0.2);
    border-bottom: 1px solid rgba(129, 140, 248, 0.2);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
    margin-bottom: 1.5rem;
}

#events-summary-box h3 {
    color: var(--accent-purple);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.events-bullet-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.events-bullet-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.events-bullet-list li:hover {
    background: rgba(56, 189, 248, 0.05);
    border-left-color: var(--accent-cyan);
}

.events-bullet-list li i {
    margin-top: 0.2rem;
    font-size: 0.95rem;
}

/* High-contrast Cards for Top Performers Grid */
.top-performers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.top-performer-card {
    background: linear-gradient(145deg, rgba(17, 25, 40, 0.95) 0%, rgba(9, 14, 26, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.top-performer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

.top-performer-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.25);
}

.performer-rank {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.performer-rank span {
    color: var(--accent-blue);
}

.performer-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Tables */
.table-card { padding: 0; overflow: hidden; }
.table-header-bar {
    padding: 1.2rem 1.5rem;
    background: rgba(7, 9, 14, 0.6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; }

th {
    background: rgba(15, 23, 42, 0.9);
    color: var(--accent-blue);
    padding: 1rem;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
tr:hover { background-color: var(--bg-card-hover); }

/* Company Stock Logos & Headers */
.company-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.company-logo {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.symbol-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.symbol { font-size: 1.2rem; font-weight: 800; color: var(--accent-blue); }
.name { font-size: 0.8rem; color: var(--text-muted); display: block; }
.target-badge { background: rgba(34, 197, 94, 0.15); color: var(--green); padding: 0.3rem 0.6rem; border-radius: 4px; font-weight: 700; font-size: 0.8rem; }
.metric { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.85rem; }
.metric label { color: var(--text-muted); }

/* Creator Profile Card */
.about-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }

.creator-profile { text-align: center; }
.creator-avatar-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem auto;
    position: relative;
}

.creator-avatar-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px auto;
    background: rgba(0, 180, 216, 0.1);
    border: 2px solid var(--accent-cyan, #00b4d8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creator-icon {
    font-size: 2.2rem;
    color: var(--accent-cyan, #00b4d8);
}

.creator-profile h3 { font-size: 1.3rem; color: var(--text-main); margin-bottom: 0.2rem; }
.creator-title { font-size: 0.85rem; font-weight: 700; color: var(--accent-blue); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 1rem; }
.creator-bio { font-size: 0.9rem; color: var(--text-muted); text-align: left; margin-bottom: 1.5rem; }
.creator-interests h4 { font-size: 0.95rem; text-align: left; border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; margin-bottom: 0.8rem; }
.arch-list { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; }

.spinner-box { text-align: center; padding: 3rem; color: var(--text-muted); }
.spinner { font-size: 2rem; color: var(--accent-blue); margin-bottom: 0.5rem; }
.display-none { display: none !important; }

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

/* Market Technicals Styling */
.technicals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.index-card {
    background: linear-gradient(145deg, rgba(18, 24, 38, 0.85) 0%, rgba(9, 14, 26, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.index-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-blue);
}

.index-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.index-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.index-symbol {
    font-size: 0.8rem;
    color: var(--accent-blue);
    font-weight: 700;
}

.index-price-box {
    text-align: right;
}

.index-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-cyan);
}

.index-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tech-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1rem 0 0.5rem 0;
}

.tech-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.tech-metric {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.tech-label {
    color: var(--text-muted);
    font-weight: 500;
}

.tech-val {
    font-weight: 700;
    color: var(--text-main);
}

.macd-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
}

.macd-bullish {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.macd-bearish {
    background: rgba(244, 63, 94, 0.15);
    color: var(--red);
    border: 1px solid rgba(244, 63, 94, 0.3);
}