/* ==============================================================
   STOCK SURGE DASHBOARD – FINAL STYLE.CSS
   High-contrast | Readable | Premium Cards | AI Modern
   ============================================================== */
/* -------------------------------------------------
   1. GLOBAL & TYPOGRAPHY
   ------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html { font-size: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}
body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}
/* -------------------------------------------------
   2. LAYOUT GRID
   ------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
/* -------------------------------------------------
   3. HEADER
   ------------------------------------------------- */
header {
    background: linear-gradient(135deg, #0EA5E9, #1E3A8A);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.header-top h1 {
    font-size: 1.75rem;
    font-weight: 700;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}
.header-info {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}
.market-status-wrapper { display: flex; align-items: center; gap: 0.4rem; }
.market-status {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}
.market-open { background: #22c55e; color: #fff; }
.market-closed { background: #ef4444; color: #fff; }
.ticker-wrapper-inline {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem
}
.ticker-arrow svg { width: 1.2rem; height: 1.2rem; opacity: 0.7; }
#live-tickers {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ticker-track {
    display: inline-flex;
    white-space: nowrap;
}

.ticker-animate {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 40s linear infinite;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.ticker-content { white-space: nowrap; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: 1.5rem;
    font-size: 0.9rem;
}
.ticker-item .symbol { font-weight: 600; text-align: left;}
.ticker-item .price { font-weight: 500; }
.ticker-item .change { font-weight: 600; }
.positive { color: #22c55e; }
.negative { color: #ef4444; }
.glow { text-shadow: 0 0 6px currentColor; }
.market-closed-notice {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.9;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.25);
    color: white;
}
.market-closed-notice .icon { font-weight: bold; }
/* -------------------------------------------------
   4. PANELS
   ------------------------------------------------- */
.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.surge-panel {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}
body.dark-mode .surge-panel {
    background: #1e293b;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
/* -------------------------------------------------
   5. SECTION HEADERS
   ------------------------------------------------- */
.surge-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1e293b;
}
body.dark-mode .surge-header h2 { color: #e2e8f0; }
.surge-header em { font-size: 0.85rem; opacity: 0.8; }
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}
.section-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center;
    width: 100%;
}

/* Right box should align items to the right edge */
.section-header .header-right {
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Keep both buttons tight & aligned to the right */
.section-header .header-right .watchlist-top-btn {
    margin-left: 0 !important;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
/* -------------------------------------------------
   6. BUTTONS
   ------------------------------------------------- */
.btn {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }
.btn-outline {
    border: 1px solid #cbd5e1;
    color: #475569;
    background: #fff;
}
.btn-outline:hover { background: #f1f5f9; }
body.dark-mode .btn-outline { border-color: #475569; background: #1e293b; color: #cbd5e1; }
body.dark-mode .btn-outline:hover { background: #334155; }
/* -------------------------------------------------
   7. TABLES – HIGH CONTRAST + READABLE
   ------------------------------------------------- */
.surge-panel table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 0.925rem;
}
.surge-panel th {
    background: linear-gradient(180deg, #adadad 0%, #919295 100%);
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.7rem;
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 0.8rem;
    text-align: right;
}
.surge-panel th:first-child {border-top-left-radius: 10px;text-align: left! Important;}
.surge-panel th:last-child { border-top-right-radius: 10px; }
.surge-panel tr {
    background: #ffffff;
    transition: all 0.22s ease;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.surge-panel tr:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.surge-panel td {
    padding: 1rem 0.7rem;
    color: #1e293b;
    font-weight: 500;
    text-align: right;
}
.surge-panel td.numeric {
    font-variant-numeric: tabular-nums;
    color: #475569;
    text-align: right;
}
/* Dark mode table */
body.dark-mode .surge-panel tr {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
body.dark-mode .surge-panel tr:hover {
    background: #334155;
}
body.dark-mode .surge-panel td {
    color: #e2e8f0;
}
body.dark-mode .surge-panel td.numeric { color: #cbd5e1; }
/* Highlight row */
.surge-panel tr.highlight {
    background: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 100%);
    border-left: 5px solid #22c55e;
}
.surge-panel tr.highlight:hover {
    background: linear-gradient(90deg, #bbf7d0 0%, #dcfce7 100%);
}
body.dark-mode .surge-panel tr.highlight {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-left: 5px solid #22c55e;
}
body.dark-mode .surge-panel tr.highlight:hover {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
}
/* No-data */
.surge-panel .no-data {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 1.5rem 0;
}
/* -------------------------------------------------
   8. PILL BADGES – CRISP & VIBRANT
   ------------------------------------------------- */
.pill {
    display: inline-block;
    min-width: 2.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
}
.pill.confidence.high {background: #10b981;text-align: center;width: 80px;}
.pill.confidence.medium {background: #f59e0b;max-width: 2.4r;}
.pill.confidence.low {background: #ef4444;text-align: center;width: 80px;}
.pill.sentiment.positive { background: #22c55e; text-align: center; }
.pill.sentiment.negative { background: #ef4444; text-align: center; }
.pill.sentiment.neutral {background: #94a3b8;text-align: center;/* width: 80px; */}
.pill.trade.buy { background: #22c55e; text-align: center; }
.pill.trade.sell { background: #ef4444; text-align: center; }
.pill.trade.hold {background: #64748b;text-align: center;/* width: 80px; */}
/* -------------------------------------------------
   9. CARD VIEW – PREMIUM AI CARDS
   ------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.stock-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.25s ease;
    cursor: pointer;
}
.stock-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}
body.dark-mode .stock-card {
    background: #1e293b;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
body.dark-mode .stock-card:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}
.stock-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.stock-card .symbol {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}
body.dark-mode .stock-card .symbol { color: #e2e8f0; }
.stock-card .price-current {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}
body.dark-mode .stock-card .price-current { color: #e2e8f0; }
.stock-card .price-change {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.stock-card .jump { font-weight: 600; }
.stock-card .profit-tag {
    background: #22c55e;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
}
.stock-card .mini-chart {
    height: 50px;
    margin: 0.75rem 0;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}
body.dark-mode .stock-card .mini-chart { background: #334155; }
.stock-card .card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
}
body.dark-mode .stock-card .card-footer { color: #94a3b8; }
/* -------------------------------------------------
   10. NEWS – ULTRA READABLE, PREMIUM, MODERN
   ------------------------------------------------- */
.right-panel h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    letter-spacing: -0.02em;
}
body.dark-mode .right-panel h3 {
    color: #f1f5f9;
}
/* -------------------------------------------------
   FIXED RIGHT PANEL + SCROLLABLE NEWS FEED
   ------------------------------------------------- */

/* Give the right panel a controlled height */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: calc(100vh - 140px); /* Entire screen minus header/footer */
    overflow: hidden; /* Prevent it from stretching downward */
}

/* Make only the news feed scroll */
#news-feed {
    flex: 1;                        /* Take all remaining space */
    overflow-y: auto !important;    /* Always scroll internally */
    padding-right: 8px;
    scrollbar-width: thin;
    max-height: unset !important;   /* Remove the conflicting 100% rule */
}

/* Better scrollbars */
#news-feed::-webkit-scrollbar {
    width: 6px;
}
#news-feed::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
body.dark-mode #news-feed::-webkit-scrollbar-thumb {
    background: #475569;
}
body.dark-mode #news-feed::-webkit-scrollbar-thumb {
    background: #475569;
}
.news-item {
    background: #efefd7;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    gap: 1rem;
    padding: 1.1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.25s ease;
}
.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    border-color: rgba(59, 130, 246, 0.2);
}
body.dark-mode .news-item {
    background: #1e293b;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
body.dark-mode .news-item:hover {
    border-color: rgba(96, 165, 250, 0.3);
}
.news-image {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f1f5f9;
}
body.dark-mode .news-image { background: #334155; }
.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.news-title {
    margin-bottom: 0.4rem;
}
.news-title a {
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.38;
    color: #1e293b;
    text-decoration: none;
    display: block;
    letter-spacing: -0.01em;
}
body.dark-mode .news-title a {
    color: #f1f5f9;
}
.news-title a:hover {
    color: #1e40af;
    text-decoration: underline;
}
body.dark-mode .news-title a:hover {
    color: #60a5fa;
}
.news-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
body.dark-mode .news-meta {
    color: #94a3b8;
}
.news-summary {
    font-size: 0.89rem;
    line-height: 1.5;
    color: #475569;
    margin-top: 0.3rem;
}
body.dark-mode .news-summary {
    color: #cbd5e1;
}
.top-profit-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    margin-left: 0.6rem;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* -------------------------------------------------
   11. WISHLIST
   ------------------------------------------------- */
.wishlist-panel {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
body.dark-mode .wishlist-panel { background: #1e293b; }
.wishlist-input-wrapper {
    display: flex;
    gap: 0.5rem;
}
#ticker-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
}
body.dark-mode #ticker-input { border-color: #475569; background: #334155; color: #e2e8f0; }
#add-ticker-btn {
    background: #1e40af;
    color: #fff;
    border: none;
    padding: 0 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
#add-ticker-btn:hover { background: #1e3a8a; }
/* -------------------------------------------------
   12. FOOTER
   ------------------------------------------------- */
footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}
footer a { color: #5a95fb; text-decoration: none; }
/* -------------------------------------------------
   13. UTILITIES
   ------------------------------------------------- */
.clickable-stock { cursor: pointer; }
.selected-stock {
    background: #dbeafe !important;
    border-left: 5px solid #3b82f6 !important;
}
body.dark-mode .selected-stock {
    background: #1e40af !important;
}

/* -------------------------------------------------
   14. RIGHT-ALIGN NUMERIC COLUMNS + BADGE COLUMNS
   ------------------------------------------------- */
/* Right-align all numeric values */
.surge-panel td[data-label="Last"],
.surge-panel td[data-label="Current"],
.surge-panel td[data-label="Expected"],
.surge-panel td[data-label="Jump (%)"],
.surge-panel td[data-label="Profit ($)"] {
    text-align: right;
}

/* Right-align badge columns + fixed width */
.surge-panel td[data-label="AI Conf."],
.surge-panel td[data-label="Sentiment"],
.surge-panel td[data-label="Trade"] {
    text-align: right;
    width: 5.5rem; /* Matches width of widest pill (e.g. "Bullish") */
}

/* Push pills to the right within fixed-width cells */
.surge-panel td[data-label="AI Conf."] .pill,
.surge-panel td[data-label="Sentiment"] .pill,
.surge-panel td[data-label="Trade"] .pill {
    display: inline-block;
    margin-left: auto;
}

/* ==================== AI TRADE PLAN MODAL ==================== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal.active {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 420px;
    min-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    overflow: hidden;
    animation: modalPop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body.dark-mode .modal-content { background: #1e293b; border: 1px solid #334155; }

@keyframes modalPop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    padding: 1.2rem 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { margin: 0; font-size: 1.6rem; }
.modal-close { font-size: 2.2rem; cursor: pointer; opacity: 0.8; }
.modal-close:hover { opacity: 1; }

.modal-body { padding: 1.6rem; min-width: 50%;}
.modal-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.modal-table td {
    padding: 0.7rem 0;
    border-bottom: 1px solid #e2e8f0;
}
body.dark-mode .modal-table td { border-color: #334155; }
.modal-table td:first-child { color: #64748b; font-weight: 500; width: 55%; }
body.dark-mode .modal-table td:first-child { color: #94a3b8; }
.modal-table td:last-child { text-align: right; font-weight: 600; }
.modal-table tr:last-child td { border: none; }
.positive {/* color: #22c55e !important; */}

.modal-note {
    margin-top: 1.2rem;
    font-size: 0.88rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
}
body.dark-mode .modal-note { color: #94a3b8; }

.modal-footer {
    padding: 1rem 1.6rem;
    text-align: right;
    background: #f8fafc;
}
body.dark-mode .modal-footer { background: #0f172a; }

/* Symbol clickable hint */
.clickable-symbol { position: relative; }
.clickable-symbol:hover { text-decoration: underline; color: #1e40af; }
body.dark-mode .clickable-symbol:hover { color: #60a5fa; }

/* -------------------------------------------------
   END OF FILE
   ------------------------------------------------- */


/* ================= SYMBOL COLUMN LEFT ALIGN FIX ================= */
.surge-panel td.clickable-symbol {
    text-align: left !important;
}

.surge-panel td:first-child {
    text-align: left !important;
}
/* ================================================================= */
/* ====================== USER AVATAR + DROPDOWN ======================= */

.header-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Avatar circle */
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    transition: 0.2s;
}

.user-avatar:hover {
    transform: scale(1.06);
}

/* Dropdown menu */
.user-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 210px;
    /* padding: 0.5rem 0; */
    display: none;
    flex-direction: column;
    z-index: 2000;
}

body.dark-mode .user-menu {
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* menu items */
.user-menu .menu-item {
    background: none;
    border: none;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.92rem;
    cursor: pointer;
    color: #1e293b;
    text-decoration: none;
}

body.dark-mode .user-menu .menu-item {
    color: #e2e8f0;
}

.user-menu .menu-item:hover {
    background: #f1f5f9;
}

body.dark-mode .user-menu .menu-item:hover {
    background: #334155;
}

.user-menu .logout {
    /* color: #ef4444 !important; */
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid;
}
/* ============================
   PROFILE BADGE + DROPDOWN
   ============================ */

.profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-circle {
    width: 36px;
    height: 36px;
    background: #1e3a8a;
    color: white;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    border: 2px solid rgba(255,255,255,0.4);
    transition: 0.2s;
}

.profile-circle:hover {
    background: #3b82f6;
}

#profile-dropdown {
    position: absolute;
    top: 46px;
    right: 0;
    background: white;
    border-radius: 10px;
    min-width: 180px;
    padding: 0.5rem 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    z-index: 9999;
    display: none;
}

body.dark-mode #profile-dropdown {
    background: #1e293b;
    border: 1px solid #475569;
}

#profile-dropdown.show {
    display: block;
}

.profile-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    transition: 0.15s;
}

.profile-item:hover {
    background: #f1f5f9;
}

body.dark-mode .profile-item {
    color: #e2e8f0;
}

body.dark-mode .profile-item:hover {
    background: #334155;
}

/* Divider */
.profile-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.4rem 0;
}

body.dark-mode .profile-divider {
    background: #475569;
}

/* HEADER TITLE */
.header-title h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

/* WELCOME TEXT */
.welcome-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    margin-right: 0.75rem;
    white-space: nowrap;
}

/* AVATAR FIX */
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    transition: 0.2s;
}

.user-avatar:hover {
    transform: scale(1.06);
}

/* DROPDOWN FIX */
.user-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: white;
    border-radius: 12px;
    width: 210px;
    display: none;
    flex-direction: column;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    z-index: 2000;
}

body.dark-mode .user-menu {
    background: #1e293b;
    box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}

.menu-item {
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    border: none;
    background: none;
    width: 100%;
}

.menu-item:hover {
    background: #f1f5f9;
}
body.dark-mode .menu-item:hover {
    background: #334155;
}
/* ===========================================================
   ULTRA-CLEAN APPLE STYLE FOOTER
   ============================================================ */

/* ===========================================================
   ULTRA-CLEAN APPLE STYLE FOOTER (LEFT ALIGNED)
   ============================================================ */

body.dark-mode .footer-apple {
    background: #111827;
    border-color: #1f2937;
}

.footer-inner {
    max-width: 1250px;
    margin: auto;
    padding: 0 2rem;
}

/* --- LEFT aligned grid (Apple style) --- */
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2.5rem;
    text-align: left !important;
    justify-items: start !important;
}

.footer-group h4 {
    font-size: 12px;
    letter-spacing: 0.7px;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1d1d1f;
}

body.dark-mode .footer-group h4 {
    color: #e5e7eb;
}

.footer-group a {
    display: block;
    font-size: 13px;
    margin-bottom: 0.4rem;
    color: #4b5563;
    text-decoration: none;
}

.footer-group a:hover {
    color: #0066cc;
}

body.dark-mode .footer-group a {
    color: #cbd5e1;
}

/* --- Bottom legal row --- */
.footer-legal {
    border-top: 1px solid #d2d2d7;
    margin-top: 2rem;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    color: #6b7280;
    font-size: 12px;
    text-align: left !important;
}

body.dark-mode .footer-legal {
    border-color: #374151;
    color: #9ca3af;
}

.legal-links {
    display: flex;
    gap: 0.75rem;
}

.legal-links a {
    text-decoration: none;
    color: inherit;
}

.legal-links a:hover {
    text-decoration: underline;
}
/* FIX BROKEN TICKER — RESTORE FLEX + SCROLL */

.ticker-inline {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

/* ================================
   FIX TICKER SCROLL ANIMATION
================================= */

.ticker-wrapper {
    display: flex !important;
    flex-wrap: nowrap;
    animation: ticker-scroll 35s linear infinite !important;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* WATCHLIST TOP BUTTON — EXACTLY MATCHES YOUR DESIGN */
.watchlist-top-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;
}
.watchlist-top-btn:a {
    text-decoration: none;
}
.watchlist-top-btn:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.watchlist-top-btn .star-icon {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
    transition: transform 0.2s;
}

.watchlist-top-btn:hover .star-icon {
    transform: scale(1.15);
}

/* Dark mode version */
body.dark-mode .watchlist-top-btn {
    background: rgba(251, 191, 36, 0.18);
    border-color: #fbbf24;
    color: #fde68a !important;
}

body.dark-mode .watchlist-top-btn:hover {
    background: #fbbf24;
    color: #1e293b !important;
}
/* TOP HEADER BAR — TITLE LEFT + WATCHLIST RIGHT */
.top-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.top-header-bar h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 700;
  color: #1e293b;
}

.surge-timestamp {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  margin-left: 14px;
}

.last-updated {
  margin-top: 8px;
  font-size: 0.95rem;
  color: #475569;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .top-header-bar {
    padding: 18px 20px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .top-header-bar h1 {
    font-size: 1.8rem;
  }
}
/* ================================================
   RIGHT-ALIGNED INFO BOX — 500px PREMIUM VERSION
   ================================================ */
.right-aligned {
    margin-left: auto;
    width: 600px;                /* ⬅ NEW WIDTH */
    
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;

    display: flex;
    flex-direction: column;
    gap: 6px;

    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;

    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);

    text-align: left;          /* Right-align content */
    white-space: normal;        /* Multi-line support */
}

body.dark-mode .right-aligned {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.18);
}
.right-aligned.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* 2 equal columns */
    gap: 8px 16px;                    /* row-gap | column-gap */
}

.watchlist-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;
}
.watchlist-btn:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);    
}
.star-icon {
    width: 18px;
    height: 18px;
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: #fbbf24;
    fill: none;
    stroke-width: 2;
}

.icon-btn:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);     
}
.icon-btn-grrpahical-view {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;

}
.icon-btn-grrpahical-view svg {
    width: 22px;
    height: 22px;
    stroke: #fbbf24;
    fill: none;
    stroke-width: 2;
}

.icon-btn-grrpahical-view:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);    
}

.analytics-widget:hover, 
.user-credit-card:hover {
    transform: translateY(-6px) scale(1.02); /* subtle lift & scale */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35); /* elegant shadow */
    filter: brightness(1.05); /* slight brightness pop */
}

.user-credit-card {
    position: relative;
    max-width: 410px;
    background: linear-gradient(145deg, #0a1a2b, #113a5c, #0f172a);
    padding: 24px 24px 26px 24px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    backdrop-filter: blur(6px);
    transform: scale(0.98);"
}    
/* ===========================================
   MOBILE RESPONSIVENESS — GLOBAL OVERRIDES
   =========================================== */
/* ============================================================
   SURGEPULSE™ MOBILE UI v2 — App-Level Experience
   ZERO HTML Changes Needed
   ============================================================ */

/* ============================
   GLOBAL MOBILE OPTIMIZATIONS
   ============================ */
@media (max-width: 768px) {

    /* Reduce padding system-wide */
    body, .dashboard-grid, header {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Collapse grid fully */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 10px !important;
    }

    /* Cards/widgets become full-width */
    .analytics-widget,
    .surge-panel,
    .wishlist-panel,
    .news-item,
    .stock-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        margin: 0 auto !important;
    }

    /* Reduce all card shadows for mobile performance */
    .analytics-widget,
    .stock-card,
    .news-item {
        box-shadow: 0 6px 20px rgba(0,0,0,0.18) !important;
    }

    /* Prevent overlap issues on small screens */
    .left-panel, .right-panel {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* =======================================
   MOBILE HEADER — COMPACT WITH SCROLL
   ======================================= */
@media (max-width: 768px) {

    header {
        border-radius: 0 !important;
        padding: 16px 18px !important;
        position: sticky;
        top: 0;
        z-index: 999;
    }

    /* Compact header on scroll */
    header.shrink {
        padding: 10px 14px !important;
        backdrop-filter: blur(10px);
    }

    .header-top {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }

    .header-right {
        justify-content: center !important;
    }

    .right-aligned {
        width: 100% !important;
        padding: 12px !important;
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }
}

/* ==============================================
   MOBILE TABLE — SWIPEABLE & COMPACT MODE
   ============================================== */
@media (max-width: 768px) {

    .surge-panel table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        border-spacing: 0 !important;
        margin-top: 10px !important;
    }

    .surge-panel th,
    .surge-panel td {
        padding: 8px 12px !important;
        font-size: 0.82rem !important;
    }

    /* Keep header visible when scrolling */
    .surge-panel th {
        top: 0;
        position: sticky;
        background: #64748b !important;
    }
}

/* ======================================================
   COLLAPSIBLE RIGHT PANEL (NEWS / PROFILE)
   Auto-collapses into accordion-style panels.
   ====================================================== */
@media (max-width: 768px) {

    .right-panel {
        height: auto !important;
        overflow: hidden !important;
    }

    #news-feed {
        max-height: 260px !important;
        overflow-y: auto !important;
        padding-right: 6px;
    }
}

/* ======================================
   FLOATING ACTION BUTTON (WATCHLIST)
   ====================================== */
@media (max-width: 768px) {
    .fab-watchlist {
        position: fixed;
        bottom: 86px;
        right: 16px;
        background: #fbbf24;
        color: #1e293b;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        font-size: 1.8rem;
        font-weight: 900;
        line-height: 54px;
        text-align: center;
        z-index: 2000;
        box-shadow: 0 4px 18px rgba(0,0,0,0.28);
        cursor: pointer;
    }
}

/* ============================================
   STICKY BOTTOM NAV (TradingView / Robinhood)
   ============================================ */
@media (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 62px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 3000;
        box-shadow: 0 -1px 12px rgba(0,0,0,0.06);
    }

    body.dark-mode .mobile-nav {
        background: #1e293b;
        border-color: #475569;
    }

    .mobile-nav button {
        background: none;
        border: none;
        font-size: 0.85rem;
        color: #475569;
        text-align: center;
    }

    body.dark-mode .mobile-nav button {
        color: #cbd5e1;
    }
}

/* ======================================================
   ICON OPTIMIZATIONS — FIX STAR, BUTTONS, ALIGNMENT
   ====================================================== */
@media (max-width: 768px) {
    .watchlist-top-btn,
    .icon-btn,
    .icon-btn-grrpahical-view {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
        border-radius: 30px !important;
        gap: 6px !important;
    }

    .star-icon {
        width: 16px !important;
        height: 16px !important;
    }
}

/* ======================================================
   SMALL SCREEN ULTRA MODE (< 480px)
   ====================================================== */
@media (max-width: 480px) {

    header h1 {
        font-size: 1.3rem !important;
    }

    .analytics-widget {
        padding: 12px !important;
        font-size: 0.9rem !important;
    }

    /* Reduce heavy shadows for speed */
    .analytics-widget,
    .stock-card,
    .news-item {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }

    /* Compact profile dropdown */
    .profile-circle,
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    .surge-panel table {
        font-size: 0.75rem !important;
    }
}
.verified-badge {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.28);
}
/* ==============================================================
   STOCK SURGE DASHBOARD – FINAL STYLE.CSS
   High-contrast | Readable | Premium Cards | AI Modern
   ============================================================== */
/* -------------------------------------------------
   1. GLOBAL & TYPOGRAPHY
   ------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html { font-size: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}
body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}
/* -------------------------------------------------
   2. LAYOUT GRID
   ------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1600px;
    margin: 0 auto;
    min-width: 100%;
}
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
/* -------------------------------------------------
   3. HEADER
   ------------------------------------------------- */
header {
    background: linear-gradient(135deg, #0EA5E9, #1E3A8A);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.header-top h1 {
    font-size: 1.75rem;
    font-weight: 700;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}
.header-info {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}
.market-status-wrapper { display: flex; align-items: center; gap: 0.4rem; }
.market-status {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}
.market-open { background: #22c55e; color: #fff; }
.market-closed { background: #ef4444; color: #fff; }
.ticker-wrapper-inline {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem
}
.ticker-arrow svg { width: 1.2rem; height: 1.2rem; opacity: 0.7; }
#live-tickers {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ticker-track {
    display: inline-flex;
    white-space: nowrap;
}

.ticker-animate {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 40s linear infinite;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.ticker-content { white-space: nowrap; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: 1.5rem;
    font-size: 0.9rem;
}
.ticker-item .symbol { font-weight: 600; text-align: left;}
.ticker-item .price { font-weight: 500; }
.ticker-item .change { font-weight: 600; }
.positive { color: #22c55e; }
.negative { color: #ef4444; }
.glow { text-shadow: 0 0 6px currentColor; }
.market-closed-notice {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.9;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.25);
    color: white;
}
.market-closed-notice .icon { font-weight: bold; }
/* -------------------------------------------------
   4. PANELS
   ------------------------------------------------- */
.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.surge-panel {
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    min-width: 100%;
}
body.dark-mode .surge-panel {
    background: #1e293b;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
/* -------------------------------------------------
   5. SECTION HEADERS
   ------------------------------------------------- */
.surge-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1e293b;
}
body.dark-mode .surge-header h2 { color: #e2e8f0; }
.surge-header em { font-size: 0.85rem; opacity: 0.8; }
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}
.section-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center;
    width: 100%;
}

/* Right box should align items to the right edge */
.section-header .header-right {
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Keep both buttons tight & aligned to the right */
.section-header .header-right .watchlist-top-btn {
    margin-left: 0 !important;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
/* -------------------------------------------------
   6. BUTTONS
   ------------------------------------------------- */
.btn {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }
.btn-outline {
    border: 1px solid #cbd5e1;
    color: #475569;
    background: #fff;
}
.btn-outline:hover { background: #f1f5f9; }
body.dark-mode .btn-outline { border-color: #475569; background: #1e293b; color: #cbd5e1; }
body.dark-mode .btn-outline:hover { background: #334155; }
/* -------------------------------------------------
   7. TABLES – HIGH CONTRAST + READABLE
   ------------------------------------------------- */
.surge-panel table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 0.925rem;
}
.surge-panel th {
    background: linear-gradient(180deg, #adadad 0%, #919295 100%);
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.7rem;
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 0.8rem;
    text-align: right;
}
.surge-panel th:first-child {border-top-left-radius: 10px;text-align: left! Important;}
.surge-panel th:last-child { border-top-right-radius: 10px; }
.surge-panel tr {
    background: #ffffff;
    transition: all 0.22s ease;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.surge-panel tr:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.surge-panel td {
    padding: 1rem 0.7rem;
    color: #1e293b;
    font-weight: 500;
    text-align: right;
}
.surge-panel td.numeric {
    font-variant-numeric: tabular-nums;
    color: #475569;
    text-align: right;
}
/* Dark mode table */
body.dark-mode .surge-panel tr {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
body.dark-mode .surge-panel tr:hover {
    background: #334155;
}
body.dark-mode .surge-panel td {
    color: #e2e8f0;
}
body.dark-mode .surge-panel td.numeric { color: #cbd5e1; }
/* Highlight row */
.surge-panel tr.highlight {
    background: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 100%);
    border-left: 5px solid #22c55e;
}
.surge-panel tr.highlight:hover {
    background: linear-gradient(90deg, #bbf7d0 0%, #dcfce7 100%);
}
body.dark-mode .surge-panel tr.highlight {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-left: 5px solid #22c55e;
}
body.dark-mode .surge-panel tr.highlight:hover {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
}
/* No-data */
.surge-panel .no-data {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 1.5rem 0;
}
/* -------------------------------------------------
   8. PILL BADGES – CRISP & VIBRANT
   ------------------------------------------------- */
.pill {
    display: inline-block;
    min-width: 2.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
}
.pill.confidence.high {background: #10b981;text-align: center;width: 80px;}
.pill.confidence.medium {background: #f59e0b;max-width: 2.4r;}
.pill.confidence.low {background: #ef4444;text-align: center;width: 80px;}
.pill.sentiment.positive { background: #22c55e; text-align: center; }
.pill.sentiment.negative { background: #ef4444; text-align: center; }
.pill.sentiment.neutral {background: #94a3b8;text-align: center;/* width: 80px; */}
.pill.trade.buy { background: #22c55e; text-align: center; }
.pill.trade.sell { background: #ef4444; text-align: center; }
.pill.trade.hold {background: #64748b;text-align: center;/* width: 80px; */}
/* -------------------------------------------------
   9. CARD VIEW – PREMIUM AI CARDS
   ------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.stock-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.25s ease;
    cursor: pointer;
}
.stock-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}
body.dark-mode .stock-card {
    background: #1e293b;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
body.dark-mode .stock-card:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}
.stock-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.stock-card .symbol {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}
body.dark-mode .stock-card .symbol { color: #e2e8f0; }
.stock-card .price-current {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}
body.dark-mode .stock-card .price-current { color: #e2e8f0; }
.stock-card .price-change {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.stock-card .jump { font-weight: 600; }
.stock-card .profit-tag {
    background: #22c55e;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
}
.stock-card .mini-chart {
    height: 50px;
    margin: 0.75rem 0;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}
body.dark-mode .stock-card .mini-chart { background: #334155; }
.stock-card .card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
}
body.dark-mode .stock-card .card-footer { color: #94a3b8; }
/* -------------------------------------------------
   10. NEWS – ULTRA READABLE, PREMIUM, MODERN
   ------------------------------------------------- */
.right-panel h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    letter-spacing: -0.02em;
}
body.dark-mode .right-panel h3 {
    color: #f1f5f9;
}
/* -------------------------------------------------
   FIXED RIGHT PANEL + SCROLLABLE NEWS FEED
   ------------------------------------------------- */

/* Give the right panel a controlled height */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: calc(100vh - 140px); /* Entire screen minus header/footer */
    overflow: hidden; /* Prevent it from stretching downward */
    border-radius: 10px;
}

/* Make only the news feed scroll */
#news-feed {
    flex: 1;                        /* Take all remaining space */
    overflow-y: auto !important;    /* Always scroll internally */
    padding-right: 8px;
    scrollbar-width: thin;
    max-height: unset !important;   /* Remove the conflicting 100% rule */
}

/* Better scrollbars */
#news-feed::-webkit-scrollbar {
    width: 6px;
}
#news-feed::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
body.dark-mode #news-feed::-webkit-scrollbar-thumb {
    background: #475569;
}
body.dark-mode #news-feed::-webkit-scrollbar-thumb {
    background: #475569;
}
.news-item {
    background: #efefd7;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    gap: 1rem;
    padding: 1.1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.25s ease;
}
.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    border-color: rgba(59, 130, 246, 0.2);
}
body.dark-mode .news-item {
    background: #1e293b;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}
body.dark-mode .news-item:hover {
    border-color: rgba(96, 165, 250, 0.3);
}
.news-image {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f1f5f9;
}
body.dark-mode .news-image { background: #334155; }
.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.news-title {
    margin-bottom: 0.4rem;
}
.news-title a {
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.38;
    color: #1e293b;
    text-decoration: none;
    display: block;
    letter-spacing: -0.01em;
}
body.dark-mode .news-title a {
    color: #f1f5f9;
}
.news-title a:hover {
    color: #1e40af;
    text-decoration: underline;
}
body.dark-mode .news-title a:hover {
    color: #60a5fa;
}
.news-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
body.dark-mode .news-meta {
    color: #94a3b8;
}
.news-summary {
    font-size: 0.89rem;
    line-height: 1.5;
    color: #475569;
    margin-top: 0.3rem;
}
body.dark-mode .news-summary {
    color: #cbd5e1;
}
.top-profit-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    margin-left: 0.6rem;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* -------------------------------------------------
   11. WISHLIST
   ------------------------------------------------- */
.wishlist-panel {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
body.dark-mode .wishlist-panel { background: #1e293b; }
.wishlist-input-wrapper {
    display: flex;
    gap: 0.5rem;
}
#ticker-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
}
body.dark-mode #ticker-input { border-color: #475569; background: #334155; color: #e2e8f0; }
#add-ticker-btn {
    background: #1e40af;
    color: #fff;
    border: none;
    padding: 0 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
#add-ticker-btn:hover { background: #1e3a8a; }
/* -------------------------------------------------
   12. FOOTER
   ------------------------------------------------- */
footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}
footer a { color: #5a95fb; text-decoration: none; }
/* -------------------------------------------------
   13. UTILITIES
   ------------------------------------------------- */
.clickable-stock { cursor: pointer; }
.selected-stock {
    background: #dbeafe !important;
    border-left: 5px solid #3b82f6 !important;
}
body.dark-mode .selected-stock {
    background: #1e40af !important;
}

/* -------------------------------------------------
   14. RIGHT-ALIGN NUMERIC COLUMNS + BADGE COLUMNS
   ------------------------------------------------- */
/* Right-align all numeric values */
.surge-panel td[data-label="Last"],
.surge-panel td[data-label="Current"],
.surge-panel td[data-label="Expected"],
.surge-panel td[data-label="Jump (%)"],
.surge-panel td[data-label="Profit ($)"] {
    text-align: right;
}

/* Right-align badge columns + fixed width */
.surge-panel td[data-label="AI Conf."],
.surge-panel td[data-label="Sentiment"],
.surge-panel td[data-label="Trade"] {
    text-align: right;
    width: 5.5rem; /* Matches width of widest pill (e.g. "Bullish") */
}

/* Push pills to the right within fixed-width cells */
.surge-panel td[data-label="AI Conf."] .pill,
.surge-panel td[data-label="Sentiment"] .pill,
.surge-panel td[data-label="Trade"] .pill {
    display: inline-block;
    margin-left: auto;
}

/* ==================== AI TRADE PLAN MODAL ==================== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal.active {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    overflow: hidden;
    animation: modalPop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body.dark-mode .modal-content { background: #1e293b; border: 1px solid #334155; }

@keyframes modalPop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    padding: 1.2rem 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { margin: 0; font-size: 1.6rem; }
.modal-close { font-size: 2.2rem; cursor: pointer; opacity: 0.8; }
.modal-close:hover { opacity: 1; }

.modal-body { padding: 1.6rem; }
.modal-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.modal-table td {
    padding: 0.7rem 0;
    border-bottom: 1px solid #e2e8f0;
}
body.dark-mode .modal-table td { border-color: #334155; }
.modal-table td:first-child { color: #64748b; font-weight: 500; width: 55%; }
body.dark-mode .modal-table td:first-child { color: #94a3b8; }
.modal-table td:last-child { text-align: right; font-weight: 600; }
.modal-table tr:last-child td { border: none; }
.positive {/* color: #22c55e !important; */}

.modal-note {
    margin-top: 1.2rem;
    font-size: 0.88rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
}
body.dark-mode .modal-note { color: #94a3b8; }

.modal-footer {
    padding: 1rem 1.6rem;
    text-align: right;
    background: #f8fafc;
}
body.dark-mode .modal-footer { background: #0f172a; }

/* Symbol clickable hint */
.clickable-symbol { position: relative; }
.clickable-symbol:hover { text-decoration: underline; color: #1e40af; }
body.dark-mode .clickable-symbol:hover { color: #60a5fa; }

/* -------------------------------------------------
   END OF FILE
   ------------------------------------------------- */


/* ================= SYMBOL COLUMN LEFT ALIGN FIX ================= */
.surge-panel td.clickable-symbol {
    text-align: left !important;
}

.surge-panel td:first-child {
    text-align: left !important;
}
/* ================================================================= */
/* ====================== USER AVATAR + DROPDOWN ======================= */

.header-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Avatar circle */
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    transition: 0.2s;
}

.user-avatar:hover {
    transform: scale(1.06);
}

/* Dropdown menu */
.user-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 210px;
    /* padding: 0.5rem 0; */
    display: none;
    flex-direction: column;
    z-index: 2000;
}

body.dark-mode .user-menu {
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* menu items */
.user-menu .menu-item {
    background: none;
    border: none;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.92rem;
    cursor: pointer;
    color: #1e293b;
    text-decoration: none;
}

body.dark-mode .user-menu .menu-item {
    color: #e2e8f0;
}

.user-menu .menu-item:hover {
    background: #f1f5f9;
}

body.dark-mode .user-menu .menu-item:hover {
    background: #334155;
}

.user-menu .logout {
    /* color: #ef4444 !important; */
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid;
}
/* ============================
   PROFILE BADGE + DROPDOWN
   ============================ */

.profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-circle {
    width: 36px;
    height: 36px;
    background: #1e3a8a;
    color: white;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    border: 2px solid rgba(255,255,255,0.4);
    transition: 0.2s;
}

.profile-circle:hover {
    background: #3b82f6;
}

#profile-dropdown {
    position: absolute;
    top: 46px;
    right: 0;
    background: white;
    border-radius: 10px;
    min-width: 180px;
    padding: 0.5rem 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    z-index: 9999;
    display: none;
}

body.dark-mode #profile-dropdown {
    background: #1e293b;
    border: 1px solid #475569;
}

#profile-dropdown.show {
    display: block;
}

.profile-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    transition: 0.15s;
}

.profile-item:hover {
    background: #f1f5f9;
}

body.dark-mode .profile-item {
    color: #e2e8f0;
}

body.dark-mode .profile-item:hover {
    background: #334155;
}

/* Divider */
.profile-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.4rem 0;
}

body.dark-mode .profile-divider {
    background: #475569;
}

/* HEADER TITLE */
.header-title h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

/* WELCOME TEXT */
.welcome-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    margin-right: 0.75rem;
    white-space: nowrap;
}

/* AVATAR FIX */
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    transition: 0.2s;
}

.user-avatar:hover {
    transform: scale(1.06);
}

/* DROPDOWN FIX */
.user-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: white;
    border-radius: 12px;
    width: 210px;
    display: none;
    flex-direction: column;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    z-index: 2000;
}

body.dark-mode .user-menu {
    background: #1e293b;
    box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}

.menu-item {
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    border: none;
    background: none;
    width: 100%;
}

.menu-item:hover {
    background: #f1f5f9;
}
body.dark-mode .menu-item:hover {
    background: #334155;
}
/* ===========================================================
   ULTRA-CLEAN APPLE STYLE FOOTER
   ============================================================ */

/* ===========================================================
   ULTRA-CLEAN APPLE STYLE FOOTER (LEFT ALIGNED)
   ============================================================ */

.footer-apple {
    margin-top: 3rem;
    padding: 2.5rem 0;
    background: #f5f5f7;
    border-top: 1px solid #d2d2d7;
    min-width: 100%;
}

body.dark-mode .footer-apple {
    background: #111827;
    border-color: #1f2937;
}

.footer-inner {
    max-width: 1250px;
    margin: auto;
    padding: 0 2rem;
    min-width: 80%;
}

/* --- LEFT aligned grid (Apple style) --- */
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2.5rem;
    text-align: left !important;
    justify-items: start !important;
}

.footer-group h4 {
    font-size: 12px;
    letter-spacing: 0.7px;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1d1d1f;
}

body.dark-mode .footer-group h4 {
    color: #e5e7eb;
}

.footer-group a {
    display: block;
    font-size: 13px;
    margin-bottom: 0.4rem;
    color: #4b5563;
    text-decoration: none;
}

.footer-group a:hover {
    color: #0066cc;
}

body.dark-mode .footer-group a {
    color: #cbd5e1;
}

/* --- Bottom legal row --- */
.footer-legal {
    border-top: 1px solid #d2d2d7;
    margin-top: 2rem;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    color: #6b7280;
    font-size: 12px;
    text-align: left !important;
}

body.dark-mode .footer-legal {
    border-color: #374151;
    color: #9ca3af;
}

.legal-links {
    display: flex;
    gap: 0.75rem;
}

.legal-links a {
    text-decoration: none;
    color: inherit;
}

.legal-links a:hover {
    text-decoration: underline;
}
/* FIX BROKEN TICKER — RESTORE FLEX + SCROLL */

.ticker-inline {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

/* ================================
   FIX TICKER SCROLL ANIMATION
================================= */

.ticker-wrapper {
    display: flex !important;
    flex-wrap: nowrap;
    animation: ticker-scroll 35s linear infinite !important;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* WATCHLIST TOP BUTTON — EXACTLY MATCHES YOUR DESIGN */
.watchlist-top-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;
}
.watchlist-top-btn:a {
    text-decoration: none;
}
.watchlist-top-btn:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.watchlist-top-btn .star-icon {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
    transition: transform 0.2s;
}

.watchlist-top-btn:hover .star-icon {
    transform: scale(1.15);
}

/* Dark mode version */
body.dark-mode .watchlist-top-btn {
    background: rgba(251, 191, 36, 0.18);
    border-color: #fbbf24;
    color: #fde68a !important;
}

body.dark-mode .watchlist-top-btn:hover {
    background: #fbbf24;
    color: #1e293b !important;
}
/* TOP HEADER BAR — TITLE LEFT + WATCHLIST RIGHT */
.top-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.top-header-bar h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 700;
  color: #1e293b;
}

.surge-timestamp {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  margin-left: 14px;
}

.last-updated {
  margin-top: 8px;
  font-size: 0.95rem;
  color: #475569;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .top-header-bar {
    padding: 18px 20px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .top-header-bar h1 {
    font-size: 1.8rem;
  }
}
/* ================================================
   RIGHT-ALIGNED INFO BOX — 500px PREMIUM VERSION
   ================================================ */
.right-aligned {
    margin-left: auto;
    width: 600px;                /* ⬅ NEW WIDTH */
    
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;

    display: flex;
    flex-direction: column;
    gap: 6px;

    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;

    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);

    text-align: left;          /* Right-align content */
    white-space: normal;        /* Multi-line support */
}

body.dark-mode .right-aligned {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.18);
}
.right-aligned.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* 2 equal columns */
    gap: 8px 16px;                    /* row-gap | column-gap */
}

.watchlist-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;
}
.watchlist-btn:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);    
}
.star-icon {
    width: 18px;
    height: 18px;
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: #fbbf24;
    fill: none;
    stroke-width: 2;
}

.icon-btn:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);     
}
.icon-btn-grrpahical-view {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e !important;
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.2);
    margin-left: 1rem;

}
.icon-btn-grrpahical-view svg {
    width: 22px;
    height: 22px;
    stroke: #fbbf24;
    fill: none;
    stroke-width: 2;
}

.icon-btn-grrpahical-view:hover {
    background: #fbbf24;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);    
}

/* ===========================================
   MOBILE RESPONSIVENESS — GLOBAL OVERRIDES
   =========================================== */
/* ============================================================
   SURGEPULSE™ MOBILE UI v2 — App-Level Experience
   ZERO HTML Changes Needed
   ============================================================ */

/* ============================
   GLOBAL MOBILE OPTIMIZATIONS
   ============================ */
@media (max-width: 768px) {

    /* Reduce padding system-wide */
    body, .dashboard-grid, header {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Collapse grid fully */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 10px !important;
    }

    /* Cards/widgets become full-width */
    .analytics-widget,
    .surge-panel,
    .wishlist-panel,
    .news-item,
    .stock-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        margin: 0 auto !important;
    }

    /* Reduce all card shadows for mobile performance */
    .analytics-widget,
    .stock-card,
    .news-item {
        box-shadow: 0 6px 20px rgba(0,0,0,0.18) !important;
    }

    /* Prevent overlap issues on small screens */
    .left-panel, .right-panel {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* =======================================
   MOBILE HEADER — COMPACT WITH SCROLL
   ======================================= */
@media (max-width: 768px) {

    header {
        border-radius: 0 !important;
        padding: 16px 18px !important;
        position: sticky;
        top: 0;
        z-index: 999;
    }

    /* Compact header on scroll */
    header.shrink {
        padding: 10px 14px !important;
        backdrop-filter: blur(10px);
    }

    .header-top {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }

    .header-right {
        justify-content: center !important;
    }

    .right-aligned {
        width: 100% !important;
        padding: 12px !important;
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }
}

/* ==============================================
   MOBILE TABLE — SWIPEABLE & COMPACT MODE
   ============================================== */
@media (max-width: 768px) {

    .surge-panel table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        border-spacing: 0 !important;
        margin-top: 10px !important;
    }

    .surge-panel th,
    .surge-panel td {
        padding: 8px 12px !important;
        font-size: 0.82rem !important;
    }

    /* Keep header visible when scrolling */
    .surge-panel th {
        top: 0;
        position: sticky;
        background: #64748b !important;
    }
}

/* ======================================================
   COLLAPSIBLE RIGHT PANEL (NEWS / PROFILE)
   Auto-collapses into accordion-style panels.
   ====================================================== */
@media (max-width: 768px) {

    .right-panel {
        height: auto !important;
        overflow: hidden !important;
    }

    #news-feed {
        max-height: 260px !important;
        overflow-y: auto !important;
        padding-right: 6px;
    }
}

/* ======================================
   FLOATING ACTION BUTTON (WATCHLIST)
   ====================================== */
@media (max-width: 768px) {
    .fab-watchlist {
        position: fixed;
        bottom: 86px;
        right: 16px;
        background: #fbbf24;
        color: #1e293b;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        font-size: 1.8rem;
        font-weight: 900;
        line-height: 54px;
        text-align: center;
        z-index: 2000;
        box-shadow: 0 4px 18px rgba(0,0,0,0.28);
        cursor: pointer;
    }
}

/* ============================================
   STICKY BOTTOM NAV (TradingView / Robinhood)
   ============================================ */
@media (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 62px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 3000;
        box-shadow: 0 -1px 12px rgba(0,0,0,0.06);
    }

    body.dark-mode .mobile-nav {
        background: #1e293b;
        border-color: #475569;
    }

    .mobile-nav button {
        background: none;
        border: none;
        font-size: 0.85rem;
        color: #475569;
        text-align: center;
    }

    body.dark-mode .mobile-nav button {
        color: #cbd5e1;
    }
}

/* ======================================================
   ICON OPTIMIZATIONS — FIX STAR, BUTTONS, ALIGNMENT
   ====================================================== */
@media (max-width: 768px) {
    .watchlist-top-btn,
    .icon-btn,
    .icon-btn-grrpahical-view {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
        border-radius: 30px !important;
        gap: 6px !important;
    }

    .star-icon {
        width: 16px !important;
        height: 16px !important;
    }
}

/* ======================================================
   SMALL SCREEN ULTRA MODE (< 480px)
   ====================================================== */
@media (max-width: 480px) {

    header h1 {
        font-size: 1.3rem !important;
    }

    .analytics-widget {
        padding: 12px !important;
        font-size: 0.9rem !important;
    }

    /* Reduce heavy shadows for speed */
    .analytics-widget,
    .stock-card,
    .news-item {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }

    /* Compact profile dropdown */
    .profile-circle,
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    .surge-panel table {
        font-size: 0.75rem !important;
    }
}
.verified-badge {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.28);
}


.analytics-widget {
    background: linear-gradient(135deg, #757575, #9ea5b3);
    border-radius: 10px;
    padding: 8px 20px;            /* reduced from 9px to 8px */
    color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: auto;
    margin-left: 55px;
}

.widget-header {
font-size: 0.72rem;
    font-weight: 700;
    border-bottom: 1px solid red;
    text-align: left;
    padding: 4px;
    color: black;
}

.widget-subtitle {
    font-size: 0.58rem;           /* reduced from 0.63rem */
    color: #cdd7f0;
    margin-bottom: 4px;           /* reduced from 5px */
}

canvas {
    max-width: 320px;
    max-height: 210px;            /* slightly reduce chart height */
    margin: 0 auto 4px auto;      /* reduced from 5px */
    display: block;
}

.sentiment-info {
    text-align: left;
    padding: 0 12px;
    font-size: 0.58rem;           /* reduced from 0.63rem */
    line-height: 0.82;            /* tighter line height */
    color: white;
}

.sentiment-info strong {
    color: #ffc107;
    font-weight: 600;
}

/* -----------------------------------------------------------
   CLEAN INSTITUTIONAL ALIGNMENT FIX
   Titles and values aligned in crisp two-column structure
------------------------------------------------------------ */

.modal {
    min-width: 300px;
}
/* Container for PAIR LABEL row */
.modal-table tr td[colspan="2"] div:first-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;   /* Two equal columns */
    text-align: right;                /* Align both titles right */
    column-gap: 40px;                 /* Space between columns */
}

/* Container for PAIR VALUE row */
.modal-table tr td[colspan="2"] div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;   /* Two equal columns */
    text-align: right;                /* Values aligned right */
    column-gap: 40px;                 /* Space between value columns */
}

/* Ensure values do not touch each other */
.modal-table tr td[colspan="2"] div:last-child span {
    padding: 0 4px;
}

/* Optional: make labels slightly smaller & muted */
.modal-table tr td[colspan="2"] div:first-child span {
    font-size: 0.93rem;
    font-weight: 600;
    color: #2a3442;
}

.btn-outline-cyan {
    border: 1.5px solid #00ffff !important;
    color: #00ffff !important;
    font-weight: 600;
    font-size: 0.85em;
}
.btn-outline-cyan:hover {
    background: #00ffff22 !important;
    color: white !important;
}

.grok-verdict-box {
    background: linear-gradient(90deg, #0a0a0f, #0f0f1f);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.1);
    animation: fadeIn 0.6s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ————— TERMINOLOGY MODAL ————— */
/* ————— TERMINOLOGY MODAL – LIGHT MODE (White Background) ————— */
#terminology-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

#terminology-modal.active {
    display: flex !important;
    opacity: 1;
}

#terminology-modal .modal-content {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
    max-width: 1200px;           /* ← super wide & comfortable */
    width: 70%;
    transform: scale(0.94);
    transition: transform 0.32s ease;
    border: 1px solid #e2e8f0;
    margin: 20px;
}

#terminology-modal.active .modal-content {
    transform: scale(1);
}

#terminology-modal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    padding: 1.4rem 2rem;
    border-radius: 18px 18px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#terminology-modal .modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

#terminology-modal .modal-close {
    font-size: 36px;
    cursor: pointer;
    color: white;
    opacity: 0.9;
    line-height: 1;
}

#terminology-modal .modal-close:hover {
    opacity: 1;
}

#terminology-modal .modal-body {
    padding: 2rem;
    color: #1e293b;
    line-height: 1.7;
}

#terminology-modal .modal-body p {
    margin: 0 0 1.2rem 0;
    font-size: 1rem;
    opacity: 0.88;
}

#terminology-modal table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.98rem;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

#terminology-modal th {
    background: #eff6ff;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #1e40af;
    border-bottom: 2px solid #3b82f6;
}

#terminology-modal td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

#terminology-modal tbody tr:hover {
    background: #f0f5ff;
}

#terminology-modal .note-box {
    margin-top: 28px;
    padding: 18px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 14px;
    font-size: 0.96rem;
    border-left: 5px solid #3b82f6;
    color: #1e40af;
}