/* ==============================================================================
   THE BULL PRINT — GLOBAL THEME & COMPONENT STYLING SYSTEM
   Defaults to LIGHT MODE as specified. Supports seamless Dark Mode toggle.
   ============================================================================== */

:root, :root[data-theme="light"], html[data-theme="light"] {
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-card-subtle: #f8fafc;
    --border-subtle: #e2e8f0;
    --border-hover: #00a878;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --groww-mint: #00875a;
    --groww-mint-soft: rgba(0, 135, 90, 0.10);
    --market-red: #dc2626;
    --market-red-soft: rgba(220, 38, 38, 0.10);
    --accent-blue: #0284c7;
    --accent-blue-soft: rgba(2, 132, 199, 0.10);
    --accent-amber: #d97706;
    --table-header-bg: #f1f5f9;
    --table-row-hover: #f8fafc;
    --table-border: #e2e8f0;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"], html[data-theme="dark"] {
    --bg-canvas: #07090e;
    --bg-surface: #0c101a;
    --bg-card: #101624;
    --bg-card-hover: #151d30;
    --bg-card-subtle: rgba(255, 255, 255, 0.025);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 208, 156, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --groww-mint: #00d09c;
    --groww-mint-soft: rgba(0, 208, 156, 0.12);
    --market-red: #f43f5e;
    --market-red-soft: rgba(244, 63, 94, 0.12);
    --accent-blue: #38bdf8;
    --accent-blue-soft: rgba(56, 189, 248, 0.12);
    --accent-amber: #fbbf24;
    --table-header-bg: rgba(8, 12, 22, 0.85);
    --table-row-hover: rgba(255, 255, 255, 0.035);
    --table-border: rgba(255, 255, 255, 0.06);
    --navbar-bg: rgba(10, 14, 24, 0.90);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.theme-toggle-btn:hover {
    border-color: var(--groww-mint);
    background: var(--groww-mint-soft);
}

/* Auth Navigation Controls */
.nav-auth-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
}
.nav-login-btn:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.08);
}
.nav-shortlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-amber);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.nav-shortlist-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-amber);
}
.shortlist-count {
    background: var(--accent-amber);
    color: #ffffff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 9999px;
}

/* User Pill & Dropdown */
.user-pill-dropdown {
    position: relative;
}
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.user-pill:hover {
    border-color: var(--groww-mint);
}
.user-avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    overflow: hidden;
}
.user-menu-dropdown.show {
    display: block;
    animation: fadeInMenu 0.18s ease;
}
@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-menu-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card-subtle);
}
.user-menu-item {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.user-menu-item:hover {
    background: var(--bg-card-hover);
    color: var(--groww-mint);
}

/* Google Auth Modal */
#google-auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.g-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.g-modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 30px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 2001;
    animation: zoomModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes zoomModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.g-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
}
.g-modal-header {
    text-align: center;
    margin-bottom: 20px;
}
.google-logo {
    margin-bottom: 10px;
}
.g-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.g-modal-header p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.g-account-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.g-account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.g-account-item:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}
.g-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.g-account-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}
.g-account-email {
    font-size: 12px;
    color: var(--text-muted);
}
.g-email-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.g-email-input:focus {
    border-color: #4285F4;
}
.g-submit-btn {
    width: 100%;
    padding: 10px;
    background: #4285F4;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.g-submit-btn:hover {
    background: #3367d6;
}
.g-modal-disclaimer {
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* Watchlist Side Drawer */
#watchlist-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}
#watchlist-drawer.open {
    display: block;
}
.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}
.drawer-content {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDrawer {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.drawer-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.drawer-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
}
.drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.drawer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.drawer-item:hover {
    border-color: var(--groww-mint);
    background: var(--bg-card-hover);
}
.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-card-subtle);
}
.drawer-portfolio-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: var(--groww-mint);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.drawer-portfolio-btn:hover {
    opacity: 0.9;
}
.remove-btn {
    background: none;
    border: none;
    color: var(--market-red);
    cursor: pointer;
    font-size: 12px;
}

/* Toast */
.dsa-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}
[data-theme="light"] .dsa-toast {
    background: #1e293b;
}
.dsa-toast.show {
    bottom: 30px;
}

/* ==============================================================================
   PORTFOLIO STOCK EVENTS ALERT NOTIFICATION SYSTEM
   ============================================================================== */
.nav-alert-wrapper {
    position: relative;
    display: inline-block;
}
.nav-alert-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}
.nav-alert-btn:hover {
    border-color: var(--groww-mint);
    background: var(--groww-mint-soft);
}
.nav-alert-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--market-red);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-surface);
    animation: pulseBadge 2.2s infinite;
}
@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Alert Dropdown Panel */
.alert-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    z-index: 2500;
    display: none;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}
.alert-dropdown-panel.show { display: block; }
.alert-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card-subtle);
}
.alert-panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.alert-panel-list {
    max-height: 360px;
    overflow-y: auto;
}
.alert-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.alert-item:hover {
    background: var(--bg-card-hover);
}
.alert-item:last-child { border-bottom: none; }
.alert-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.alert-icon-box.earnings { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.alert-icon-box.dividend { background: var(--groww-mint-soft); color: var(--groww-mint); }
.alert-icon-box.split { background: rgba(147, 51, 234, 0.12); color: #9333ea; }
.alert-icon-box.board { background: rgba(217, 119, 6, 0.12); color: #d97706; }

/* Slide-in Event Alert Popup Banner */
.dsa-event-alert-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--groww-mint);
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    z-index: 2900;
    transform: translateY(140%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 18px;
}
.dsa-event-alert-popup.show {
    transform: translateY(0);
    opacity: 1;
}
.dsa-alert-pop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.dsa-alert-badge-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.dsa-alert-badge-tag.earnings { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.dsa-alert-badge-tag.dividend { background: var(--groww-mint-soft); color: var(--groww-mint); }
.dsa-alert-badge-tag.split { background: rgba(147, 51, 234, 0.12); color: #9333ea; }
.dsa-alert-badge-tag.board { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.dsa-alert-days-pill {
    background: rgba(220, 38, 38, 0.12);
    color: var(--market-red);
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 9999px;
}
.dsa-alert-pop-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.dsa-alert-pop-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}
.dsa-alert-pop-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.dsa-alert-btn-dismiss {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}
.dsa-alert-btn-dismiss:hover { color: var(--text-primary); }
.dsa-alert-btn-cal {
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
}
.dsa-alert-btn-view {
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 6px;
    background: var(--groww-mint);
    border: none;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
}
