/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    scrollbar-gutter: stable;
}

:root {
    /* Light Mode Colors */
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Colors - Pure Black Theme */
body.dark-mode {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.1);
    --bg-primary: #0b0e14;
    --bg-secondary: #121722;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* Cosmic/Nebula Mode Colors - Custom Palette */
body.cosmic-mode {
    --primary-color: #3b82f6;
    /* Xanh dương sáng */
    --secondary-color: #1BE3FF;
    /* Xanh cyan */
    --accent-purple: #a78bfa;
    /* Tím nhẹ */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #ffffff;
    /* Trắng */
    --text-secondary: #e5e7eb;
    /* Xám nhẹ */
    --border-color: rgba(59, 130, 246, 0.3);
    --bg-primary: rgba(0, 0, 0, 0.95);
    /* Đen thuần */
    --bg-secondary: rgba(31, 41, 55, 0.8);
    /* Xám tối */
    --bg-dark: rgba(0, 0, 0, 0.8);
    /* Đen */
    --shadow-sm: 0 2px 8px rgba(59, 130, 246, 0.3), 0 0 15px rgba(27, 227, 255, 0.2);
    --shadow-md: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 25px rgba(27, 227, 255, 0.3);
    --shadow-purple: 0 4px 12px rgba(167, 139, 250, 0.4), 0 0 25px rgba(167, 139, 250, 0.3);
}

html,
body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #60a5fa 100%);
    background-size: 400% 400%;
    /* animation: gradientShift 15s ease infinite; */
    padding: 10px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Dark Mode Background - Pure Black */
body.dark-mode {
    background: #07090e;
    background-size: 100% 100%;
}

/* Cosmic Mode Background - Pure Black with Glow Effects */
body.cosmic-mode {
    background:
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        #000000;
    position: relative;
}

body.cosmic-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(27, 227, 255, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

@keyframes cosmicShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 100% 50%;
    }

    50% {
        background-position: 100% 100%;
    }

    75% {
        background-position: 0% 100%;
    }
}

@keyframes cosmicGlow {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes neonGlow {
    0% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.6), 0 0 25px rgba(27, 227, 255, 0.15);
    }

    100% {
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.8), 0 0 35px rgba(27, 227, 255, 0.25);
    }
}

/* Container */
.container {
    max-width: 100%;
    min-height: calc(100vh - 20px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: none !important;
}

/* Tabs */
.tabs,
.tabs::before,
.tabs::after {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
}

.tabs-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.brand-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    flex-shrink: 0;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.analysis-header-info h3 {
    margin-bottom: 10px;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.risk-warning-card {
    flex: 1;
    background: var(--bg-primary);
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.risk-warning-title {
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.risk-warning-list {
    font-size: 0.8em;
    color: #78350f;
    line-height: 1.5;
}

.brand-text {
    font-size: 1.2em;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #e0e7ff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    /* animation: textGlow 3s ease-in-out infinite; */
    padding: 0 20px;
}

.user-menu {
    position: relative;
}

.tabs-toggle {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    /* Giống border-radius của tab-btn */
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 1.4em;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    /* Giống shadow của tab-btn */
    transition: all 0.3s ease;
    /* Giống transition của tab-btn */
}

.tabs-toggle:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tabs-toggle:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-sm);
}

/* User Info & Order Notifications Dropdown Menu */
.user-info-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 24px);
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.user-info-dropdown.open {
    display: block;
    animation: menuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Guest View in User Dropdown */
.menu-guest-view {
    padding: 32px 20px 28px;
    text-align: center;
}

.guest-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.guest-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.guest-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}

.guest-desc {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
    max-width: 280px;
}

.btn-guest-login {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 260px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    transition: all 0.2s ease;
}

.btn-guest-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.btn-guest-login:active {
    transform: translateY(0);
}

/* Tabs Header */
.menu-tabs-header {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
}

.menu-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

.menu-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.menu-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    background: #ef4444;
    color: #ffffff;
    line-height: 1;
}

/* Body & Scrollbar (max-height: 480px) */
.menu-content-body {
    max-height: 480px;
    overflow-y: auto;
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-content-body::-webkit-scrollbar {
    width: 4px;
}

.menu-content-body::-webkit-scrollbar-track {
    background: transparent;
}

.menu-content-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}

.menu-content-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.menu-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hidden,
.menu-panel.hidden,
.menu-guest-view.hidden,
.menu-auth-view.hidden {
    display: none !important;
}

.menu-sps-mode-toggle {
    margin: 8px 0 6px !important;
}

.menu-sps-acct-toggle {
    margin: 0 0 6px !important;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-sps-mode-toggle .sps-mode-btn:not(.active),
body:not(.dark-mode):not(.cosmic-mode) .menu-sps-acct-toggle .sps-acct-btn:not(.active) {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Cards */
.menu-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Block 1: Account Info */
.menu-acc-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    flex-shrink: 0;
}

.menu-acc-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-acc-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-acc-name,
.menu-sps-fullname {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.menu-sps-account-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: #94a3b8;
}

.menu-badge-live {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.menu-acc-id-wrap {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-acc-id-wrap strong {
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

.menu-badge-sub {
    font-size: 10px;
    font-weight: 600;
    padding: 0 4px;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Slot ở góc phải Thông tin tài khoản: Quản lý hoặc Cờ Đổi Ngôn Ngữ */
.menu-acc-slot {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.menu-acc-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.22), rgba(56, 189, 248, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.menu-acc-admin-btn:hover {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.4), rgba(56, 189, 248, 0.28));
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
    transform: translateY(-1px);
}

.menu-acc-admin-btn.super-admin {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
    border-color: rgba(245, 158, 11, 0.45);
    color: #fbbf24;
}

.menu-acc-admin-btn.super-admin:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(217, 119, 6, 0.25));
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

.menu-acc-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 6px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.lang-flag-btn {
    width: 28px;
    height: 20px;
    padding: 0;
    border: 1.5px solid transparent;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    filter: grayscale(20%);
    transition: all 0.2s ease;
}

.lang-flag-btn:hover {
    opacity: 0.95;
    filter: none;
    transform: scale(1.08);
}

.lang-flag-btn.active {
    opacity: 1;
    filter: none;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
    transform: scale(1.1);
}

.lang-flag-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Toolbar Language Switcher */
.tabs-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    margin-left: 6px;
    height: 38px;
    box-sizing: border-box;
    border-radius: 8px;
    background: #121722;
    border: 1px solid rgba(255, 255, 255, 0.12);
    vertical-align: middle;
    transition: all 0.2s ease;
}

body:not(.dark-mode):not(.cosmic-mode) .tabs-lang-switcher {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

body.cosmic-mode .tabs-lang-switcher {
    background: rgba(15, 20, 28, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.12);
}

.tabs-lang-switcher .lang-flag-btn {
    width: 28px;
    height: 20px;
    padding: 0;
    border: 1.5px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.45;
    filter: grayscale(25%);
    transition: all 0.2s ease;
}

.tabs-lang-switcher .lang-flag-btn:hover {
    opacity: 0.95;
    filter: none;
    transform: scale(1.08);
}

.tabs-lang-switcher .lang-flag-btn.active {
    opacity: 1;
    filter: none;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
    transform: scale(1.1);
}

.menu-acc-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.menu-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-pwd {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-pwd:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.menu-sps-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.menu-sps-logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.menu-sps-logout-btn:active {
    transform: translateY(0);
}

body.str-pure-white .menu-sps-logout-btn {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

body.str-pure-white .menu-sps-logout-btn:hover {
    background: #fecaca;
    border-color: #dc2626;
    color: #b91c1c;
}


/* Block 2: Assets */
.asset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.asset-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.asset-item.full-width {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(30, 58, 138, 0.15) 100%);
    border-color: rgba(56, 189, 248, 0.25);
}

.asset-label {
    font-size: 11px;
    color: #94a3b8;
}

.asset-val-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.asset-val-main {
    font-size: 16px;
    font-weight: 800;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
}

.asset-val-usd {
    font-size: 12px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.asset-val {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Block 3: HQĐT (Hiệu quả đầu tư) */
.hqdt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 14px;
}

.hqdt-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.hqdt-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.hqdt-val {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* Backward compatibility for perf-grid */
.perf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.perf-col {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.perf-label {
    font-size: 11px;
    color: #94a3b8;
}

.perf-val {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.perf-sub {
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Block 4: Fees */
.fee-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #cbd5e1;
}

.fee-row.fee-summary {
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    padding-top: 6px;
    margin-top: 2px;
    font-size: 13px;
}

.fee-num {
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
}

.text-highlight {
    color: #f59e0b;
    font-size: 13px;
}

/* Panel 2: Notifications Timeline */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px 6px;
}

.notif-header-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.notif-clear-btn {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.notif-clear-btn:hover {
    text-decoration: underline;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.timeline-entry {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.timeline-entry:hover {
    background: rgba(255, 255, 255, 0.06);
}

.timeline-entry.notif-unread {
    background: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.2);
}

.timeline-entry.notif-read {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
}

.notif-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    margin-left: 6px;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

.timeline-icon {
    font-size: 16px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.timeline-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-red { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.timeline-time {
    font-size: 10px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.timeline-text {
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.4;
}

.timeline-extra {
    font-size: 11px;
    font-weight: 600;
}

.text-green { color: #10b981; }
.text-amber { color: #f59e0b; }
.text-red { color: #ef4444; }
.text-muted { color: #94a3b8; }

/* Theme Overrides */
body.cosmic-mode .user-info-dropdown {
    background: rgba(10, 15, 29, 0.98) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.2), 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

body:not(.dark-mode):not(.cosmic-mode) .user-info-dropdown {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-tabs-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-tab-btn {
    color: #64748b;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-tab-btn.active {
    color: #0284c7;
    background: #e0f2fe;
    border-color: #bae6fd;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-acc-name,
body:not(.dark-mode):not(.cosmic-mode) .menu-sps-fullname {
    color: #0f172a;
}

body:not(.dark-mode):not(.cosmic-mode) .menu-sps-account-meta {
    color: #64748b;
    border-top-color: #e2e8f0;
}

body.str-pure-white .menu-sps-fullname,
body.str-pure-white .menu-acc-name {
    color: #0f172a;
}

body:not(.dark-mode):not(.cosmic-mode) .btn-pwd {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

body:not(.dark-mode):not(.cosmic-mode) .asset-item,
body:not(.dark-mode):not(.cosmic-mode) .perf-col,
body:not(.dark-mode):not(.cosmic-mode) .hqdt-grid {
    background: #ffffff;
    border-color: #e2e8f0;
}

body:not(.dark-mode):not(.cosmic-mode) .hqdt-label {
    color: #64748b;
}

body:not(.dark-mode):not(.cosmic-mode) .asset-item.full-width {
    background: #f0f9ff;
    border-color: #bae6fd;
}

body:not(.dark-mode):not(.cosmic-mode) .timeline-entry {
    background: #ffffff;
    border-color: #e2e8f0;
}

body:not(.dark-mode):not(.cosmic-mode) .timeline-text,
body:not(.dark-mode):not(.cosmic-mode) .fee-row {
    color: #1e293b;
}

@keyframes textGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(199, 210, 254, 0.8));
    }
}

.logo-track {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: visible;
    padding: 0 6px;
}

.logo-image {
    height: 48px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    animation: logoSlide 2.8s ease-in-out infinite alternate;
    transition: opacity 0.25s ease;
}

@keyframes logoSlide {
    from { transform: translateX(-8px); }
    to   { transform: translateX(8px); }
}

/* User Info in Navbar */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.user-greeting {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.user-greeting:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-account-type {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.user-account-type:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.admin-link {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* MT5 Trading Buttons */
.trading-actions {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.1));
    border-radius: 15px;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.trading-actions h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.1em;
}

.volume-input-group {
    margin-bottom: 15px;
}

.volume-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.volume-input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.volume-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.trading-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.trading-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.trading-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.trading-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-buy-market {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-sell-market {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-buy-limit {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-sell-limit {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.mt5-connection-warning {
    padding: 15px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.mt5-connection-warning a {
    color: white;
    text-decoration: underline;
}

/* Language selector - Giống tab-btn style */
#current-flag {
    display: none;
    /* Ẩn img flag, dùng background cho select */
}

#language-selector {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0;
    /* Ẩn text VN/EN */
    width: 50px;
    height: 36px;
    background-size: 32px 22px;
    background-position: center;
    background-repeat: no-repeat;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

#language-selector:hover {
    background-color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#language-selector option {
    font-size: 16px;
    /* Khi mở dropdown thì hiện text */
    padding: 10px;
    color: black;
    background: white;
}

@keyframes floatingGlow {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

.tab-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Analysis Layout */
.analysis-layout {
    display: flex;
    gap: 15px;
    height: auto;
    min-height: 100%;
    overflow: visible;
    align-items: stretch;
    position: relative;
}

.analysis-form-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: transform 0.3s ease;
    z-index: 100;
    align-self: stretch;
}

.analysis-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Mobile Toggle Button */
.mobile-toggle-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.mobile-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
}

.mobile-toggle-btn:active {
    transform: scale(0.95);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.card h2 {
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.card h3 {
    color: var(--primary-color);
    font-size: 1em;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* News section */
.news-structured {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-section-title h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2em;
}

.news-section-title p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 0.9em;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.news-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid #2563eb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-card h3 {
    margin: 0;
    font-size: 1.05em;
    color: #0f172a;
}

.news-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #475569;
}

.news-category {
    font-weight: 600;
}

.news-symbol-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-symbol {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 600;
    font-size: 0.8em;
}

.news-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sentiment-badge,
.impact-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 600;
}

.sentiment-badge.positive {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.sentiment-badge.negative {
    background: linear-gradient(135deg, #ef4444 0%, #f97373 100%);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.sentiment-badge.neutral {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(156, 163, 175, 0.45);
}

.impact-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.news-summary {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    font-size: 0.95em;
}

.news-points {
    margin: 0;
    padding-left: 18px;
    color: #475569;
    font-size: 0.9em;
    line-height: 1.5;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #475569;
    gap: 10px;
    margin-top: 8px;
}

.news-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    background: #eff6ff;
    border-radius: 8px;
}

.news-link:hover {
    background: #dbeafe;
}

.news-ai-section {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-analysis-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    line-height: 1.8;
    color: #1f2937;
    font-size: 0.95em;
}

.news-updated-time {
    font-size: 0.85em;
    color: #475569;
    margin-bottom: 6px;
}

/* Forms */
#analysis-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.form-group {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.form-group:has(.indicators-grid) {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 15px;
    overflow: hidden;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
    flex-shrink: 0;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Indicators Grid */
.indicators-grid {
    display: grid;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    min-height: 0;
}

.indicators-grid::-webkit-scrollbar {
    width: 6px;
}

.indicators-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.indicators-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.indicator-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.indicator-checkbox:hover {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.indicator-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: stretch;
    gap: 10px;
    flex-shrink: 0;
    margin-top: 10px;
    position: static;
    background: transparent;
    padding: 10px 0 0 0;
    width: 100%;
    box-sizing: border-box;
}

.form-actions .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    flex: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Result Content */
.result-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    box-sizing: border-box;
    /* Đảm bảo responsive khi resize */
    width: 100%;
    max-width: 100%;
}

.result-content::-webkit-scrollbar {
    width: 6px;
}

.result-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.result-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
    height: 100%;
    position: relative;
}

.empty-state p {
    position: relative;
    margin-top: 20px;
    max-width: 90%;
    font-weight: 500;
    margin-bottom: 0;
}

.empty-state-ai-image {
    width: 90%;
    max-width: 95%;
    height: auto;
    max-height: 75vh;
    margin-top: -30px;
    opacity: 0.7;
    /* animation: floatGlow 3s ease-in-out infinite; */
    object-fit: contain;
}

@keyframes floatGlow {

    0%,
    100% {
        transform: translateY(0px);
        opacity: 0.7;
        filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.2));
    }

    50% {
        transform: translateY(-8px);
        opacity: 0.9;
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
    }
}

/* Analysis Result Styles */
.analysis-header {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.analysis-header h3 {
    font-size: 0.95em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    color: white;
}

.badge-signal {
    background: var(--success-color);
}

.badge-signal.down,
.badge-signal.ban,
.badge-signal.bán {
    background: var(--danger-color);
}

.badge-score {
    background: var(--primary-color);
}

.badge-warning {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.7em;
    font-weight: 700;
    border: 1px solid #fca5a5;
}

/* Compact Sections Grid - 4 ô nhỏ cùng hàng - CỐ ĐỊNH */
.compact-sections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
    min-width: 0;
}

/* Compact Sections Grid - 5 ô nhỏ cùng hàng - CỐ ĐỊNH */
.compact-sections-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 12px;
    min-width: 0;
}

.info-section-compact {
    min-height: auto !important;
    border-left: 3px solid var(--primary-color) !important;
}

/* Override full-width cho compact sections */
.info-section-compact.conclusion,
.info-section-compact.recommendation {
    grid-column: auto !important;
}

/* Override màu vàng cho ô Kết Luận compact */
.info-section-compact.conclusion {
    background: white !important;
    border-left: 3px solid var(--primary-color) !important;
}

.info-section-compact.conclusion .section-title {
    color: inherit !important;
}

/* Dark Mode - Override conclusion background */
body.dark-mode .info-section-compact.conclusion {
    background: var(--bg-secondary) !important;
    border-left: 3px solid #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.15) !important;
}

body.dark-mode .info-section-compact.conclusion .section-title {
    color: #60a5fa !important;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.5) !important;
}

/* Info Sections - Grid Layout - Các ô lớn - CỐ ĐỊNH */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
    grid-auto-rows: min-content;
    min-width: 0;
}

/* Analysis Main Layout - Cân bằng tỷ lệ Vùng Giao Dịch & Chi Tiết Chỉ Báo */
.analysis-main-layout {
    display: grid;
    grid-template-columns: minmax(340px, 380px) 1fr;
    gap: 14px;
    margin-top: 14px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.analysis-main-layout.single-col {
    grid-template-columns: 1fr;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.analysis-action-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: sticky;
    top: 14px;
    z-index: 5;
}

.analysis-action-col .quick-trading-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.analysis-indicators-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
    align-content: start;
    min-width: 0;
}

.analysis-indicators-col > .info-section {
    height: auto;
    min-height: 100%;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .analysis-main-layout {
        grid-template-columns: 1fr;
    }

    .analysis-action-col {
        position: static;
    }

    .compact-sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .compact-sections-grid {
        grid-template-columns: 1fr;
    }

    .analysis-indicators-col {
        grid-template-columns: 1fr;
    }
}

.info-section {
    background: white;
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: fit-content;
    height: auto;
    min-width: 0;
    /* Cho phép grid shrink */
    transition: transform 0.2s ease;
    /* Tránh overflow khi resize */
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow: hidden;
    /* Đảm bảo nội dung không bị tràn */
    box-sizing: border-box;
    font-size: 0.95em;
    /* Giảm nhẹ ~2% từ 0.97em */
}

.info-section p,
.info-section li,
.info-section span,
.info-section div:not(.section-title):not(.indicator-title) {
    font-size: 0.95em;
    /* Giảm nhẹ ~2% từ 0.97em */
    line-height: 1.5;
}

/* Full width sections */
.analysis-header,
.chart-section {
    width: 100%;
}

.info-section.recommendation {
    grid-column: 1 / -1;
}

/* Highlight phần KẾT LUẬN TỔNG HỢP */
.info-section.conclusion {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    grid-column: 1 / -1;
    /* Chiếm full width */
    font-weight: 500;
}

.info-section.conclusion .indicator-title {
    color: #92400e;
    font-weight: 700;
    font-size: 1.11em;
    /* Giảm nhẹ ~2% từ 1.13em */
    margin-bottom: 10px;
}

.section-title {
    font-weight: 700;
    font-size: 0.88em;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.info-grid {
    display: grid;
    gap: 6px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.82em;
}

.info-icon {
    font-size: 1.1em;
}

.info-label {
    flex: 1;
    color: var(--text-secondary);
}

.info-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* Cosmic Mode - Info Item Container */
body.cosmic-mode .info-item,
body.cosmic-mode .info-section-compact .info-item,
body.cosmic-mode .price-info .info-item {
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(27, 227, 255, 0.1) !important;
}

body.cosmic-mode .info-item:hover,
body.cosmic-mode .info-section-compact .info-item:hover,
body.cosmic-mode .price-info .info-item:hover {
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 0 24px rgba(27, 227, 255, 0.2) !important;
}

/* Cosmic Mode - Override any white backgrounds in info sections */
body.cosmic-mode .info-section-compact div,
body.cosmic-mode .price-info div,
body.cosmic-mode .info-section div {
    background-color: transparent !important;
}

body.cosmic-mode .info-section-compact div[style*="white"],
body.cosmic-mode .price-info div[style*="white"],
body.cosmic-mode .info-section div[style*="white"],
body.cosmic-mode .info-section-compact div[style*="#fff"],
body.cosmic-mode .price-info div[style*="#fff"],
body.cosmic-mode .info-section div[style*="#fff"] {
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #ffffff !important;
}

.info-value.positive {
    color: var(--success-color);
}

.info-value.negative {
    color: var(--danger-color);
}

/* ML Info & Trading Zone */
.ml-info,
.trading-zone {
    font-size: 0.98em;
    /* Giảm nhẹ ~2% từ 1.0em */
    line-height: 1.5;
}

.ml-item,
.zone-item {
    padding: 2px 0;
    padding-left: 0;
    font-size: 0.95em;
    /* Giảm nhẹ ~2% từ 0.97em */
    line-height: 1.5;
}

.zone-detail {
    padding-left: 0;
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 1.03em;
    /* Giảm nhẹ ~2% từ 1.05em */
    line-height: 1.5;
}

.ml-item strong,
.zone-item strong,
.zone-detail strong {
    color: var(--primary-color);
}

/* Signal styles for Indicator Trading Zone */
.buy-signal {
    color: var(--success-color);
    font-size: 1.1em;
    padding: 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
    text-align: center;
}

.sell-signal {
    color: var(--danger-color);
    font-size: 1.1em;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    text-align: center;
}

.neutral-signal {
    color: var(--warning-color);
    font-size: 1.1em;
    padding: 8px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
    text-align: center;
}

/* Indicator Analysis */
.indicator-detail {
    font-size: 0.84em;
    line-height: 1.5;
}

.indicator-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.01em;
    /* Giảm nhẹ ~2% từ 1.03em */
    margin-bottom: 6px;
}

.indicator-signal {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #6ee7b7;
    color: #059669;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82em;
    margin: 5px 0;
}

.indicator-subtitle {
    font-weight: 700;
    font-size: 0.84em;
    margin-top: 6px;
    margin-bottom: 4px;
}

.indicator-item {
    padding: 2px 0;
    padding-left: 12px;
    font-size: 0.82em;
}

.indicator-detail .indicator-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.9em;
    line-height: 1.6;
    transition: all 0.2s ease;
}

body.dark-mode .indicator-detail .indicator-item {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(59, 130, 246, 0.2);
    color: #e2e8f0;
}

body.cosmic-mode .indicator-detail .indicator-item {
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(59, 130, 246, 0.22) !important;
    color: #f1f5f9 !important;
}

body.cosmic-mode .indicator-detail .indicator-item:hover {
    border-color: rgba(59, 130, 246, 0.45) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

/* Conclusion */
.conclusion {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: var(--warning-color);
}

.conclusion-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.88em;
    margin-bottom: 6px;
}

.conclusion-icon {
    font-size: 1.1em;
}

.conclusion-detail {
    padding: 2px 0 2px 20px;
    font-size: 0.82em;
}

.conclusion-detail strong {
    color: var(--primary-color);
}

/* Recommendation */
.recommendation {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid var(--success-color);
    padding: 10px 12px !important;
    display: flex;
    gap: 10px;
}

.recommendation.down,
.recommendation.ban,
.recommendation.bán {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: var(--danger-color);
}

.recommendation.neutral,
.recommendation.trung {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--warning-color);
}

.recommendation-icon {
    font-size: 1.8em;
}

.recommendation-text strong {
    color: var(--success-color);
    font-size: 0.9em;
    display: block;
    margin-bottom: 4px;
}

.recommendation.down strong,
.recommendation.ban strong,
.recommendation.bán strong {
    color: var(--danger-color);
}

.recommendation.neutral strong,
.recommendation.trung strong {
    color: var(--warning-color);
}

.recommendation-detail {
    font-size: 0.8em;
    line-height: 1.5;
}

/* Chart */
.chart-section {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #e5e7eb;
}

.chart-image {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Chat */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-form input {
    flex: 1;
}

.message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    max-width: 80%;
    font-size: 0.9em;
}

.message.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.message.assistant {
    background: white;
    box-shadow: var(--shadow-sm);
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    /* Higher than mobile panel (999) and modal (10000) */
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading p {
    color: white;
    margin-top: 15px;
    font-weight: 600;
}

/* Error */
.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--danger-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.error-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 5px;
}

/* Responsive */
@media (max-width: 1024px) {
    .analysis-layout {
        flex-direction: column;
    }

    .analysis-form-panel {
        flex: 0 0 auto;
        max-height: 400px;
    }
}

/* Mobile and Tablet devices */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    body {
        padding: 0;
        font-size: 12px;
    }

    .container {
        padding: 0;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .tabs-links {
        flex-wrap: wrap;
        /* Cho phép tự xuống dòng khi thiếu chiều ngang */
        overflow-x: visible;
        /* Không cần scroll ngang */
        gap: 8px;
        padding-bottom: 6px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .tabs-links::-webkit-scrollbar {
        display: none;
    }

    .tabs-links .tab-btn {
        flex: 1 1 calc(33.333% - 8px);
        /* Mỗi hàng tối đa 3 tab, tự co giãn */
        font-size: 0.85em;
        padding: 10px 12px;
        min-height: 40px;
        white-space: nowrap;
        text-align: center;
    }

    .tabs-links .tabs-theme-toggle,
    .tabs-links .tabs-lang-switcher {
        flex: 0 0 auto;
        min-height: 40px;
    }

    .brand-group {
        order: 2;
        /* Nằm giữa tabs-links và nút 3 gạch */
        width: auto;
        /* Không chiếm full hàng để khỏi bị đẩy xuống dưới */
        margin-left: auto;
        justify-content: center;
    }

    .brand-group .logo-image {
        height: 32px;
    }

    .user-menu {
        order: 3;
        margin-left: 8px;
    }

    /* Language selector - chỉ hiện lá cờ trên mobile */
    #language-selector {
        font-size: 0 !important;
        /* Ẩn text hiển thị */
        padding: 6px !important;
        min-width: auto !important;
        width: 40px !important;
        height: 36px !important;
        grid-column: 5;
        border: 2px solid white;
        border-radius: 8px;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        position: relative;
        background-size: 28px 20px !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        background-color: white !important;
    }

    /* Ẩn img flag bên ngoài trên mobile vì đã dùng background cho select */
    #current-flag {
        display: none !important;
    }

    /* Container của language selector */
    #language-selector::-ms-expand {
        display: none;
    }

    /* Khi mở dropdown, options hiển thị text đầy đủ */
    #language-selector option {
        font-size: 16px !important;
        padding: 10px !important;
        color: black !important;
        background: white !important;
    }

    /* Mobile Analysis Layout */
    .analysis-layout {
        flex-direction: column;
        padding: 0;
    }

    .analysis-form-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        /* Full viewport height */
        max-height: 100vh !important;
        background: white !important;
        transform: translateY(100%) !important;
        /* Hidden by default */
        z-index: 999 !important;
        overflow: visible !important;
        padding: 0 !important;
        transition: transform 0.3s ease !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .analysis-form-panel.show {
        transform: translateY(0) !important;
        /* Show when clicked */
    }

    .analysis-form-panel .card {
        padding: 10px;
        box-shadow: none;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        /* Prevent overflow */
    }

    .analysis-form-panel .card h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .analysis-form-panel #analysis-form {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0 6px 90px !important;
    }

    .analysis-form-panel .form-group {
        flex-shrink: 0;
        margin-bottom: 12px;
    }

    .analysis-form-panel .form-group:has(#indicators-list) {
        flex: 0 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: visible;
    }

    .analysis-form-panel #indicators-list {
        flex: 0 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 50vh;
        /* Limit to 50% of screen */
        -webkit-overflow-scrolling: touch;
    }

    .analysis-result-panel {
        width: 100%;
        flex: 1;
        padding: 10px;
        font-size: 1.2em;
    }

    .analysis-result-panel .card {
        padding: 15px;
        height: auto;
        min-height: 0;
    }

    #analysis-content {
        overflow: visible;
    }

    .analysis-header {
        flex-direction: column;
        gap: 12px;
    }

    .analysis-header-info h3 {
        font-size: 1em;
    }

    .status-badges {
        justify-content: flex-start;
        gap: 6px;
    }

    .risk-warning-card {
        width: 100%;
        padding: 12px;
    }

    .risk-warning-title {
        font-size: 0.85em;
    }

    .risk-warning-list {
        font-size: 0.75em;
    }

    .analysis-result-panel .section-title {
        font-size: 1.05em;
    }

    .analysis-result-panel .zone-item,
    .analysis-result-panel .info-section,
    .analysis-result-panel .ml-item {
        font-size: 1.03em;
        /* Giảm nhẹ ~2% từ 1.05em */
        line-height: 1.5;
    }

    .analysis-result-panel h3 {
        font-size: 1.2em;
    }

    .analysis-result-panel .badge {
        font-size: 0.85em;
        padding: 5px 10px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .news-card {
        padding: 14px;
    }

    .news-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .news-link {
        width: 100%;
        text-align: center;
    }

    /* Form elements compact */
    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        font-size: 0.85em;
        font-weight: 600;
        margin-bottom: 4px;
        display: block;
    }

    .form-group select,
    .form-group input {
        font-size: 13px;
        padding: 8px;
        min-height: 38px;
        border-radius: 5px;
    }

    #symbol-search {
        width: 100%;
        font-size: 14px;
    }

    /* Indicators list compact */
    .indicators-grid {
        gap: 6px;
        max-height: none;
    }

    .indicator-checkbox {
        padding: 8px;
        border-radius: 5px;
        min-height: 38px;
    }

    .indicator-checkbox label {
        font-size: 0.8em;
    }

    .indicator-settings-btn {
        font-size: 1em;
        padding: 5px;
        right: 5px;
    }

    /* Buttons compact */
    .btn {
        font-size: 0.85em;
        padding: 10px 14px;
        min-height: 38px;
        border-radius: 5px;
        font-weight: 600;
    }

    .form-actions {
        position: sticky;
        bottom: 0;
        gap: 8px;
        margin-top: 15px;
        padding: 12px 0;
        flex-shrink: 0;
        background: transparent;
        z-index: 10;
        width: 100%;
        box-sizing: border-box;
    }

    /* Show mobile toggle button - compact */
    .mobile-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        font-size: 1.4em;
        box-shadow: 0 3px 12px rgba(59, 130, 246, 0.5);
    }

    /* Overlay for mobile */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
    }

    .mobile-overlay.show {
        display: block;
    }

    /* Result sections compact */
    .info-section,
    .info-section-compact {
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .info-section h3,
    .info-section-compact .indicator-title {
        font-size: 1.01em;
        /* Giảm nhẹ ~2% từ 1.03em */
        margin-bottom: 6px;
    }

    .info-section p,
    .info-section ul li {
        font-size: 0.90em;
        /* Giảm nhẹ ~2% từ 0.92em */
        line-height: 1.5;
    }

    /* Compact sections grid for mobile */
    .compact-sections-grid,
    .compact-sections-grid-5,
    .sections-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Chart image responsive */
    .chart-container img {
        border-radius: 8px;
    }

    /* Price display */
    .price-display {
        font-size: 1.4em;
    }

    /* Modal mobile-optimized */
    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 15px;
        max-height: 90vh;
    }

    .modal-body {
        padding: 15px;
    }

    .param-group input,
    .param-group select {
        font-size: 14px;
        padding: 10px;
        min-height: 42px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3em;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f9fafb;
}

.param-group {
    margin-bottom: 20px;
}

.param-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.param-group input,
.param-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}

.param-group input:focus,
.param-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.param-hint {
    margin-top: 5px;
    font-size: 0.85em;
    color: #6b7280;
}

.indicator-checkbox-wrapper {
    position: relative;
}

.indicator-settings-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 1.1em;
    cursor: pointer;
    opacity: 1;
    transition: all 0.2s;
}

.indicator-settings-btn:hover {
    color: #3b82f6;
    transform: translateY(-50%) scale(1.15);
}

/* ========================================
   Price Patterns Tab Styles
   ======================================== */

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* History Tab */
.history-card-wrapper {
    overflow-y: auto;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    flex-wrap: wrap;
}

.history-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.2em;
    flex: 1;
}

.history-reload-btn {
    background: #fff;
    color: #2563eb;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.history-reload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-item {
    --history-accent: #3b82f6;
    background: white;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 5px solid var(--history-accent);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.history-summary {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.history-symbol {
    font-size: 1.15em;
    font-weight: 700;
    color: #1f2937;
}

.history-time {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 6px;
}

.history-status {
    text-align: right;
    min-width: 140px;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border-radius: 999px;
    font-weight: 700;
    color: #fff;
    font-size: 0.92em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-confidence {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 6px;
}

.history-params-card {
    margin-top: 16px;
    background: #f0f9ff;
    border-radius: 12px;
    padding: 14px;
    border: 2px solid rgba(59, 130, 246, 0.25);
}

.history-params-title {
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.history-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.history-param {
    background: white;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.history-param-label {
    font-size: 0.85em;
    color: #6b7280;
    display: block;
    margin-bottom: 4px;
}

.history-param-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
}

.history-param-value.value-buy {
    color: #16a34a;
}

.history-param-value.value-sell {
    color: #dc2626;
}

.history-param-value.value-neutral {
    color: #eab308;
}

.history-recommendation {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    font-size: 0.9em;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.history-recommendation strong {
    font-weight: 700;
    color: #92400e;
}

.history-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.history-btn {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.history-btn.delete {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.history-btn.delete:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
}

.pattern-category {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.pattern-item {
    background: white;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pattern-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6;
}

.pattern-visual {
    flex: 0 0 250px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    padding: 10px;
    overflow: hidden;
}

.pattern-visual img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pattern-svg {
    width: 100%;
    height: 100%;
}

.pattern-info {
    flex: 1;
}

.pattern-item h4 {
    margin: 0 0 6px 0;
    color: #1e293b;
    font-size: 0.95em;
    font-weight: 600;
}

.pattern-item p {
    margin: 0;
    color: #64748b;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.5;
}

/* Pattern category specific colors */
.pattern-category:has(h3[data-i18n="patterns_bullish"]) .pattern-item {
    border-left-color: #10b981;
}

.pattern-category:has(h3[data-i18n="patterns_bullish"]) .pattern-item:hover {
    border-left-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.pattern-category:has(h3[data-i18n="patterns_bearish"]) .pattern-item {
    border-left-color: #ef4444;
}

.pattern-category:has(h3[data-i18n="patterns_bearish"]) .pattern-item:hover {
    border-left-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.pattern-category:has(h3[data-i18n="patterns_reversal"]) .pattern-item {
    border-left-color: #3b82f6;
}

.pattern-category:has(h3[data-i18n="patterns_reversal"]) .pattern-item:hover {
    border-left-color: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Mobile responsive */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .patterns-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .pattern-category {
        padding: 12px;
    }

    .pattern-item {
        padding: 10px;
        margin-bottom: 10px;
        flex-direction: row;
        gap: 10px;
    }

    .pattern-visual {
        flex: 0 0 180px;
        min-height: 120px;
    }

    .pattern-item h4 {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .pattern-item p {
        font-size: 0.8em;
    }
}

/* Chart Tab Full Screen Fix */
#chart-tab {
    padding: 0 !important;
}

#chart-tab.active {
    height: calc(100vh - 100px) !important;
    min-height: calc(100vh - 100px) !important;
    max-height: calc(100vh - 100px) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

#chart-tab .card {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 15px !important;
    margin: 0 !important;
    flex: 1 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

#chart-tab .card h2 {
    flex-shrink: 0 !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    height: auto !important;
}

#chart-tab .card>div:first-of-type,
#chart-tab #pro-chart-container {
    flex: 1 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
    background: #1a1d2e !important;
    border-radius: 8px !important;
    position: relative !important;
}

#tradingview_chart {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

#chart-tab .tradingview-widget-copyright {
    flex-shrink: 0 !important;
    margin-top: 8px !important;
    padding: 0 !important;
    height: auto !important;
}

/* ========================================
   DARK MODE STYLES
   ======================================== */

/* Theme Toggle Button */
.theme-toggle {
    padding: 8px 16px;
    /* gần giống tab, nhưng không quá dài */
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    /* giống .tab-btn */
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon bên trong nút sáng/tối */
.theme-toggle .theme-icon {
    font-size: 1.2em;
    /* Tăng kích thước icon lên 20% (1.1em + 10%) */
    line-height: 1;
}

/* Nút theme trên thanh tab – canh hàng với các tab */
.tabs-links .tabs-theme-toggle {
    margin-left: 8px;
    padding: 8px 20px;
    /* Dùng đúng padding của .tab-btn */
    font-size: 0.9em;
    /* Dùng đúng font-size của .tab-btn */
}

.theme-toggle:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

body.dark-mode .theme-toggle {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

body.dark-mode .theme-toggle:hover {
    background: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.7), 0 0 30px rgba(59, 130, 246, 0.4);
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.9);
    transform: translateY(-2px);
}

/* Cosmic Mode - Theme Toggle */
body.cosmic-mode .theme-toggle {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

body.cosmic-mode .theme-toggle:hover {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
    transform: translateY(-2px);
}

/* Dark Mode - Tabs Toggle (Hamburger Menu) */
body.dark-mode .tabs-toggle {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

body.dark-mode .tabs-toggle:hover {
    background: rgba(59, 130, 246, 0.3);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6), 0 0 24px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Cosmic Mode - Tabs Toggle (Hamburger Menu) */
body.cosmic-mode .tabs-toggle {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), 0 0 20px rgba(27, 227, 255, 0.12);
}

body.cosmic-mode .tabs-toggle:hover {
    background: rgba(59, 130, 246, 0.25);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 25px rgba(27, 227, 255, 0.2);
    transform: translateY(-2px);
}

/* Dark Mode - Cards */
body.dark-mode .card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Cosmic Mode - Cards */
body.cosmic-mode .card {
    background: rgba(0, 0, 0, 0.85) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2), 0 0 20px rgba(27, 227, 255, 0.08) !important;
}

body.cosmic-mode .card:hover {
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.12) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Cosmic Mode - Override any white backgrounds/borders */
body.cosmic-mode .info-section,
body.cosmic-mode .zone-item,
body.cosmic-mode .ml-item {
    border-color: rgba(59, 130, 246, 0.3) !important;
}

body.cosmic-mode input,
body.cosmic-mode select,
body.cosmic-mode textarea {
    border-color: rgba(59, 130, 246, 0.3) !important;
}

body.cosmic-mode * {
    border-color: inherit;
}

/* Dark Mode - Tabs (đồng bộ theme, không glow lệch màu) */
body.dark-mode .tabs {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .tab-btn {
    background: #121722;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    text-shadow: none;
}

body.dark-mode .tab-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    border: 1px solid #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
    text-shadow: none;
}

body.dark-mode .tab-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: none;
    text-shadow: none;
    transform: none;
}

body.dark-mode .theme-toggle.tabs-theme-toggle,
body.dark-mode .tabs-links .tabs-theme-toggle {
    background: #121722;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

/* Cosmic Mode - Tabs (đồng bộ với dark, accent xanh) */
body.cosmic-mode .tab-btn {
    background: rgba(15, 20, 28, 0.9) !important;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    text-shadow: none;
}

body.cosmic-mode .tab-btn.active {
    background: rgba(59, 130, 246, 0.22) !important;
    color: #fff;
    border: 1px solid #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
    text-shadow: none;
}

body.cosmic-mode .tab-btn:hover {
    background: rgba(59, 130, 246, 0.14) !important;
    color: #fff;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: none;
    text-shadow: none;
    transform: none;
}

/* Dark Mode - Forms */
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

body.dark-mode .form-group label {
    color: var(--text-primary);
}

/* Cosmic Mode - Forms */
body.cosmic-mode .form-group input,
body.cosmic-mode .form-group select,
body.cosmic-mode .form-group textarea {
    background: rgba(0, 0, 0, 0.8) !important;
    color: var(--text-primary) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

body.cosmic-mode .form-group input:focus,
body.cosmic-mode .form-group select:focus,
body.cosmic-mode .form-group textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(27, 227, 255, 0.2) !important;
    background: rgba(0, 0, 0, 0.9) !important;
}

body.cosmic-mode .form-group label {
    color: #e5e7eb;
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

/* Dark Mode - Buttons */
body.dark-mode .btn {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    border: none;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

body.dark-mode .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

body.dark-mode .btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Cosmic Mode - Buttons */
body.cosmic-mode .btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%);
    color: white;
    border: none;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 25px rgba(27, 227, 255, 0.15);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

body.cosmic-mode .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 35px rgba(27, 227, 255, 0.2);
    background: linear-gradient(135deg, #2563eb 0%, #1BE3FF 50%, #8b5cf6 100%);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

body.cosmic-mode .btn-secondary {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #e5e7eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Dark Mode - News Cards */
body.dark-mode .news-card {
    background: var(--bg-secondary);
    border-color: rgba(59, 130, 246, 0.4);
    border-left-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 18px rgba(15, 23, 42, 0.8), 0 0 24px rgba(59, 130, 246, 0.25);
}

/* Cosmic Mode - News Cards */
body.cosmic-mode .news-card {
    background: rgba(0, 0, 0, 0.85) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    border-left-color: rgba(59, 130, 246, 0.7) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 35px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .news-card:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

body.dark-mode .news-card h3 {
    color: var(--text-primary);
}

body.dark-mode .news-summary {
    color: var(--text-secondary);
}

body.dark-mode .news-category {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

body.dark-mode .news-time {
    color: var(--text-secondary);
}

/* Cosmic Mode - News Elements */
body.cosmic-mode .news-card h3 {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

body.cosmic-mode .news-summary {
    color: #e5e7eb;
}

body.cosmic-mode .news-category {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.7);
}

body.cosmic-mode .news-time {
    color: #e5e7eb;
}

/* Cosmic Mode - News Section Title */
body.cosmic-mode .news-section-title h3 {
    color: #3b82f6 !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
}

body.cosmic-mode .news-section-title p {
    color: #ffffff !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
}

/* Cosmic Mode - News Card Top & Footer */
body.cosmic-mode .news-card-top,
body.cosmic-mode .news-card-footer {
    color: #e5e7eb !important;
}

/* Cosmic Mode - News Link */
body.cosmic-mode .news-link {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .news-link:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(27, 227, 255, 0.25) !important;
}

/* Cosmic Mode - News Symbol */
body.cosmic-mode .news-symbol {
    background: rgba(0, 0, 0, 0.7) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3), 0 0 16px rgba(27, 227, 255, 0.15) !important;
}

/* Cosmic Mode - News Points */
body.cosmic-mode .news-points {
    color: #e5e7eb !important;
}

body.cosmic-mode .news-points li {
    color: #e5e7eb !important;
}

/* Cosmic Mode - News Analysis Card */
body.cosmic-mode .news-analysis-card {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .news-analysis-card,
body.cosmic-mode .news-analysis-card * {
    color: #ffffff !important;
}

/* Cosmic Mode - News Updated Time */
body.cosmic-mode .news-updated-time {
    color: #e5e7eb !important;
}

body.dark-mode .news-symbol {
    background: rgba(15, 23, 42, 0.9);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

body.dark-mode .news-points {
    color: var(--text-secondary);
}

body.dark-mode .news-card-footer {
    color: var(--text-secondary);
}

body.dark-mode .news-link {
    background: rgba(15, 23, 42, 0.9);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

body.dark-mode .news-link:hover {
    background: rgba(37, 99, 235, 0.6);
    color: #fff;
}

body.dark-mode .news-analysis-card {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(15, 23, 42, 0.9), 0 0 24px rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Nội dung khuyến nghị AI trong dark mode – cho chữ trắng rõ ràng */
body.dark-mode .news-analysis-card,
body.dark-mode .news-analysis-card * {
    color: #ffffff !important;
}

body.dark-mode .news-updated-time {
    color: var(--text-secondary);
}

/* Dark Mode - Analysis Result */
body.dark-mode .analysis-result {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2), 0 0 20px rgba(59, 130, 246, 0.1);
}

body.dark-mode .analysis-header {
    background: var(--bg-secondary) !important;
    border: 2px solid rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4) !important;
    color: #ffffff !important;
}

/* Cosmic Mode - Analysis Result */
body.cosmic-mode .analysis-result {
    background: rgba(0, 0, 0, 0.85) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25) !important;
}

body.cosmic-mode .analysis-header {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 2px solid rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5) !important;
    color: #ffffff !important;
}

body.dark-mode .analysis-header * {
    color: #ffffff !important;
}

body.dark-mode .analysis-header h3 {
    color: #60a5fa !important;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.8) !important;
}

body.dark-mode .analysis-header-info {
    color: #ffffff !important;
}

body.dark-mode .analysis-header-info * {
    color: #ffffff !important;
}

body.dark-mode .analysis-header .status-badges {
    color: inherit !important;
}

body.dark-mode .analysis-header .status-badges * {
    color: inherit !important;
}

body.dark-mode .compact-sections-grid {
    gap: 15px;
}

body.dark-mode .result-header {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(96, 165, 250, 0.5);
}

body.dark-mode .technical-details,
body.dark-mode .price-info,
body.dark-mode .indicators-section {
    background: var(--bg-primary);
    border-color: var(--border-color);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(59, 130, 246, 0.1);
}

body.dark-mode .technical-details:hover,
body.dark-mode .price-info:hover,
body.dark-mode .indicators-section:hover {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 0 24px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

body.dark-mode .technical-details h3,
body.dark-mode .price-info h3,
body.dark-mode .indicators-section h3 {
    color: #60a5fa;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.5);
}

/* Cosmic Mode - Technical Details, Price Info, Indicators */
body.cosmic-mode .technical-details,
body.cosmic-mode .price-info,
body.cosmic-mode .indicators-section {
    background: rgba(0, 0, 0, 0.85) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2) !important;
}

body.cosmic-mode .technical-details:hover,
body.cosmic-mode .price-info:hover,
body.cosmic-mode .indicators-section:hover {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}

body.cosmic-mode .technical-details h3,
body.cosmic-mode .price-info h3,
body.cosmic-mode .indicators-section h3 {
    color: #3b82f6;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* Dark Mode - History Items */
body.dark-mode .history-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .history-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

body.dark-mode .history-item h3 {
    color: var(--text-primary);
}

/* Dark Mode - User Dropdown */
body.dark-mode .user-info-dropdown {
    background: rgba(26, 29, 46, 0.98);
    border: 1px solid var(--border-color);
}

body.dark-mode .admin-link,
body.dark-mode .logout-btn {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

body.dark-mode .admin-link:hover,
body.dark-mode .logout-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
}

body.dark-mode .user-greeting {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

body.dark-mode .user-greeting:hover {
    background: rgba(59, 130, 246, 0.3);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6), 0 0 24px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

body.dark-mode .user-account-type {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    border: none;
}

/* Cosmic Mode - User Menu Dropdown */
body.cosmic-mode .user-info-dropdown {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(27, 227, 255, 0.15) !important;
}

/* Cosmic Mode - User Menu Buttons */
body.cosmic-mode .user-greeting,
body.cosmic-mode .user-account-type,
body.cosmic-mode .admin-link,
body.cosmic-mode .logout-btn {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #ffffff !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .user-greeting:hover,
body.cosmic-mode .admin-link:hover,
body.cosmic-mode .logout-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(27, 227, 255, 0.25) !important;
    transform: translateY(-2px);
    color: #ffffff !important;
}

body.cosmic-mode .user-account-type {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(27, 227, 255, 0.3) !important;
}

body.cosmic-mode .user-account-type:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(27, 227, 255, 0.4) !important;
    transform: translateY(-2px);
}

/* Dark Mode - Indicators */
body.dark-mode .indicator-item {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .indicator-item.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.4);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

body.dark-mode .indicator-item:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3), 0 0 16px rgba(59, 130, 246, 0.2);
}

/* Dark Mode - Indicator Checkbox */
body.dark-mode .indicator-checkbox {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: var(--text-primary);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

body.dark-mode .indicator-checkbox:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5), 0 0 24px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

body.dark-mode .indicator-checkbox input[type="checkbox"]:checked+label {
    color: #60a5fa;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
}

body.dark-mode .indicator-checkbox:has(input[type="checkbox"]:checked) {
    background: rgba(59, 130, 246, 0.3);
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.4);
}

/* Cosmic Mode - Indicator Checkbox */
body.cosmic-mode .indicator-checkbox {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(27, 227, 255, 0.1) !important;
    transition: all 0.3s ease;
}

body.cosmic-mode .indicator-checkbox:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 0 24px rgba(27, 227, 255, 0.2);
    transform: translateY(-1px);
}

body.cosmic-mode .indicator-checkbox input[type="checkbox"]:checked+label {
    color: #3b82f6;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

body.cosmic-mode .indicator-checkbox:has(input[type="checkbox"]:checked) {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* Cosmic Mode - Indicator Item */
body.cosmic-mode .indicator-item {
    background: rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: var(--text-primary) !important;
}

body.cosmic-mode .indicator-item.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.7), 0 0 24px rgba(27, 227, 255, 0.5), 0 0 35px rgba(167, 139, 250, 0.3);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

body.cosmic-mode .indicator-item:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 0 20px rgba(27, 227, 255, 0.2);
}

/* Cosmic Mode - Indicator Settings Button */
body.cosmic-mode .indicator-settings-btn {
    color: #a78bfa;
    transition: all 0.3s ease;
}

body.cosmic-mode .indicator-settings-btn:hover {
    color: #8b5cf6;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.8);
    transform: scale(1.1);
}

/* Cosmic Mode - Indicator Category */
body.cosmic-mode .indicator-category h4 {
    color: #3b82f6;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* Cosmic Mode - Form Actions (chỉ tab Phân tích — nền trong suốt, hòa card) */
body.cosmic-mode .form-actions {
    background: transparent !important;
    border-top: none !important;
}

/* Dark Mode - Pattern Cards */
body.dark-mode .pattern-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Dark Mode - Pattern Category wrapper (nền cột) */
body.dark-mode .pattern-category {
    background: transparent;
    /* bỏ nền xám để không lệch tone */
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px rgba(15, 23, 42, 0.9), 0 0 18px rgba(59, 130, 246, 0.25);
}

body.dark-mode .pattern-item h4 {
    color: var(--text-primary);
}

body.dark-mode .pattern-item p {
    color: var(--text-secondary);
}

body.dark-mode .pattern-item {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .pattern-visual {
    background: rgba(15, 23, 42, 0.5);
}

/* Cosmic Mode - Price Patterns */
body.cosmic-mode #patterns-tab .card p[data-i18n="patterns_description"],
body.cosmic-mode #patterns-tab .card p,
body.cosmic-mode #patterns-tab p {
    color: #ffffff !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
}

/* Cosmic Mode - Important Notes Section */
body.cosmic-mode #patterns-tab .card div[style*="background: rgba(59, 130, 246"] {
    background: rgba(0, 0, 0, 0.85) !important;
    border-left: 4px solid rgba(59, 130, 246, 0.6) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode #patterns-tab h4[data-i18n="patterns_note_title"],
body.cosmic-mode #patterns-tab .card h4 {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.5) !important;
}

body.cosmic-mode #patterns-tab ul[style*="color: #666"],
body.cosmic-mode #patterns-tab .card ul,
body.cosmic-mode #patterns-tab ul li,
body.cosmic-mode #patterns-tab .card ul li {
    color: #ffffff !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
}

body.cosmic-mode .pattern-category {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .pattern-item {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-left: 4px solid rgba(59, 130, 246, 0.5) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2), 0 0 20px rgba(27, 227, 255, 0.1) !important;
}

body.cosmic-mode .pattern-item:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
    border-left-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2) !important;
    transform: translateX(5px);
}

body.cosmic-mode .pattern-item h4 {
    color: #ffffff !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
}

body.cosmic-mode .pattern-item p {
    color: #e5e7eb !important;
}

body.cosmic-mode .pattern-visual {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(27, 227, 255, 0.1) !important;
}

/* Cosmic Mode - Pattern Category Specific Colors */
body.cosmic-mode .pattern-category:has(h3[data-i18n="patterns_bullish"]) .pattern-item {
    border-left-color: rgba(16, 185, 129, 0.6) !important;
}

body.cosmic-mode .pattern-category:has(h3[data-i18n="patterns_bullish"]) .pattern-item:hover {
    border-left-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4), 0 0 30px rgba(16, 185, 129, 0.2) !important;
}

body.cosmic-mode .pattern-category:has(h3[data-i18n="patterns_bearish"]) .pattern-item {
    border-left-color: rgba(239, 68, 68, 0.6) !important;
}

body.cosmic-mode .pattern-category:has(h3[data-i18n="patterns_bearish"]) .pattern-item:hover {
    border-left-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4), 0 0 30px rgba(239, 68, 68, 0.2) !important;
}

body.cosmic-mode .pattern-category:has(h3[data-i18n="patterns_reversal"]) .pattern-item {
    border-left-color: rgba(59, 130, 246, 0.6) !important;
}

body.cosmic-mode .pattern-category:has(h3[data-i18n="patterns_reversal"]) .pattern-item:hover {
    border-left-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2) !important;
}

/* Dark Mode - Sentiment Badges */
body.dark-mode .sentiment-badge {
    opacity: 1;
    text-shadow: 0 0 4px rgba(15, 23, 42, 0.7);
}

/* Dark Mode Overrides - History */
body.dark-mode .history-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(14, 165, 233, 0.35) 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px rgba(15, 23, 42, 0.8);
}

body.dark-mode .history-reload-btn {
    background: rgba(15, 23, 42, 0.85);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.35);
}

body.dark-mode .history-item {
    background: var(--bg-secondary);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(15, 23, 42, 0.85);
}

body.dark-mode .history-item:hover {
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
}

body.dark-mode .history-symbol {
    color: var(--text-primary);
}

body.dark-mode .history-time,
body.dark-mode .history-confidence,
body.dark-mode .history-param-label {
    color: var(--text-secondary);
}

body.dark-mode .history-params-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

body.dark-mode .history-params-title {
    color: #93c5fd;
}

body.dark-mode .history-param {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: none;
}

body.dark-mode .history-param-value {
    color: var(--text-primary);
}

body.dark-mode .history-param-value.value-neutral {
    color: #fde68a;
}

body.dark-mode .history-recommendation {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: var(--text-primary);
}

body.dark-mode .history-recommendation strong {
    color: #fde68a;
}

body.dark-mode .history-btn {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.45);
}

body.dark-mode .history-btn.delete {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.45);
}

/* Cosmic Mode - History Section */
body.cosmic-mode .history-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(27, 227, 255, 0.2) !important;
}

body.cosmic-mode .history-header h2 {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5) !important;
}

body.cosmic-mode .history-reload-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2) !important;
}

body.cosmic-mode .history-reload-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(27, 227, 255, 0.3) !important;
    transform: translateY(-2px);
}

body.cosmic-mode .history-item {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-left: 5px solid rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .history-item:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
    border-left-color: #3b82f6 !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(27, 227, 255, 0.2) !important;
    transform: translateY(-2px);
}

body.cosmic-mode .history-item h3,
body.cosmic-mode .history-symbol {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4) !important;
}

body.cosmic-mode .history-time,
body.cosmic-mode .history-confidence,
body.cosmic-mode .history-param-label {
    color: #e5e7eb !important;
}

body.cosmic-mode .history-badge {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 0 24px rgba(27, 227, 255, 0.2) !important;
}

body.cosmic-mode .history-params-card {
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), 0 0 24px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .history-params-title {
    color: #3b82f6 !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
}

body.cosmic-mode .history-param {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(27, 227, 255, 0.1) !important;
}

body.cosmic-mode .history-param-value {
    color: #ffffff !important;
}

body.cosmic-mode .history-param-value.value-buy {
    color: #22c55e !important;
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.6) !important;
}

body.cosmic-mode .history-param-value.value-sell {
    color: #ef4444 !important;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.6) !important;
}

body.cosmic-mode .history-param-value.value-neutral {
    color: #fbbf24 !important;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.6) !important;
}

body.cosmic-mode .history-recommendation {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.3), 0 0 24px rgba(251, 191, 36, 0.15) !important;
}

body.cosmic-mode .history-recommendation strong {
    color: #fbbf24 !important;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.6) !important;
}

body.cosmic-mode .history-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2) !important;
    color: #ffffff !important;
}

body.cosmic-mode .history-btn:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(27, 227, 255, 0.3) !important;
    transform: translateY(-2px);
}

body.cosmic-mode .history-btn.delete {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4), 0 0 30px rgba(239, 68, 68, 0.2) !important;
}

body.cosmic-mode .history-btn.delete:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), 0 0 40px rgba(239, 68, 68, 0.3) !important;
}

/* Dark Mode - Scrollbar */
body.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Dark Mode - Modal */
body.dark-mode .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

body.dark-mode .modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

/* Dark Mode - Indicator Settings (Param Groups) */
body.dark-mode .param-group label {
    color: var(--text-secondary) !important;
}

body.dark-mode .param-group input,
body.dark-mode .param-group select {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.2);
}

body.dark-mode .param-group input::placeholder {
    color: var(--text-secondary) !important;
}

body.dark-mode .param-group select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-mode .param-hint {
    color: var(--text-secondary) !important;
}

/* Dark Mode - Empty State */
body.dark-mode .empty-state {
    color: var(--text-secondary);
}

body.dark-mode .empty-state-ai-image {
    opacity: 0.8;
    /* filter: drop-shadow(0 0 18px rgba(96, 165, 250, 0.3)); */
    /* animation: floatGlow 3s ease-in-out infinite; */
}

/* Dark Mode - Logo Text */
body.dark-mode .logo-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark Mode - Headings */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--text-primary);
}

/* Dark Mode - Paragraphs */
body.dark-mode p {
    color: var(--text-secondary);
}

/* Dark Mode - Alert/Warning Boxes */
body.dark-mode .alert,
body.dark-mode .warning-box,
body.dark-mode .info-box {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Dark Mode - Table */
body.dark-mode table {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode th {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode tr:hover {
    background: var(--bg-primary);
}

/* Dark Mode - Links */
body.dark-mode a {
    color: var(--primary-color);
}

body.dark-mode a:hover {
    color: var(--secondary-color);
}

/* Dark Mode - Badge/Tag */
body.dark-mode .badge,
body.dark-mode .tag {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4), 0 0 16px rgba(59, 130, 246, 0.2);
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
}

body.dark-mode .badge-signal {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4), 0 0 16px rgba(16, 185, 129, 0.2);
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

body.dark-mode .badge-score {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
}

/* Cosmic Mode - Badges */
body.cosmic-mode .badge-signal {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.3);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

body.cosmic-mode .badge-score {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
}

/* Dark Mode - Dividers */
body.dark-mode hr {
    border-color: var(--border-color);
}

/* Dark Mode - Code Blocks */
body.dark-mode code,
body.dark-mode pre {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Dark Mode - Checkbox & Radio */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
    border-color: var(--border-color);
}

body.dark-mode input[type="checkbox"]:checked,
body.dark-mode input[type="radio"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dark Mode - Placeholder Text */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Dark Mode - Disabled Elements */
body.dark-mode input:disabled,
body.dark-mode select:disabled,
body.dark-mode button:disabled {
    background: var(--bg-primary);
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Dark Mode - Select Dropdown Options */
body.dark-mode select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Dark Mode - Symbol Search */
body.dark-mode #symbol-search {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .symbol-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .symbol-dropdown li {
    color: var(--text-primary);
}

body.dark-mode .symbol-dropdown li:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

/* Dark Mode - Analysis Form Panel */
body.dark-mode .analysis-form-panel {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .analysis-results-panel {
    background: var(--bg-secondary);
}

/* Dark Mode - Indicators Grid */
body.dark-mode .indicators-grid {
    background: var(--bg-secondary);
}

body.dark-mode .indicator-category h4 {
    color: var(--text-primary);
}

/* Dark Mode - Form Actions */
body.dark-mode .form-actions {
    background: transparent;
    border-top: none;
}

/* Dark Mode - Price Display */
body.dark-mode .price-display {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Cosmic Mode - Price Display */
body.cosmic-mode .price-display,
body.cosmic-mode .price-display input,
body.cosmic-mode .price-display div {
    background: rgba(0, 0, 0, 0.85) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2), 0 0 20px rgba(27, 227, 255, 0.1) !important;
}

body.cosmic-mode .price-display:hover,
body.cosmic-mode .price-display input:hover {
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2) !important;
}

/* Cosmic Mode - Override white backgrounds in price-info */
body.cosmic-mode .price-info * {
    border-color: rgba(59, 130, 246, 0.3) !important;
}

body.cosmic-mode .price-info input,
body.cosmic-mode .price-info div[style*="white"],
body.cosmic-mode .price-info div[style*="#fff"],
body.cosmic-mode .price-info div[style*="#ffffff"] {
    background: rgba(31, 41, 55, 0.7) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #ffffff !important;
}

/* Dark Mode - Sentiment */
body.dark-mode .sentiment-positive {
    background: rgba(52, 211, 153, 0.2);
    color: var(--success-color);
}

body.dark-mode .sentiment-negative {
    background: rgba(248, 113, 113, 0.2);
    color: var(--danger-color);
}

body.dark-mode .sentiment-neutral {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
}

/* Dark Mode - Loading Spinner */
body.dark-mode .loading,
body.dark-mode .spinner {
    border-color: var(--border-color);
    border-top-color: var(--primary-color);
}

/* Dark Mode - Empty State */
body.dark-mode .empty-state p {
    color: var(--text-secondary);
}

/* Cosmic Mode - Empty State AI Image */
body.cosmic-mode .empty-state-ai-image {
    opacity: 0.9;
    /* filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4)); */
    /* animation: floatGlowCosmic 3s ease-in-out infinite; */
}

@keyframes floatGlowCosmic {

    0%,
    100% {
        transform: translateY(0px);
        opacity: 0.9;
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
    }

    50% {
        transform: translateY(-8px);
        opacity: 1;
        filter: drop-shadow(0 0 25px rgba(59, 130, 246, 0.5));
    }
}

body.cosmic-mode .empty-state p {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5) !important;
}

body.dark-mode .empty-state p {
    color: var(--text-primary) !important;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.4) !important;
}

/* Dark Mode - Footer */
body.dark-mode footer {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-top-color: var(--border-color);
}

/* Dark Mode - Tooltip */
body.dark-mode .tooltip {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Dark Mode - Shadow Effects */
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .dropdown {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Cosmic Mode - Modal Settings */
body.cosmic-mode .modal {
    background: rgba(0, 0, 0, 0.85) !important;
}

body.cosmic-mode .modal-content {
    background: rgba(0, 0, 0, 0.95) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4), 0 0 50px rgba(27, 227, 255, 0.2) !important;
}

body.cosmic-mode .modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .modal-header h3 {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5) !important;
}

body.cosmic-mode .modal-close {
    color: #ffffff !important;
}

body.cosmic-mode .modal-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px;
}

body.cosmic-mode .modal-body {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
}

body.cosmic-mode .modal-footer {
    background: rgba(0, 0, 0, 0.9) !important;
    border-top: 1px solid rgba(59, 130, 246, 0.4) !important;
}

/* Cosmic Mode - Param Groups */
body.cosmic-mode .param-group label {
    color: #ffffff !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
}

body.cosmic-mode .param-group input,
body.cosmic-mode .param-group select {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3), 0 0 16px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .param-group input:focus,
body.cosmic-mode .param-group select:focus {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5), 0 0 24px rgba(27, 227, 255, 0.3) !important;
    outline: none;
}

body.cosmic-mode .param-group .param-default,
body.cosmic-mode .param-hint {
    color: #e5e7eb !important;
}

/* Cosmic Mode - Modal Buttons */
body.cosmic-mode .modal-footer .btn-secondary {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .modal-footer .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(27, 227, 255, 0.25) !important;
}

body.cosmic-mode .modal-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(27, 227, 255, 0.2) !important;
}

body.cosmic-mode .modal-footer .btn-primary:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(27, 227, 255, 0.3) !important;
    transform: translateY(-2px);
}

body.dark-mode .card:hover,
body.dark-mode .history-item:hover {
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Dark Mode - Warning/Risk Alert Box (Yellow) */
body.dark-mode .risk-warning,
body.dark-mode .canh-bao,
body.dark-mode .risk-warning-card {
    background: rgba(251, 191, 36, 0.15);
    border-left: 4px solid var(--warning-color);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3), 0 0 20px rgba(251, 191, 36, 0.15);
}

body.dark-mode .risk-warning strong,
body.dark-mode .canh-bao strong,
body.dark-mode .risk-warning-title {
    color: var(--warning-color);
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

/* Cosmic Mode - Warning/Risk Alert Box */
body.cosmic-mode .risk-warning,
body.cosmic-mode .canh-bao,
body.cosmic-mode .risk-warning-card {
    background: rgba(0, 0, 0, 0.85) !important;
    border-left: 4px solid rgba(59, 130, 246, 0.6) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .risk-warning strong,
body.cosmic-mode .canh-bao strong,
body.cosmic-mode .risk-warning-title,
body.cosmic-mode .risk-warning-list,
body.cosmic-mode .risk-warning-card * {
    color: #ffffff !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3) !important;
}

body.cosmic-mode .risk-warning-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.5) !important;
}

body.cosmic-mode .risk-warning-list {
    color: #ffffff !important;
}

body.cosmic-mode .risk-warning-list strong {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.4) !important;
}

/* Dark Mode - Success Box (Green) */
body.dark-mode .success-box,
body.dark-mode .goi-y-mua {
    background: rgba(52, 211, 153, 0.15);
    border-left: 4px solid var(--success-color);
}

/* Dark Mode - Danger Box (Red) */
body.dark-mode .danger-box,
body.dark-mode .goi-y-ban {
    background: rgba(248, 113, 113, 0.15);
    border-left: 4px solid var(--danger-color);
}

/* Cosmic Mode - Gợi ý Mua/Bán */
body.cosmic-mode .goi-y-mua {
    background: rgba(52, 211, 153, 0.2);
    border-left: 4px solid var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3), 0 0 20px rgba(16, 185, 129, 0.15);
}

body.cosmic-mode .goi-y-ban {
    background: rgba(248, 113, 113, 0.2);
    border-left: 4px solid var(--danger-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3), 0 0 20px rgba(239, 68, 68, 0.15);
}

/* Dark Mode - Status Tags */
body.dark-mode .status-tang,
body.dark-mode .status-up {
    background: rgba(52, 211, 153, 0.2);
    color: var(--success-color);
}

body.dark-mode .status-giam,
body.dark-mode .status-down {
    background: rgba(248, 113, 113, 0.2);
    color: var(--danger-color);
}

/* Cosmic Mode - Status Tags */
body.cosmic-mode .status-tang,
body.cosmic-mode .status-up {
    background: rgba(52, 211, 153, 0.25);
    color: var(--success-color);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
}

body.cosmic-mode .status-giam,
body.cosmic-mode .status-down {
    background: rgba(248, 113, 113, 0.25);
    color: var(--danger-color);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.6);
}

body.dark-mode .status-neutral {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
}

/* Dark Mode - Trend Arrows */
body.dark-mode .trend-up::before {
    color: var(--success-color);
}

body.dark-mode .trend-down::before {
    color: var(--danger-color);
}

/* Dark Mode - Market Status */
body.dark-mode .market-open {
    color: var(--success-color);
}

body.dark-mode .market-closed {
    color: var(--danger-color);
}

/* Dark Mode - Language Selector */
body.dark-mode #language-selector {
    background-color: rgba(59, 130, 246, 0.2);
    background-size: 32px 22px;
    /* Giống light mode - điều chỉnh kích thước lá cờ */
    background-position: center;
    background-repeat: no-repeat;
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
    filter: none;
    /* Không áp dụng filter để lá cờ hiển thị đúng màu */
}

body.dark-mode #language-selector:hover {
    background-color: rgba(59, 130, 246, 0.3);
    background-size: 32px 22px;
    /* Giữ kích thước lá cờ khi hover */
    background-position: center;
    background-repeat: no-repeat;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6), 0 0 24px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

body.dark-mode #current-flag {
    opacity: 1;
    /* Giữ opacity 1 để lá cờ hiển thị đúng màu */
    filter: none;
    /* Không áp dụng filter */
}

/* Dark Mode - Strong/Bold Text */
body.dark-mode strong,
body.dark-mode b {
    color: var(--text-primary);
    font-weight: 600;
}

/* Dark Mode - Small Text */
body.dark-mode small {
    color: var(--text-secondary);
}

/* Dark Mode - Border & Dividers */
body.dark-mode .divider,
body.dark-mode .separator {
    border-color: var(--border-color);
    background: var(--border-color);
}

/* Dark Mode - Ensure all text is white/light */
body.dark-mode,
body.dark-mode * {
    color: var(--text-primary);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .card h2,
body.dark-mode .card h3 {
    color: #ffffff !important;
}

body.dark-mode p,
body.dark-mode span,
body.dark-mode label,
body.dark-mode div {
    color: var(--text-primary);
}

/* Dark Mode - Links stay blue */
body.dark-mode a {
    color: #60a5fa !important;
}

body.dark-mode a:hover {
    color: #3b82f6 !important;
}

/* Dark Mode - BUY/SELL Buttons */
body.dark-mode .btn-buy,
body.dark-mode button[class*="buy"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

body.dark-mode .btn-buy:hover,
body.dark-mode button[class*="buy"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

body.dark-mode .btn-sell,
body.dark-mode button[class*="sell"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

body.dark-mode .btn-sell:hover,
body.dark-mode button[class*="sell"]:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Dark Mode - Buy Market/Limit Buttons */
body.dark-mode button[class*="BUY"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

body.dark-mode button[class*="BUY"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Dark Mode - Price Labels */
body.dark-mode .price-label {
    color: var(--text-secondary);
}

body.dark-mode .price-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Cosmic Mode - Price Value */
body.cosmic-mode .price-value {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

body.dark-mode .price-up {
    color: var(--success-color);
}

body.dark-mode .price-down {
    color: var(--danger-color);
}

/* Dark Mode - Suggestion Cards (Gợi ý Giao dịch) */
body.dark-mode .suggestion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 0 16px rgba(59, 130, 246, 0.1);
}

body.dark-mode .suggestion-buy {
    border-left: 4px solid var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3), 0 0 20px rgba(16, 185, 129, 0.15);
}

body.dark-mode .suggestion-sell {
    border-left: 4px solid var(--danger-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3), 0 0 20px rgba(239, 68, 68, 0.15);
}

/* Dark Mode - Info Sections */
body.dark-mode .info-section,
body.dark-mode .info-section-compact {
    background: var(--bg-secondary) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    border-left: 3px solid rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25) !important;
    color: #ffffff !important;
}

body.dark-mode .info-section:hover,
body.dark-mode .info-section-compact:hover {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 0 24px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Cosmic Mode - Info Sections */
body.cosmic-mode .info-section,
body.cosmic-mode .info-section-compact {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    border-left: 3px solid rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25) !important;
    color: #ffffff !important;
}

body.cosmic-mode .info-section:hover,
body.cosmic-mode .info-section-compact:hover {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(27, 227, 255, 0.25), 0 0 45px rgba(167, 139, 250, 0.15);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}

body.cosmic-mode .section-title {
    color: #3b82f6 !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
}

body.dark-mode .section-title {
    color: #60a5fa;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.5);
    font-weight: 600;
}

/* Dark Mode - All Labels and Small Text */
body.dark-mode .info-section label,
body.dark-mode .zone-item label,
body.dark-mode .ml-item label {
    color: #cbd5e1;
}

body.dark-mode .info-section small,
body.dark-mode .zone-item small,
body.dark-mode .ml-item small {
    color: #9ca3af;
}

body.dark-mode .info-section .text-muted,
body.dark-mode .zone-item .text-muted {
    color: #9ca3af;
}

/* Dark Mode - Value Pills/Badges in Info Sections */
body.dark-mode .info-value:not(.positive):not(.negative) {
    background: rgba(59, 130, 246, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4), 0 0 16px rgba(59, 130, 246, 0.2);
    display: inline-block;
}

body.dark-mode .info-value.positive {
    background: rgba(16, 185, 129, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4), 0 0 16px rgba(16, 185, 129, 0.2);
    display: inline-block;
}

body.dark-mode .info-value.negative {
    background: rgba(239, 68, 68, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4), 0 0 16px rgba(239, 68, 68, 0.2);
    display: inline-block;
}

/* Dark Mode - Strong Text in ML Items */
body.dark-mode .ml-item strong {
    color: #60a5fa;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.7);
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

/* Dark Mode - Compact Sections Grid */
body.dark-mode .compact-sections-grid,
body.dark-mode .compact-sections-grid-5 {
    gap: 15px;
}

/* Cosmic Mode - Compact Sections Grid */
body.cosmic-mode .compact-sections-grid,
body.cosmic-mode .compact-sections-grid-5 {
    gap: 15px;
}

/* Cosmic Mode - Result Header */
body.cosmic-mode .result-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1BE3FF 50%, #a78bfa 100%);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Cosmic Mode - Info Section Conclusion */
body.cosmic-mode .info-section-compact.conclusion {
    background: rgba(0, 0, 0, 0.9) !important;
    border-left: 3px solid #3b82f6 !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 0 24px rgba(27, 227, 255, 0.2) !important;
}

body.cosmic-mode .info-section-compact.conclusion .section-title {
    color: #3b82f6 !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
}

/* Dark Mode - Info Grid */
body.dark-mode .info-grid {
    gap: 8px;
}

/* Dark Mode - All Text in Compact Sections */
body.dark-mode .info-section-compact,
body.dark-mode .info-section-compact * {
    color: #ffffff !important;
}

body.dark-mode .info-section-compact .section-title {
    color: #60a5fa !important;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.5) !important;
}

body.dark-mode .info-section-compact .info-icon {
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.6)) !important;
}

body.dark-mode .info-section-compact .info-label {
    color: #cbd5e1 !important;
}

body.dark-mode .info-section-compact .ml-item {
    color: #ffffff !important;
    padding: 4px 0;
}

body.dark-mode .info-section-compact .ml-item:has(strong) {
    border-left: 2px solid rgba(59, 130, 246, 0.5);
    padding-left: 8px;
    box-shadow: -2px 0 6px rgba(59, 130, 246, 0.3);
}

body.dark-mode .info-section-compact .ml-item strong {
    color: #60a5fa !important;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.7) !important;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

/* Dark Mode - Trading Zone Items */
body.dark-mode .zone-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.15), 0 0 12px rgba(59, 130, 246, 0.08);
}

body.dark-mode .zone-item:hover {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Dark Mode - Info Items */
body.dark-mode .info-item {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2) !important;
    border-radius: 6px;
    color: #ffffff !important;
}

body.dark-mode .info-icon {
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.6));
    font-size: 1.1em;
}

body.dark-mode .info-label {
    color: #cbd5e1;
}

/* Cosmic Mode - Info Icon & Label */
body.cosmic-mode .info-icon {
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.7)) !important;
    font-size: 1.1em;
}

body.cosmic-mode .info-section-compact .info-icon {
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.7)) !important;
}

body.cosmic-mode .info-label {
    color: #e5e7eb !important;
    text-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

body.cosmic-mode .info-section-compact .info-label {
    color: #e5e7eb !important;
}

body.dark-mode .info-value {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.5) !important;
    font-weight: 700;
}

body.dark-mode .info-value.positive {
    color: #10b981 !important;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.8) !important;
}

body.dark-mode .info-value.negative {
    color: #ef4444 !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.8) !important;
}

/* Cosmic Mode - Info Value */
body.cosmic-mode .info-value {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
    font-weight: 700;
}

body.cosmic-mode .info-value.positive {
    color: #10b981 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.9) !important;
}

body.cosmic-mode .info-value.negative {
    color: #ef4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.9) !important;
}

body.cosmic-mode .info-value:not(.positive):not(.negative) {
    background: rgba(59, 130, 246, 0.25) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(27, 227, 255, 0.3) !important;
}

body.cosmic-mode .info-value.positive {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.3) !important;
}

body.cosmic-mode .info-value.negative {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3) !important;
}

/* Dark Mode - ML Items */
body.dark-mode .ml-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.15), 0 0 12px rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
}

body.dark-mode .ml-item:hover {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Dark Mode - Trading Zone */
body.dark-mode .trading-zone {
    color: var(--text-primary);
}

body.dark-mode .trading-zone strong {
    color: #60a5fa;
    text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

/* Dark Mode - Input Fields in Analysis Results */
body.dark-mode .info-section input[type="text"],
body.dark-mode .info-section input[type="number"],
body.dark-mode .zone-item input[type="text"],
body.dark-mode .zone-item input[type="number"] {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #ffffff;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.2), 0 0 12px rgba(59, 130, 246, 0.1);
}

body.dark-mode .info-section input[type="text"]:focus,
body.dark-mode .info-section input[type="number"]:focus,
body.dark-mode .zone-item input[type="text"]:focus,
body.dark-mode .zone-item input[type="number"]:focus {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
}

/* Cosmic Mode - Info Section Inputs */
body.cosmic-mode .info-section input[type="text"],
body.cosmic-mode .info-section input[type="number"],
body.cosmic-mode .zone-item input[type="text"],
body.cosmic-mode .zone-item input[type="number"],
body.cosmic-mode .price-info input[type="text"],
body.cosmic-mode .price-info input[type="number"],
body.cosmic-mode .price-info input,
body.cosmic-mode .info-section-compact input[type="text"],
body.cosmic-mode .info-section-compact input[type="number"],
body.cosmic-mode .info-section-compact input {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3), 0 0 16px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .info-section input[type="text"]:focus,
body.cosmic-mode .info-section input[type="number"]:focus,
body.cosmic-mode .zone-item input[type="text"]:focus,
body.cosmic-mode .zone-item input[type="number"]:focus,
body.cosmic-mode .price-info input[type="text"]:focus,
body.cosmic-mode .price-info input[type="number"]:focus,
body.cosmic-mode .price-info input:focus,
body.cosmic-mode .info-section-compact input[type="text"]:focus,
body.cosmic-mode .info-section-compact input[type="number"]:focus,
body.cosmic-mode .info-section-compact input:focus {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5), 0 0 24px rgba(27, 227, 255, 0.3) !important;
}

/* Dark Mode - Radio Buttons */
body.dark-mode input[type="radio"] {
    border-color: rgba(59, 130, 246, 0.5);
}

body.dark-mode input[type="radio"]:checked {
    background: #3b82f6;
    border-color: #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6), 0 0 16px rgba(59, 130, 246, 0.3);
}

body.dark-mode input[type="radio"]:checked+label {
    color: #60a5fa;
    text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

/* Cosmic Mode - Radio Buttons */
body.cosmic-mode input[type="radio"] {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background: rgba(31, 41, 55, 0.7) !important;
}

body.cosmic-mode input[type="radio"]:checked {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.7), 0 0 20px rgba(27, 227, 255, 0.4) !important;
}

body.cosmic-mode input[type="radio"]:checked+label {
    color: #3b82f6 !important;
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.7) !important;
}

/* Cosmic Mode - Checkboxes */
body.cosmic-mode input[type="checkbox"] {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background: rgba(31, 41, 55, 0.7) !important;
}

body.cosmic-mode input[type="checkbox"]:checked {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.7), 0 0 20px rgba(27, 227, 255, 0.4) !important;
}

/* Dark Mode - Advanced Analysis Text */
body.dark-mode .ml-info,
body.dark-mode .analysis-text {
    color: var(--text-primary);
    line-height: 1.6;
}

body.dark-mode .ml-info strong,
body.dark-mode .analysis-text strong {
    color: #60a5fa;
    text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

/* Dark Mode - All Text in Analysis Results */
body.dark-mode .analysis-result-panel p,
body.dark-mode .analysis-result-panel span,
body.dark-mode .analysis-result-panel div:not(.card):not(.badge):not(.btn) {
    color: var(--text-primary);
}

body.dark-mode .analysis-result-panel li {
    color: var(--text-primary);
}

body.dark-mode .analysis-result-panel code,
body.dark-mode .analysis-result-panel pre {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.2);
    text-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

/* Dark Mode - Highlight Important Text */
body.dark-mode .analysis-result-panel .highlight,
body.dark-mode .analysis-result-panel mark {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Dark Mode - Percentage Display */
body.dark-mode .percentage-positive {
    color: var(--success-color);
}

body.dark-mode .percentage-negative {
    color: var(--danger-color);
}

/* Dark Mode - Chart Container */
body.dark-mode #tradingview_chart {
    background: var(--bg-primary);
}

/* Dark Mode - Chart Section (Analysis Results Chart) */
body.dark-mode .chart-section {
    background: var(--bg-secondary) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(59, 130, 246, 0.15) !important;
    padding: 10px;
    border-radius: 8px;
}

body.dark-mode .chart-image {
    background: var(--bg-primary);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(59, 130, 246, 0.15);
    /* Adjust brightness/contrast for dark mode */
    filter: brightness(0.85) contrast(1.15);
    /* If chart has white background, uncomment this line instead: */
    /* filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(1.1); */
}

body.dark-mode .chart-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(59, 130, 246, 0.15);
}

body.dark-mode .chart-container img {
    background: var(--bg-primary);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Cosmic Mode - Chart Section */
body.cosmic-mode .chart-section {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
    padding: 10px;
    border-radius: 8px;
}

body.cosmic-mode .chart-image {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(27, 227, 255, 0.2) !important;
    filter: brightness(1.05) contrast(1.05);
}

body.cosmic-mode .chart-container {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), 0 0 30px rgba(27, 227, 255, 0.15) !important;
}

body.cosmic-mode .chart-container img,
body.cosmic-mode .chart-image img,
body.cosmic-mode .chart-section img,
body.cosmic-mode .analysis-result img {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(27, 227, 255, 0.2) !important;
}

/* Cosmic Mode - Override any white borders on chart images */
body.cosmic-mode img[src*="chart"],
body.cosmic-mode img[src*="analysis"],
body.cosmic-mode .card img {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background-color: transparent !important;
}

/* Dark Mode - MACD Analysis Box */
body.dark-mode .macd-analysis,
body.dark-mode .analysis-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Dark Mode - Indicator Signal (MACD badge) - Dễ nhìn hơn */
body.dark-mode .indicator-signal {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(96, 165, 250, 0.2) 100%) !important;
    border: 2px solid #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5), 0 0 16px rgba(96, 165, 250, 0.3) !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8) !important;
}

body.dark-mode .analysis-positive {
    background: rgba(52, 211, 153, 0.1);
    border-left: 3px solid var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3), 0 0 20px rgba(16, 185, 129, 0.15);
}

body.dark-mode .analysis-negative {
    background: rgba(248, 113, 113, 0.1);
    border-left: 3px solid var(--danger-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3), 0 0 20px rgba(239, 68, 68, 0.15);
}

/* User Avatar Button & Profile Modal */
#menu-user-avatar-btn {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

#menu-user-avatar-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

#menu-user-avatar-btn:active {
    transform: scale(0.96);
}

@media (max-width: 640px) {
    .user-profile-body {
        grid-template-columns: 1fr !important;
    }
}

.profile-account-dropdown {
    background: #0f172a;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    max-width: 170px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-account-dropdown:hover,
.profile-account-dropdown:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.profile-account-dropdown option {
    background: #0f172a;
    color: #f8fafc;
}

/* Chuẩn hóa wrapper và khung Stepper Giá trong cột Đặt lệnh khớp 1:1 với Khối lượng */
#sps-group-price,
#sps-group-stop-price {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

#sps-group-price .sps-input-with-prompt,
#sps-group-stop-price .sps-input-with-prompt {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

#sps-num-price-wrap,
#sps-group-price .sps-num-input,
#sps-group-stop-price .sps-num-input {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 1 1 100% !important;
}

#sps-num-price-wrap input,
#sps-group-price .sps-num-input input,
#sps-group-stop-price .sps-num-input input {
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
}

/* ==========================================================================
   HOMEPAGE (TRANG CHỦ STR HÀNG HÓA PHÁI SINH) STYLES
   ========================================================================== */

#home-tab {
    display: none;
    padding: 0;
    width: 100%;
    position: relative;
    overflow-x: hidden;
    /* Nền mặc định; khi bật Giao diện → theme-picker.css + home-intelligence.css */
    background-color: var(--str-bg-base, #060913);
    background-image: none;
}

#home-tab.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.home-container {
    max-width: 1460px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    gap: 46px;
    position: relative;
    z-index: 1;
}

/* 1. Hero Banner */
.home-hero {
    position: relative;
    padding: 48px 32px 38px 32px;
    background: radial-gradient(ellipse at 50% -10%, rgba(14, 165, 233, 0.3) 0%, transparent 65%),
                radial-gradient(circle at 10% 85%, rgba(168, 85, 247, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 90% 85%, rgba(16, 185, 129, 0.18) 0%, transparent 50%),
                linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 16, 31, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 22px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7),
                0 0 35px -5px rgba(14, 165, 233, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-align: center;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3) 20%, #38bdf8 50%, rgba(16, 185, 129, 0.6) 75%, transparent);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.9), 0 0 32px rgba(14, 165, 233, 0.45);
    z-index: 2;
}

/* Hero Content Stacking */
.home-hero > *:not(.hero-bg-lights) {
    position: relative;
    z-index: 1;
}

/* Decorative Cosmic Lights & Grid Pattern */
.hero-bg-lights {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 80%);
}

.hero-light-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.65;
    animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-cyan {
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 260px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.5) 0%, rgba(14, 165, 233, 0) 70%);
}

.orb-purple {
    bottom: -60px;
    left: -20px;
    width: 360px;
    height: 260px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(147, 51, 234, 0) 70%);
    animation-duration: 16s;
    animation-delay: -3s;
}

.orb-emerald {
    bottom: -60px;
    right: -20px;
    width: 360px;
    height: 260px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.38) 0%, rgba(5, 150, 105, 0) 70%);
    animation-duration: 18s;
    animation-delay: -7s;
}

.orb-gold {
    top: 25%;
    right: 15%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
    animation-duration: 12s;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(16px, -14px) scale(1.06);
    }
    100% {
        transform: translate(-16px, 10px) scale(0.96);
    }
}

.hero-badge-wrap {
    display: inline-flex;
    margin-bottom: 20px;
}

.hero-badge {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.32), rgba(56, 189, 248, 0.18));
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #e0f2fe;
    padding: 7px 20px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 32px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.hero-gradient-text {
    display: block;
    background: linear-gradient(135deg, #38bdf8 0%, #10b981 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 24px;
    font-weight: 800;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.hero-desc {
    max-width: 860px;
    margin: 0 auto 30px auto;
    font-size: 14.5px;
    line-height: 1.65;
    color: #cbd5e1;
}

/* Quick CTAs */
.home-cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 34px;
}

.home-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary-cta {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}
.btn-primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
    filter: brightness(1.1);
}

.btn-secondary-cta {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.45);
}
.btn-secondary-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.45));
    color: #ffffff;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.btn-purple-cta {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(126, 34, 206, 0.3));
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.45);
}
.btn-purple-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.35), rgba(126, 34, 206, 0.5));
    color: #ffffff;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
}

.btn-amber-cta {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.45);
}
.btn-amber-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5));
    color: #ffffff;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.btn-connected-cta {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.38));
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}
.btn-connected-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.38), rgba(5, 150, 105, 0.6));
    color: #ffffff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.feature-action-link.connected-link {
    color: #34d399;
}
.feature-action-link.connected-link:hover {
    color: #6ee7b7;
}

/* Highlights Grid */
.home-highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-align: left;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
}

.highlight-item:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 15px rgba(56, 189, 248, 0.2);
}

.highlight-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.highlight-num {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
}

.highlight-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Sections */
.home-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 38px 30px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.55) 0%, rgba(9, 14, 28, 0.72) 100%);
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 22px;
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.section-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    width: 100%;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    height: 100px;
    background: radial-gradient(ellipse at 50% 50%, rgba(14, 165, 233, 0.14) 0%, rgba(168, 85, 247, 0.04) 50%, transparent 70%);
    filter: blur(35px);
    pointer-events: none;
    z-index: 0;
}

.section-header > * {
    position: relative;
    z-index: 1;
}

.section-tag-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    width: 100%;
}

.section-decor-line {
    flex: 1;
    max-width: 220px;
    height: 1px;
}
.section-decor-line.left {
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.45) 100%);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}
.section-decor-line.right {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.45) 0%, transparent 100%);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(56, 189, 248, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.45);
    padding: 5px 16px;
    border-radius: 30px;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin: 0 0 10px 0;
}

.section-subtitle {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

/* 2-column layout for basics */
.home-two-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 22px;
}

.home-card {
    background: rgba(11, 18, 33, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(12px);
}

.card-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-badge-icon {
    font-size: 22px;
}

.card-icon-title h3 {
    font-size: 17px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.card-text {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

.card-sub-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.sub-point {
    background: rgba(255, 255, 255, 0.025);
    border-left: 3px solid #38bdf8;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
}

.point-badge {
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 4px;
}

.sub-point p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* 4 Commodity Cards Grid */
.commodity-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.commodity-card {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.commodity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.commodity-card.border-green {
    border-top: 3px solid #10b981;
}
.commodity-card.border-green:hover {
    border-color: #10b981;
}

.commodity-card.border-orange {
    border-top: 3px solid #f97316;
}
.commodity-card.border-orange:hover {
    border-color: #f97316;
}

.commodity-card.border-cyan {
    border-top: 3px solid #06b6d4;
}
.commodity-card.border-cyan:hover {
    border-color: #06b6d4;
}

.commodity-card.border-purple {
    border-top: 3px solid #a855f7;
}
.commodity-card.border-purple:hover {
    border-color: #a855f7;
}

.comm-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comm-icon {
    font-size: 32px;
}

.comm-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 2px 0;
}

.comm-exchange {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
}

.comm-desc {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 0;
}

.comm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.comm-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.comm-drivers {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
    margin-top: auto;
}

.comm-drivers strong {
    color: #cbd5e1;
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.home-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.home-comparison-table th,
.home-comparison-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    vertical-align: middle;
}

.home-comparison-table thead th {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
}

.home-comparison-table thead th.col-highlight {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-left: 1px solid rgba(56, 189, 248, 0.3);
    border-right: 1px solid rgba(56, 189, 248, 0.3);
}

.home-comparison-table tbody td.col-highlight {
    background: rgba(2, 132, 199, 0.06);
    border-left: 1px solid rgba(56, 189, 248, 0.2);
    border-right: 1px solid rgba(56, 189, 248, 0.2);
}

.home-comparison-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}
.home-comparison-table tbody tr:hover td.col-highlight {
    background-color: rgba(2, 132, 199, 0.12);
}

/* Features Grid */
.home-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.home-feature-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s ease;
}

.home-feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.feature-icon {
    font-size: 32px;
}

.feature-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.feature-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

.feature-action-link {
    background: none;
    border: none;
    color: #38bdf8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-align: left;
    margin-top: auto;
    transition: color 0.15s, transform 0.15s;
    display: inline-flex;
    align-items: center;
}

.feature-action-link:hover {
    color: #7dd3fc;
    transform: translateX(4px);
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.step-card {
    position: relative;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-number {
    font-size: 28px;
    font-weight: 900;
    color: rgba(56, 189, 248, 0.3);
    font-family: monospace;
    line-height: 1;
}

.step-title {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.step-desc {
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

/* Risk Note */
.home-risk-note {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.risk-icon {
    font-size: 26px;
    flex-shrink: 0;
    margin-top: 2px;
}

.risk-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: #f87171;
    margin: 0 0 6px 0;
}

.risk-content p {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .home-hero {
        padding: 28px 16px 24px 16px;
    }
    .hero-title {
        font-size: 24px;
    }
    .hero-gradient-text {
        font-size: 18px;
    }
    .home-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   STR DYNAMIC THEME SYSTEM — MỤC 1: PHÂN TÍCH KỸ THUẬT (#analysis-tab)
   Đồng bộ 100% theo Theme Picker:
   1. Chế độ Nền: Đen (dark) / Vũ trụ nhiều màu (cosmic) / Trắng (light)
   2. Ngũ hành & Màu nhấn: Kim, Mộc, Thủy, Hỏa, Thổ & Custom Hex
   3. Viền khung: Themed borders phong thủy
   ========================================================================== */

/* 1.1 Khung tổng thể của tab */
#analysis-tab {
    color: var(--str-text-main, #ffffff);
    background: transparent;
}

#analysis-tab .analysis-layout {
    gap: 16px;
}

/* 1.2 Card Panel Form và Card Kết quả */
#analysis-tab .card,
#analysis-tab .analysis-form-panel .card,
#analysis-tab #analysis-result.card {
    background: var(--str-bg-card, #101010) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-radius: 14px !important;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Hiệu ứng viền theo theme khi bật tùy chọn Viền khung */
body.str-themed-borders #analysis-tab .card,
body.str-themed-borders #analysis-tab .analysis-form-panel .card,
body.str-themed-borders #analysis-tab #analysis-result.card {
    border-color: var(--str-border-gold, rgba(56, 189, 248, 0.35)) !important;
}

/* Thích ứng theo từng chế độ NỀN */
/* A. Chế độ Nhiều màu (Cosmic glassmorphism) */
body.cosmic-mode #analysis-tab .card,
body.cosmic-mode #analysis-tab .analysis-form-panel .card,
body.cosmic-mode #analysis-tab #analysis-result.card {
    background: var(--str-bg-card, rgba(15, 23, 42, 0.52)) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45) !important;
}

/* B. Chế độ Đen tuyền (Pure Black) */
body.str-pure-black #analysis-tab .card,
body.dark-mode:not(.cosmic-mode) #analysis-tab .card {
    background: var(--str-bg-card, #101010) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6) !important;
}

/* C. Chế độ Trắng (Light) */
body.str-pure-white #analysis-tab .card,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .card {
    background: #ffffff !important;
    border: 1px solid var(--str-border-subtle, #e5e7eb) !important;
    color: #111827 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

/* 1.3 Tiêu đề chính */
#analysis-tab .card h2,
#analysis-tab .card h3,
#analysis-tab .result-card h3 {
    color: var(--str-accent, #38bdf8) !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
}

/* 1.4 Form Controls & Inputs */
#analysis-tab .form-group label {
    color: var(--str-text-muted, #cbd5e1) !important;
    font-weight: 600 !important;
    font-size: 0.9em !important;
}

body.str-pure-white #analysis-tab .form-group label,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .form-group label {
    color: #475569 !important;
}

#analysis-tab .form-group input,
#analysis-tab .form-group select {
    background: var(--str-bg-surface, #141414) !important;
    color: var(--str-text-main, #ffffff) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
    border-radius: 8px !important;
    font-size: 0.92em !important;
    transition: all 0.2s ease !important;
}

body.cosmic-mode #analysis-tab .form-group input,
body.cosmic-mode #analysis-tab .form-group select {
    background: rgba(11, 18, 32, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.str-pure-white #analysis-tab .form-group input,
body.str-pure-white #analysis-tab .form-group select,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .form-group input,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .form-group select {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

#analysis-tab .form-group input:focus,
#analysis-tab .form-group select:focus {
    outline: none !important;
    border-color: var(--str-accent, #38bdf8) !important;
    box-shadow: 0 0 0 3px var(--str-accent-soft, rgba(56, 189, 248, 0.2)) !important;
}

/* 1.5 Danh sách Checkbox Indicators */
#analysis-tab .indicators-grid {
    background: transparent !important;
}

#analysis-tab .indicator-category-title,
#analysis-tab .indicator-category h4 {
    color: var(--str-accent, #38bdf8) !important;
    font-weight: 700 !important;
    font-size: 0.92em !important;
    letter-spacing: 0.3px !important;
}

#analysis-tab .indicator-checkbox {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

body.cosmic-mode #analysis-tab .indicator-checkbox {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #analysis-tab .indicator-checkbox,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .indicator-checkbox {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #111827 !important;
}

#analysis-tab .indicator-checkbox:hover,
#analysis-tab .indicator-checkbox:has(input:checked) {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    border-color: var(--str-accent, #38bdf8) !important;
}

#analysis-tab .indicator-checkbox label {
    cursor: pointer !important;
    color: inherit !important;
}

#analysis-tab .indicators-grid::-webkit-scrollbar-track {
    background: var(--str-bg-surface, rgba(255, 255, 255, 0.05)) !important;
}

#analysis-tab .indicators-grid::-webkit-scrollbar-thumb {
    background: var(--str-accent, #38bdf8) !important;
    border-radius: 10px !important;
}

/* 1.6 Nút hành động Form */
#analysis-tab #analysis-form button[type="submit"],
#analysis-tab .btn-primary {
    background: linear-gradient(135deg, var(--str-accent, #0284c7), var(--str-accent-mid, #2563eb)) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px var(--str-accent-soft, rgba(56, 189, 248, 0.35)) !important;
    transition: all 0.2s ease !important;
}

#analysis-tab #analysis-form button[type="submit"]:hover,
#analysis-tab .btn-primary:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px var(--str-accent-soft, rgba(56, 189, 248, 0.5)) !important;
}

#analysis-tab #save-history-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

#analysis-tab #save-history-btn:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* 1.7 Khung Header Kết quả Phân tích (.analysis-header) */
#analysis-tab .analysis-header {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.12)) !important;
    border: 1.5px solid var(--str-accent, #38bdf8) !important;
    border-radius: 12px !important;
    box-shadow: 0 0 18px var(--str-accent-soft, rgba(56, 189, 248, 0.2)) !important;
    padding: 14px 16px !important;
}

#analysis-tab .analysis-header h3 {
    color: var(--str-text-main, #ffffff) !important;
    text-shadow: none !important;
    font-size: 1.05em !important;
    font-weight: 800 !important;
}

body.str-pure-white #analysis-tab .analysis-header h3,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .analysis-header h3 {
    color: #0f172a !important;
}

/* 1.8 Cảnh báo rủi ro (.risk-warning-card) */
#analysis-tab .risk-warning-card {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
}

#analysis-tab .risk-warning-title {
    color: #f59e0b !important;
    font-weight: 700 !important;
}

#analysis-tab .risk-warning-list {
    color: var(--str-text-muted, #cbd5e1) !important;
    font-size: 0.85em !important;
    line-height: 1.45 !important;
}

body.str-pure-white #analysis-tab .risk-warning-list,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .risk-warning-list {
    color: #475569 !important;
}

/* 1.9 Các ô thông tin Compact (.info-section & .info-section-compact) */
#analysis-tab .info-section,
#analysis-tab .info-section-compact {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-left: 3.5px solid var(--str-accent, #38bdf8) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.2s ease !important;
}

body.cosmic-mode #analysis-tab .info-section,
body.cosmic-mode #analysis-tab .info-section-compact {
    background: var(--str-bg-card, rgba(15, 23, 42, 0.52)) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    border-left-color: var(--str-accent, #38bdf8) !important;
}

body.str-pure-white #analysis-tab .info-section,
body.str-pure-white #analysis-tab .info-section-compact,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .info-section,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .info-section-compact {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-left: 3.5px solid var(--str-accent, #2563eb) !important;
    color: #111827 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

#analysis-tab .info-section:hover,
#analysis-tab .info-section-compact:hover {
    border-color: var(--str-accent, #38bdf8) !important;
    box-shadow: 0 4px 18px var(--str-accent-soft, rgba(56, 189, 248, 0.25)) !important;
}

/* Tiêu đề mục con */
#analysis-tab .section-title {
    color: var(--str-accent, #38bdf8) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    font-size: 0.9em !important;
    padding-bottom: 6px !important;
    margin-bottom: 8px !important;
}

body.str-pure-white #analysis-tab .section-title,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .section-title {
    border-bottom-color: #e5e7eb !important;
}

/* Nhãn và giá trị */
#analysis-tab .info-section label,
#analysis-tab .info-section .info-label,
#analysis-tab .info-section small,
#analysis-tab .info-section .text-muted {
    color: var(--str-text-muted, #94a3b8) !important;
}

body.str-pure-white #analysis-tab .info-section label,
body.str-pure-white #analysis-tab .info-section .info-label,
body.str-pure-white #analysis-tab .info-section small,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .info-section label {
    color: #64748b !important;
}

#analysis-tab .info-section strong,
#analysis-tab .info-section .info-item,
#analysis-tab .info-section span:not(.badge):not(.info-icon) {
    color: var(--str-text-main, #ffffff);
}

body.str-pure-white #analysis-tab .info-section strong,
body.str-pure-white #analysis-tab .info-section .info-item,
body.str-pure-white #analysis-tab .info-section span:not(.badge):not(.info-icon),
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .info-section strong {
    color: #0f172a !important;
}

/* Badge giá trị chỉ báo */
#analysis-tab .info-value:not(.positive):not(.negative) {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    border: 1px solid var(--str-accent, #38bdf8) !important;
    color: var(--str-accent, #38bdf8) !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

#analysis-tab .ml-item strong {
    color: var(--str-accent, #38bdf8) !important;
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    border: 1px solid var(--str-accent, #38bdf8) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Khối Kết Luận & Khuyến Nghị */
#analysis-tab .info-section.conclusion,
#analysis-tab .info-section-compact.conclusion {
    border-left: 4px solid var(--str-accent, #f59e0b) !important;
    box-shadow: 0 0 14px var(--str-accent-soft, rgba(245, 158, 11, 0.2)) !important;
}

#analysis-tab .info-section.recommendation,
#analysis-tab .info-section-compact.recommendation {
    border-left: 4px solid var(--str-accent, #10b981) !important;
}

/* 1.10 Quick Trading Mini Panel trong Phân tích */
#analysis-tab #quick-zone-volume {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
    color: var(--str-text-main, #ffffff) !important;
}

body.str-pure-white #analysis-tab #quick-zone-volume,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab #quick-zone-volume {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

#analysis-tab .zone-item label {
    color: var(--str-text-main, #ffffff) !important;
}

body.str-pure-white #analysis-tab .zone-item label,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .zone-item label {
    color: #0f172a !important;
}

/* 1.11 Empty State */
#analysis-tab .empty-state p {
    color: var(--str-text-muted, #94a3b8) !important;
    text-shadow: none !important;
}

body.str-pure-white #analysis-tab .empty-state p,
body:not(.dark-mode):not(.cosmic-mode) #analysis-tab .empty-state p {
    color: #64748b !important;
}

/* 1.12 Nút Toggle trên Mobile */
#analysis-tab .mobile-toggle-btn {
    background: linear-gradient(135deg, var(--str-accent, #0284c7), var(--str-accent-mid, #2563eb)) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    box-shadow: 0 4px 14px var(--str-accent-soft, rgba(56, 189, 248, 0.4)) !important;
}