/* ═══════════════════════════════════════════════════════════════
   White Mode Theme — Investor Mode
   Activated by adding .white-mode to <html>
   Accent: Investor Gold #cbb37a → darker #9A8A5A in white mode
   NOTE: Does NOT affect investor detail overlay (country detail page)
   ═══════════════════════════════════════════════════════════════ */

/* ── Body & Global ── */
html.white-mode body {
    background: #FFFFFF !important;
    color: #1a1a1a !important;
}

html.white-mode body::before {
    display: none !important;
}

/* ── Scrollbar — hidden in white mode ── */
html.white-mode ::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

html.white-mode * {
    scrollbar-width: none !important;
}

/* ── Navbar ── */
html.white-mode #main-nav {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.white-mode #main-nav .text-white,
html.white-mode #main-nav h1 {
    color: #333 !important;
}

html.white-mode #main-nav svg {
    stroke: #333 !important;
}

html.white-mode .leaflet-control-zoom {
    display: none !important;
}

html.white-mode #globeViz {
    filter: brightness(1.08) saturate(1.15);
}

/* ── Mode Badge ── */
html.white-mode #current-mode-badge {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}

html.white-mode #current-mode-badge:hover {
    border-color: rgba(0, 0, 0, 0.25) !important;
    color: #000 !important;
}

/* ── Mode Dropdown ── */
html.white-mode .mode-dropdown {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1) !important;
}

html.white-mode .mode-dropdown-item {
    color: #555 !important;
}

html.white-mode .mode-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #000 !important;
}

/* ── Sidebar Menu ── */
html.white-mode #sidebar-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    border-right-color: rgba(0, 0, 0, 0.08) !important;
}

html.white-mode #sidebar-menu h1 {
    color: #1a1a1a !important;
}

html.white-mode #sidebar-close-btn {
    color: #999 !important;
}

html.white-mode #sidebar-close-btn:hover {
    color: #333 !important;
}

html.white-mode #sidebar-menu .rr-glass {
    background: rgba(245, 245, 245, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.white-mode #sidebar-menu .border-b {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

/* Sidebar menu items */
html.white-mode .sidebar-menu-item {
    background: rgba(245, 245, 245, 0.6) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html.white-mode .sidebar-menu-item:hover {
    border-color: rgba(154, 138, 90, 0.3) !important;
    background: rgba(154, 138, 90, 0.04) !important;
}

html.white-mode .sidebar-menu-item .text-white,
html.white-mode .sidebar-menu-item .font-display {
    color: #333 !important;
}

html.white-mode .sidebar-menu-item .text-gray-500 {
    color: #999 !important;
}

html.white-mode .sidebar-menu-item .text-gray-600 {
    color: #767676 !important;
}

html.white-mode .sidebar-menu-item .text-rr-gold {
    color: #9A8A5A !important;
}

html.white-mode .sidebar-menu-item .group-hover\:text-rr-gold:hover,
html.white-mode .sidebar-menu-item:hover .font-display {
    color: #9A8A5A !important;
}

/* Sidebar menu icon boxes */
html.white-mode .sidebar-menu-item .bg-gradient-to-br {
    background: linear-gradient(to bottom right, rgba(154, 138, 90, 0.12), rgba(154, 138, 90, 0.04)) !important;
    border-color: rgba(154, 138, 90, 0.2) !important;
}

/* Search input */
html.white-mode #search-input {
    color: #1a1a1a !important;
}

html.white-mode #search-input::placeholder {
    color: #999 !important;
}

html.white-mode #search-suggest {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1) !important;
}

html.white-mode #search-suggest .border-b {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

/* Sidebar overlay */
html.white-mode #sidebar-overlay.show {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* ── rr-glass override ── */
html.white-mode .rr-glass {
    background: rgba(245, 245, 245, 0.85) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* ── Hover Card ── */
html.white-mode #hover-card {
    background: rgba(255, 255, 255, 0.97) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 28px 85px rgba(0, 0, 0, 0.12) !important;
    color: #1a1a1a !important;
}

html.white-mode #hover-card.pinned {
    border-color: rgba(154, 138, 90, 0.5) !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(154, 138, 90, 0.15) !important;
}

html.white-mode #hover-card .pin-indicator {
    color: #9A8A5A !important;
}

html.white-mode #hover-tag {
    color: #9A8A5A !important;
}

html.white-mode #hover-name {
    color: #1a1a1a !important;
}

html.white-mode #hover-card .border-t {
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

html.white-mode #hover-card h4 {
    color: #767676 !important;
}

html.white-mode #hover-card .text-white {
    color: #1a1a1a !important;
}

html.white-mode #hover-card .text-gray-300 {
    color: #555 !important;
}

html.white-mode #hover-card .text-gray-400 {
    color: #767676 !important;
}

html.white-mode #hover-card .text-gray-500 {
    color: #999 !important;
}

html.white-mode #hover-card .text-gray-600 {
    color: #767676 !important;
}

html.white-mode #hover-card .rr-glass {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Hover card — compare card */
html.white-mode #hover-card-compare {
    background: rgba(255, 255, 255, 0.97) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 28px 85px rgba(0, 0, 0, 0.12) !important;
    color: #1a1a1a !important;
}

html.white-mode #hover-card-compare .rr-glass {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html.white-mode #hover-card-compare .text-white {
    color: #1a1a1a !important;
}

html.white-mode #hover-card-compare .text-gray-300 {
    color: #555 !important;
}

html.white-mode #hover-card-compare .text-gray-400 {
    color: #767676 !important;
}

html.white-mode #hover-card-compare .text-gray-500 {
    color: #999 !important;
}

/* ── Toast ── */
html.white-mode #toast {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Market Briefing Panel — White Mode
   ═══════════════════════════════════════════════════════════════ */

html.white-mode #briefing-panel {
    color: #1a1a1a !important;
}

/* Briefing accordion cards */
html.white-mode #briefing-panel>div>div {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

html.white-mode #briefing-panel>div>div:hover {
    background: rgba(154, 138, 90, 0.04) !important;
}

/* Briefing category label text */
html.white-mode #briefing-panel span[style*="color:#ddd"] {
    color: #333 !important;
}

/* Briefing detail text */
html.white-mode #briefing-panel .bf-detail p {
    color: #555 !important;
}

/* Briefing chevron */
html.white-mode #briefing-panel .bf-chev {
    color: rgba(0, 0, 0, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Briefing Detail Overlay — White Mode
   ═══════════════════════════════════════════════════════════════ */

html.white-mode #briefing-detail-overlay {
    background: rgba(248, 247, 245, 0.98) !important;
}

/* Detail title */
html.white-mode #briefing-detail-overlay h1 {
    color: #9A8A5A !important;
}

/* Detail subtitle */
html.white-mode #briefing-detail-overlay p[style*="color:#666"] {
    color: #999 !important;
}

/* Close button */
html.white-mode #briefing-detail-overlay button[onclick*="remove"] {
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #767676 !important;
    background: rgba(0, 0, 0, 0.03) !important;
}

html.white-mode #briefing-detail-overlay button[onclick*="remove"]:hover {
    color: #333 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

/* Stat cards */
html.white-mode #briefing-detail-overlay div[style*="background:rgba(255,255,255,0.03)"] {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Stat labels */
html.white-mode #briefing-detail-overlay div[style*="color:#666"][style*="letter-spacing"] {
    color: #999 !important;
}

/* Stat values (white text) */
html.white-mode #briefing-detail-overlay div[style*="color:#fff"] {
    color: #1a1a1a !important;
}

/* Chart container */
html.white-mode #briefing-detail-overlay div[style*="background:rgba(255,255,255,0.02)"] {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* AI analysis text */
html.white-mode #briefing-detail-overlay p[style*="color:#bbb"] {
    color: #555 !important;
}

/* Beta notice */
html.white-mode #briefing-detail-overlay div[style*="background:rgba(250,204,21"] {
    background: rgba(154, 138, 90, 0.06) !important;
    border-color: rgba(154, 138, 90, 0.15) !important;
}

html.white-mode #briefing-detail-overlay p[style*="color:#a89860"] {
    color: #9A8A5A !important;
}

/* Chart tooltip */
html.white-mode #chart-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(154, 138, 90, 0.2) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

html.white-mode #chart-tooltip div[style*="color:#888"] {
    color: #999 !important;
}

html.white-mode #chart-tooltip div[style*="color:#fff"] {
    color: #1a1a1a !important;
}

html.white-mode #chart-tooltip div[style*="color:#cbb37a"] {
    color: #9A8A5A !important;
}

/* ═══════════════════════════════════════════════════════════════
   Stock Calendar Panel — White Mode
   ═══════════════════════════════════════════════════════════════ */

html.white-mode #inv-calendar-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08) !important;
}

html.white-mode .ical-title {
    color: #9A8A5A !important;
}

html.white-mode .ical-close {
    color: #999 !important;
}

html.white-mode .ical-close:hover {
    color: #9A8A5A !important;
    background: rgba(154, 138, 90, 0.08) !important;
}

/* Calendar tabs */
html.white-mode .ical-tab {
    color: #767676 !important;
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.white-mode .ical-tab.active,
html.white-mode .ical-tab:hover {
    background: rgba(154, 138, 90, 0.1) !important;
    border-color: rgba(154, 138, 90, 0.3) !important;
    color: #9A8A5A !important;
}

/* Month nav */
html.white-mode .ical-nav-btn {
    color: #555 !important;
}

html.white-mode .ical-nav-btn:hover {
    color: #9A8A5A !important;
}

html.white-mode .ical-month-label {
    color: #1a1a1a !important;
}

/* Weekday headers */
html.white-mode .ical-weekdays span {
    color: #999 !important;
}

/* Calendar cells */
html.white-mode .ical-cell {
    color: #aaa !important;
}

html.white-mode .ical-cell.has-event {
    color: #333 !important;
}

html.white-mode .ical-cell.has-event:hover {
    background: rgba(154, 138, 90, 0.08) !important;
}

html.white-mode .ical-cell.today {
    color: #9A8A5A !important;
}

html.white-mode .ical-cell.today::after {
    background: #9A8A5A !important;
}

html.white-mode .ical-cell.selected {
    background: rgba(154, 138, 90, 0.12) !important;
    border-color: rgba(154, 138, 90, 0.3) !important;
}

/* Legend */
html.white-mode .ical-legend {
    border-top-color: rgba(0, 0, 0, 0.06) !important;
}

html.white-mode .ical-legend-item {
    color: #767676 !important;
}

/* Events list */
html.white-mode .ical-event-item {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html.white-mode .ical-event-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

html.white-mode .ical-event-title {
    color: #1a1a1a !important;
}

html.white-mode .ical-event-sub {
    color: #767676 !important;
}

/* Calendar toggle button */
html.white-mode #inv-cal-toggle {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #9A8A5A !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

html.white-mode #inv-cal-toggle:hover {
    border-color: rgba(154, 138, 90, 0.4) !important;
    background: rgba(154, 138, 90, 0.06) !important;
}

/* ═══════════════════════════════════════════════════════════════
   White Mode Toggle Button
   ═══════════════════════════════════════════════════════════════ */

#inv-white-mode-toggle {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 101;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.4);
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    font-size: 16px;
    line-height: 1;
}

#inv-white-mode-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: scale(1.05);
}

html.white-mode #inv-white-mode-toggle {
    border-color: rgba(0, 0, 0, 0.12) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
}

html.white-mode #inv-white-mode-toggle:hover {
    border-color: rgba(0, 0, 0, 0.25) !important;
    color: #000 !important;
}

/* ── Language Toggle Button — Investor Mode ── */
#inv-lang-toggle {
    position: fixed;
    top: 24px;
    right: 72px;
    z-index: 101;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.4);
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    font-family: 'Manrope', sans-serif;
}

#inv-lang-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: scale(1.05);
}

html.white-mode #inv-lang-toggle {
    border-color: rgba(0, 0, 0, 0.12) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
}

html.white-mode #inv-lang-toggle:hover {
    border-color: rgba(0, 0, 0, 0.25) !important;
    color: #000 !important;
}

/* ── Country label overrides ── */
html.white-mode .beta-country-label span {
    color: #333 !important;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8) !important;
}

/* ── Investor intro — hide in white mode switch (intro already dark) ── */
/* (Investor intro is only shown on first load, not affected) */