/* Default to DARK mode to prevent white flash on load */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #7c3aed;
    --secondary: #10b981;
    /* DARK MODE as default */
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --text: #f1f5f9;
    --text-medium: #cbd5e1;
    --text-light: #94a3b8;
    --border: #334155;
    --border-strong: #475569;
    --gain: #059669;
    --gain-bg: #064e3b;
    --loss: #dc2626;
    --loss-bg: #7f1d1d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 20px -3px rgba(0,0,0,0.5);
}

/* Light Mode - Only applies when explicitly set */
html.light-mode,
html.light-mode body,
body.light-mode {
    --bg: #fafbfc;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-medium: #475569;
    --text-light: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --gain-bg: #d1fae5;
    --loss-bg: #fee2e2;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 20px -3px rgba(0,0,0,0.1);
}

/* Light mode - ensure inputs work properly */
html.light-mode input[type="text"],
html.light-mode input[type="email"],
html.light-mode input[type="password"],
html.light-mode input[type="number"],
html.light-mode input[type="search"],
html.light-mode select,
html.light-mode textarea,
body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode input[type="number"],
body.light-mode input[type="search"],
body.light-mode select,
body.light-mode textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}

html.light-mode .risk-option,
body.light-mode .risk-option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Dark Mode Variables - Redundant but ensures compatibility */
html.dark-mode,
html.dark-mode body,
body.dark-mode {
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --text: #f1f5f9;
    --text-medium: #cbd5e1;
    --text-light: #94a3b8;
    --border: #334155;
    --border-strong: #475569;
    --gain-bg: #064e3b;
    --loss-bg: #7f1d1d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 20px -3px rgba(0,0,0,0.5);
}

/* Ensure html.dark-mode applies same overrides as body.dark-mode */
html.dark-mode .card,
html.dark-mode .risk-card,
html.dark-mode .modal,
html.dark-mode .header,
html.dark-mode input[type="text"],
html.dark-mode input[type="email"],
html.dark-mode input[type="password"],
html.dark-mode input[type="number"],
html.dark-mode select,
html.dark-mode textarea,
html.dark-mode .form-input,
html.dark-mode .form-label,
html.dark-mode .modal-title,
html.dark-mode .modal-subtitle,
html.dark-mode .modal-link,
html.dark-mode .stats-card,
html.dark-mode .metric-card,
html.dark-mode .stock-card {
    color: var(--text) !important;
    background: var(--bg-elevated) !important;
    border-color: var(--border) !important;
}

html.dark-mode .header {
    background: var(--bg-elevated) !important;
    border-bottom: 1px solid var(--border) !important;
}

html.dark-mode .nav-link {
    color: var(--text-medium) !important;
}

html.dark-mode .nav-link:hover,
html.dark-mode .nav-link.active {
    color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

html.dark-mode .form-label {
    color: var(--text-medium) !important;
}

html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: var(--text-light) !important;
    opacity: 0.7 !important;
}

/* CRITICAL: Prevent black text in dark mode - ensure all text is readable */
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6,
html.dark-mode p,
html.dark-mode span:not(.badge),
html.dark-mode div:not(.btn-primary):not(.btn-secondary):not([class*="btn-"]),
html.dark-mode a:not(.btn-primary):not(.btn-secondary),
html.dark-mode label,
html.dark-mode li,
html.dark-mode .modal-link,
html.dark-mode .modal-text,
html.dark-mode .modal-subtitle {
    color: var(--text) !important;
}

html.dark-mode .tagline,
html.dark-mode .search-title,
html.dark-mode .section-title,
html.dark-mode .section-subtitle {
    color: var(--text) !important;
}

/* Ensure body.dark-mode also has these fixes */
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 p,
body.dark-mode span:not(.badge),
body.dark-mode div:not(.btn-primary):not(.btn-secondary):not([class*="btn-"]),
body.dark-mode a:not(.btn-primary):not(.btn-secondary),
body.dark-mode label,
body.dark-mode li,
body.dark-mode .modal-link,
body.dark-mode .modal-text,
body.dark-mode .modal-subtitle,
body.dark-mode .tagline,
body.dark-mode .search-title,
body.dark-mode .section-title,
body.dark-mode .section-subtitle {
    color: var(--text) !important;
}

/* Dark Mode Overrides for Specific Elements */
body.dark-mode .card,
body.dark-mode .risk-card,
body.dark-mode .modal,
body.dark-mode .input-group input,
body.dark-mode .input-group select,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .stats-card,
body.dark-mode .metric-card,
body.dark-mode .news-item,
body.dark-mode .stock-card,
body.dark-mode .info-card,
body.dark-mode .result-card {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Dark mode input placeholder */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Dark mode labels */
body.dark-mode label,
body.dark-mode .form-label,
body.dark-mode .input-label {
    color: var(--text-medium) !important;
}

/* Dark mode cards with proper contrast */
body.dark-mode .risk-card {
    background: var(--bg-elevated) !important;
    border: 2px solid var(--border) !important;
}

body.dark-mode .risk-card.selected {
    background: #1e3a5f !important;
    border-color: var(--primary) !important;
}

/* Dark mode unselected risk cards */
body.dark-mode .risk-card:not(.selected) {
    background: #1a2332 !important;
}

/* Dark mode risk appetite options (portfolio page) */
body.dark-mode .risk-appetite-selector {
    background: transparent;
}

body.dark-mode .risk-option {
    background: var(--bg-elevated) !important;
    border: 2px solid var(--border) !important;
    color: var(--text) !important;
}

body.dark-mode .risk-option * {
    color: var(--text-medium) !important;
}

body.dark-mode .risk-option h4 {
    color: var(--text) !important;
}

body.dark-mode .risk-option .risk-description {
    color: var(--text-light) !important;
}

body.dark-mode .risk-option .risk-details li {
    color: var(--text-medium) !important;
}

body.dark-mode .risk-option.active {
    background: #1e3a5f !important;
    border-color: var(--primary) !important;
}

body.dark-mode .risk-option.active h4,
body.dark-mode .risk-option.active .risk-description,
body.dark-mode .risk-option.active .risk-details li {
    color: #ffffff !important;
}

body.dark-mode .risk-option:hover:not(.active) {
    background: #1a2332 !important;
    border-color: var(--border-strong) !important;
}

/* 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) !important;
}

/* Dark mode paragraph text */
body.dark-mode p,
body.dark-mode li,
body.dark-mode span,
body.dark-mode div {
    color: var(--text-medium);
}

/* Dark mode - catch all text elements */
body.dark-mode *:not(.btn):not(.badge):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success) {
    color: inherit;
}

/* Dark mode - force text color on all text elements */
body.dark-mode,
body.dark-mode * {
    border-color: var(--border);
}

body.dark-mode {
    color: var(--text) !important;
}

/* Dark mode - strong/bold text */
body.dark-mode strong,
body.dark-mode b {
    color: var(--text) !important;
}

/* Dark mode - links */
body.dark-mode a {
    color: var(--primary);
}

body.dark-mode a:hover {
    color: var(--primary-dark);
}

/* Dark mode - code blocks */
body.dark-mode code,
body.dark-mode pre {
    background: #1a2332;
    color: var(--text);
    border-color: var(--border);
}

/* Dark mode tables */
body.dark-mode table {
    background: var(--bg-elevated);
    color: var(--text);
}

body.dark-mode th {
    background: #1a2332;
    color: var(--text);
    border-color: var(--border);
}

body.dark-mode td {
    border-color: var(--border);
    color: var(--text-medium);
}

body.dark-mode tr:hover {
    background: #1a2332;
}

/* Dark mode modals */
body.dark-mode .modal {
    background: var(--bg-elevated) !important;
}

body.dark-mode .modal-header {
    border-bottom: 1px solid var(--border);
}

body.dark-mode .modal-footer {
    border-top: 1px solid var(--border);
}

/* Dark mode buttons keep their colors */
body.dark-mode .btn-primary,
body.dark-mode .btn-secondary {
    /* Keep original button colors */
}

/* Dark mode form inputs */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    color: var(--text) !important;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: var(--primary);
    background: #1a2332 !important;
    color: var(--text) !important;
}

/* Dark mode disabled inputs */
body.dark-mode input:disabled,
body.dark-mode select:disabled,
body.dark-mode textarea:disabled {
    background: #1a2332;
    color: var(--text-light);
    opacity: 0.6;
}

/* Dark mode navigation */
body.dark-mode nav,
body.dark-mode .navbar,
body.dark-mode .header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

/* Dark mode tabs */
body.dark-mode .tabs button,
body.dark-mode .tab-button {
    color: var(--text-light);
    background: transparent;
}

body.dark-mode .tabs button.active,
body.dark-mode .tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Dark mode - small text, captions, etc */
body.dark-mode small,
body.dark-mode .small-text,
body.dark-mode .caption,
body.dark-mode .subtitle {
    color: var(--text-light) !important;
}

/* Dark mode - ensure all divs, sections, articles get proper text color */
body.dark-mode div,
body.dark-mode section,
body.dark-mode article,
body.dark-mode aside,
body.dark-mode main,
body.dark-mode footer,
body.dark-mode header {
    color: var(--text-medium);
}

/* Dark mode - modal text */
body.dark-mode .modal-title,
body.dark-mode .modal-subtitle,
body.dark-mode .modal-link,
body.dark-mode .modal-text {
    color: var(--text) !important;
}

/* Dark mode - form labels and text */
body.dark-mode .form-label,
body.dark-mode .form-text,
body.dark-mode .form-error,
body.dark-mode .input-label {
    color: var(--text-medium) !important;
}

/* Dark mode - description text */
body.dark-mode .description,
body.dark-mode .note,
body.dark-mode .hint,
body.dark-mode .help-text {
    color: var(--text-light) !important;
}

/* Dark mode - metrics, stats, values, numbers */
body.dark-mode .metric,
body.dark-mode .metric-value,
body.dark-mode .stat,
body.dark-mode .stat-value,
body.dark-mode .value,
body.dark-mode .number,
body.dark-mode .price,
body.dark-mode .amount,
body.dark-mode .percentage {
    color: var(--text) !important;
}

/* Dark mode - card titles and content */
body.dark-mode .card-title,
body.dark-mode .card-subtitle,
body.dark-mode .card-text,
body.dark-mode .card-content {
    color: var(--text) !important;
}

/* Dark mode - list items */
body.dark-mode ul li,
body.dark-mode ol li {
    color: var(--text-medium) !important;
}

/* Dark mode - ensure text in all containers */
body.dark-mode .container,
body.dark-mode .wrapper,
body.dark-mode .content,
body.dark-mode .main-content {
    color: var(--text);
}

/* Dark mode scrollbar */
body.dark-mode ::-webkit-scrollbar {
    background: var(--bg);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--border);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* Dark mode tooltips */
body.dark-mode .tooltip,
body.dark-mode .tooltip-content {
    background: #1a2332;
    color: var(--text);
    border: 1px solid var(--border);
}

/* Dark mode charts (if using Chart.js) */
body.dark-mode canvas {
    filter: brightness(0.9);
}

/* Dark mode alerts/notifications */
body.dark-mode .alert,
body.dark-mode .notification {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text);
}

/* Dark mode success states */
body.dark-mode .success,
body.dark-mode .form-success {
    background: #064e3b !important;
    color: #86efac !important;
    border-color: #10b981 !important;
}

/* Dark mode error states */
body.dark-mode .error,
body.dark-mode .form-error {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
    border-color: #ef4444 !important;
}

/* Dark mode warning states */
body.dark-mode .warning,
body.dark-mode .spam-notice {
    background: #451a03 !important;
    color: #fcd34d !important;
    border-color: #f59e0b !important;
}

/* Neutral badge fix - TARGET THE ACTUAL CLASS */
/* Fix badge-info (used for Neutral sentiment) */
.badge-info {
    background: #6b7280 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

body.dark-mode .badge-info {
    background: #6b7280 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Additional neutral badge selectors */
.sentiment-neutral,
[class*="neutral" i],
.badge-neutral {
    background: #6b7280 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

body.dark-mode .sentiment-neutral,
body.dark-mode [class*="neutral" i],
body.dark-mode .badge-neutral {
    background: #6b7280 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

body.dark-mode .sentiment-positive,
body.dark-mode [class*="positive"],
body.dark-mode .badge-positive {
    background: #064e3b !important;
    color: #86efac !important;
}

body.dark-mode .sentiment-negative,
body.dark-mode [class*="negative"],
body.dark-mode .badge-negative {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
}

/* Dark mode metric cards - remove black backgrounds */
body.dark-mode .metrics-grid,
body.dark-mode .metric-item,
body.dark-mode .health-metric,
body.dark-mode .growth-metric,
body.dark-mode .profitability-metric,
body.dark-mode .financial-health,
body.dark-mode [class*="metric"] {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
}

/* Dark mode metric values */
body.dark-mode .metric-value,
body.dark-mode .metric-label,
body.dark-mode [class*="metric"] strong,
body.dark-mode [class*="metric"] span {
    color: var(--text) !important;
    background: transparent !important;
}

/* Dark mode stock info sections */
body.dark-mode .stock-info,
body.dark-mode .company-info,
body.dark-mode .financial-metrics {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 60px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global input styling to ensure consistent colors - HIGHEST PRIORITY */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light) !important;
    opacity: 0.7;
}

select option {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
}

/* Ensure search inputs specifically are styled */
.search-input,
#q,
#addStockInputApp,
.watchlist-input {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border 0.2s;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
}

.tagline {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.section {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}

.section:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.info-callout {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 14px 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.info-callout-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 13px;
}

.info-callout-text {
    color: var(--text-medium);
    font-size: 13px;
    line-height: 1.6;
}

.search-section {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.search-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.search-subtitle {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 14px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 800px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 500;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: var(--bg-elevated);
    color: var(--text);
}

.search-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.search-clear.visible {
    opacity: 1;
    pointer-events: auto;
}

.search-clear:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.popular-stocks {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: center;
}

.stock-chip {
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stock-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.recent-searches {
    margin: 12px 0;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

#recentList {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 1;
}

.recent-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.recent-item {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recent-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.recent-clear {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}

.recent-clear:hover {
    color: var(--text);
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

/* Ensure solid background in light mode */
body.light-mode .toast {
    background: rgba(255, 255, 255, 0.98);
}

/* Ensure solid background in dark mode */
body.dark-mode .toast {
    background: rgba(26, 35, 50, 0.98);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.toast-success {
    border-left: 3px solid var(--gain);
}

.toast.toast-success .toast-icon {
    color: var(--gain);
}

.toast.toast-error {
    border-left: 3px solid var(--loss);
}

.toast.toast-error .toast-icon {
    color: var(--loss);
}

.toast.toast-info {
    border-left: 3px solid var(--primary);
}

.toast.toast-info .toast-icon {
    color: var(--primary);
}

.toast-content {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text);
}

.card {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.chart-container {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.table-wrapper table {
    min-width: 600px;
    margin: 0;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

th {
    background: var(--bg);
    color: var(--text-medium);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-medium);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--bg);
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-metric {
    height: 60px;
    border-radius: 10px;
    margin: 6px;
}

.skeleton-text {
    height: 16px;
    margin: 8px 0;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 8px;
    font-size: 18px;
}

.favorites-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
    background: var(--bg);
    border-radius: 12px;
    border: 2px dashed var(--border);
}

/* Watchlist Autocomplete Suggestions */
.watchlist-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
}

.watchlist-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--border);
}

.watchlist-suggestion-item:last-child {
    border-bottom: none;
}

.watchlist-suggestion-item:hover {
    background: var(--primary);
    color: white;
}

.watchlist-suggestion-item:hover div {
    color: white !important;
}

/* Dark mode adjustments */
body.dark-mode .watchlist-suggestions {
    background: var(--card);
    border-color: var(--border-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .watchlist-suggestion-item {
    border-bottom-color: var(--border);
}

body.dark-mode .watchlist-suggestion-item:hover {
    background: var(--primary);
}

.empty-state p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    font-weight: 500;
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: var(--gain-bg);
    color: var(--gain);
}

.badge-danger {
    background: var(--loss-bg);
    color: var(--loss);
}

.badge-info {
    background: #e0e7ff;
    color: #4338ca;
}

.stock-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.stock-badge.stock-0 { background: var(--primary); }
.stock-badge.stock-1 { background: var(--secondary); }
.stock-badge.stock-2 { background: var(--accent); }
.stock-badge.stock-3 { background: #f59e0b; }
.stock-badge.stock-4 { background: #ec4899; }

.rating-badge {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    align-items: center;
}

.rating-splus, .rating-s { background: var(--gain); color: #fff; }
.rating-aplus, .rating-a { background: var(--primary); color: #fff; }
.rating-bplus, .rating-b { background: var(--accent); color: #fff; }
.rating-cplus, .rating-c { background: #f59e0b; color: #fff; }
.rating-d, .rating-f { background: var(--loss); color: #fff; }

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.info-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Info Tooltip Popup (Orange Box from Image) */
.metric-info-tooltip {
    position: fixed;
    top: 120px;
    right: 20px;
    max-width: 400px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.metric-info-content {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(234, 88, 12, 0.1));
    border: 2px solid rgba(249, 115, 22, 0.5);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    position: relative;
}

body.dark-mode .metric-info-content {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.15));
    border-color: rgba(249, 115, 22, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.metric-info-content p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

.metric-info-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-medium);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.metric-info-close:hover {
    color: var(--text);
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .metric-info-tooltip {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

.metrics-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.metric-category {
    background: var(--bg-elevated);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 16px;
}

.category-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.financial-toggle {
    display: none;
    gap: 6px;
    justify-content: center;
    margin: 16px 0;
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border);
}

.financial-toggle.show {
    display: flex;
}

.financial-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 14px;
}

.financial-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.financial-btn.active {
    background: var(--primary);
    color: white;
}

.ai-snapshot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 10px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

.ai-snapshot-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 600;
}

.trend-good {
    color: var(--gain);
    font-weight: 600;
}

.trend-bad {
    color: var(--loss);
    font-weight: 600;
}

.trend-flat {
    color: var(--text-light);
    font-weight: 500;
}

/* Auth & User Interface */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.btn-logout {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--loss-bg);
    border-color: var(--loss);
    color: var(--loss);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

/* Ensure solid background for modals */
body.light-mode .modal {
    background: rgba(255, 255, 255, 0.98);
}

body.dark-mode .modal {
    background: rgba(26, 35, 50, 0.98);
}

/* Ensure modal inputs have proper styling */
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="number"],
.modal select,
.modal textarea {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

.modal input::placeholder,
.modal textarea::placeholder {
    color: var(--text-light) !important;
    opacity: 0.7;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-medium);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-medium);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
}

.form-input::placeholder {
    color: var(--text-light) !important;
    opacity: 0.7;
}

.form-error {
    color: var(--loss);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-success {
    color: #4CAF50;
    background: #e8f5e9;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    display: none;
    border-left: 3px solid #4CAF50;
}

/* Spam Notice */
.spam-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
}

.spam-notice p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.spam-notice strong {
    color: #664d03;
}

.spam-notice ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.spam-notice li {
    margin: 6px 0;
    padding-left: 5px;
}

.spam-notice li::before {
    content: "→ ";
    font-weight: bold;
    color: #ffc107;
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.btn-full {
    flex: 1;
}

.modal-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-medium);
}

.modal-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.modal-link a:hover {
    text-decoration: underline;
}

/* Favorites */
.favorites-section {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.favorites-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.favorite-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.favorite-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.favorite-ticker {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.favorite-name {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    min-height: 32px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.favorite-change-container {
    margin-bottom: 8px;
}

.favorite-change-label {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.favorite-change {
    font-size: 15px;
    font-weight: 700;
}

.favorite-date {
    font-size: 11px;
    color: var(--text-light);
}

.favorite-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--loss-bg);
    color: var(--loss);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.favorite-card:hover .favorite-remove {
    opacity: 1;
}

.favorite-remove:hover {
    background: var(--loss);
    color: white;
}

.favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.btn-favorite {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-medium);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-favorite:hover {
    border-color: var(--gain);
    color: var(--gain);
}

.btn-favorite.favorited {
    background: var(--gain-bg);
    border-color: var(--gain);
    color: var(--gain);
}

.btn-favorite.favorited:hover {
    background: var(--gain);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    color: var(--text-medium);
    font-weight: 500;
}

/* ========================================
   AI FEATURES
   ======================================== */

.ai-card {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(16, 185, 129, 0.03));
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.ai-card-header:hover {
    background: rgba(37, 99, 235, 0.05);
}

.ai-badge {
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #10b981);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.ai-toggle {
    color: var(--text-medium);
    font-size: 14px;
    transition: transform 0.2s ease;
}

.ai-card-content {
    padding: 20px;
}

.ai-insight-text {
    line-height: 1.7;
    color: var(--text);
    font-size: 15px;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px;
    color: var(--text-medium);
}

.ai-error {
    padding: 16px;
    background: var(--loss-bg);
    border-left: 3px solid var(--loss);
    border-radius: 6px;
    color: var(--loss);
}

.ai-disabled {
    padding: 16px;
    text-align: center;
    color: var(--text-light);
}

.btn-ai-ask {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #10b981);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-ai-ask:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Risk Appetite Selector Styles */
.risk-appetite-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.risk-option {
    background: var(--bg-elevated) !important;
    border: 2px solid var(--border) !important;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text) !important;
}

.risk-option * {
    color: var(--text) !important;
}

.risk-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.risk-option.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1)) !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.risk-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.risk-option h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text) !important;
    font-weight: 700;
}

.risk-description {
    margin: 0 0 12px 0;
    color: var(--text-medium) !important;
    font-size: 14px;
}

.risk-details {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
    font-size: 13px;
    color: var(--text-light) !important;
    line-height: 1.8;
}

.risk-details li {
    color: var(--text-light) !important;
    padding-left: 16px;
    position: relative;
}

.risk-details li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.btn-ai {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-ai:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-insights-content {
    padding: 20px;
    background: var(--bg);
    border-radius: 8px;
    color: var(--text);
}

body.dark-mode .ai-insights-content {
    background: var(--card);
}

.ai-question {
    background: var(--bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
}

.ai-question p {
    margin: 8px 0 0 0;
    color: var(--text);
}

.ai-answer {
    padding: 16px;
}

.ai-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-medium);
}

.ai-response-text {
    color: var(--text);
    line-height: 1.6;
}

.ai-response-text h4 {
    color: var(--text);
    margin: 16px 0 8px 0;
}

.ai-response-text ul {
    padding-left: 20px;
    color: var(--text-medium);
}

.ai-response-text p {
    margin: 12px 0;
}

.ai-modal .modal-body {
    padding: 24px;
}

/* Success Message Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .chart-canvas-wrapper {
        height: 300px;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .metrics-categories {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .chart-canvas-wrapper {
        height: 250px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PORTFOLIO OPTIMIZER
   ======================================== */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: var(--text-light) !important;
    opacity: 0.7;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.allocation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.allocation-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.allocation-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.allocation-meta {
    font-size: 12px;
    color: var(--text-medium);
}

.allocation-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.allocation-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.allocation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.allocation-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.allocation-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.allocation-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.allocation-number {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.allocation-percent {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.metrics-table thead {
    background: var(--bg);
}

.metrics-table th {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

.metrics-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.metrics-table tr:last-child td {
    border-bottom: none;
}

.metrics-table .positive {
    color: var(--gain);
    font-weight: 600;
}

.metrics-table .negative {
    color: var(--loss);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-medium);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.concentration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.concentration-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.concentration-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.concentration-card canvas {
    max-height: 300px;
}

.risk-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.risk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.risk-item span {
    font-size: 14px;
    color: var(--text-medium);
}

.risk-item strong {
    font-size: 16px;
    color: var(--primary);
}

.btn-block {
    width: 100%;
    margin-top: 24px;
}

/* ========================================
   MOBILE RESPONSIVENESS (ALL PAGES)
   ======================================== */

@media (max-width: 768px) {
    /* Header & Navigation */
    .header {
        padding: 12px 0;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .tagline {
        font-size: 11px;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-link {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .user-menu {
        font-size: 12px;
    }
    
    .btn-secondary,
    .btn-primary {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    /* Container */
    .container {
        padding: 0 16px;
    }
    
    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card h2,
    .card h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    /* Search */
    .search-bar {
        flex-direction: column;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
    }
    
    /* Tables */
    .comparison-table,
    .metrics-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    .comparison-table th,
    .comparison-table td,
    .metrics-table th,
    .metrics-table td {
        padding: 8px 6px;
        min-width: 80px;
    }
    
    /* Stock Grid */
    .stock-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Favorites */
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio Optimizer */
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .allocation-grid {
        grid-template-columns: 1fr;
    }
    
    .concentration-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .allocation-item {
        padding: 12px;
    }
    
    .form-section-title {
        font-size: 16px;
    }
    
    /* Risk Appetite Selector Mobile */
    .risk-appetite-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .risk-option {
        padding: 16px;
    }
    
    .risk-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }
    
    .risk-option h4 {
        font-size: 16px;
    }
    
    .risk-description {
        font-size: 13px;
    }
    
    .risk-details {
        font-size: 12px;
    }
    
    .btn-ai {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
    }
    
    .tab-btn {
        font-size: 13px;
        padding: 10px 16px;
        white-space: nowrap;
    }
    
    /* Screener */
    .screener-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-panel {
        position: sticky;
        top: 60px;
        z-index: 10;
        background: var(--bg-elevated);
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .results-panel {
        padding: 0;
    }
    
    .screener-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    .screener-table th,
    .screener-table td {
        padding: 8px 6px;
        min-width: 70px;
    }
    
    /* Modals */
    .modal {
        max-width: 95%;
        margin: 20px;
        padding: 20px;
    }
    
    .modal-header h2,
    .modal-header h3 {
        font-size: 18px;
    }
    
    /* Charts */
    .chart-container {
        height: 250px !important;
    }
    
    canvas {
        max-width: 100%;
    }
    
    /* Buttons */
    .btn-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-ai-ask {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    /* Pagination */
    .pagination {
        gap: 4px;
    }
    
    .pagination button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Empty State */
    .empty-state {
        padding: 40px 16px;
    }
    
    /* AI Cards */
    .ai-card {
        margin-bottom: 16px;
    }
    
    .ai-card-header {
        padding: 12px 16px;
    }
    
    .ai-card-content {
        padding: 16px;
    }
    
    /* Utility */
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .logo {
        font-size: 16px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .tagline {
        display: none;
    }
    
    .nav-link {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .card {
        padding: 12px;
    }
    
    .modal {
        padding: 16px;
    }
    
    .comparison-table th,
    .comparison-table td,
    .metrics-table th,
    .metrics-table td,
    .screener-table th,
    .screener-table td {
        padding: 6px 4px;
        min-width: 60px;
        font-size: 11px;
    }
}

/* ========================================
   TOOLTIP SYSTEM FOR BEGINNERS
   ======================================== */

.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: help;
    position: relative;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    flex-shrink: 0;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    width: 280px;
    max-width: 90vw;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    white-space: normal;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
}

.tooltip:hover .tooltip-content,
.tooltip-trigger:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content strong {
    display: block;
    margin-bottom: 6px;
    color: #60a5fa;
    font-size: 14px;
}

.tooltip-content .good {
    color: #4ade80;
}

.tooltip-content .bad {
    color: #f87171;
}

.tooltip-content .neutral {
    color: #fbbf24;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .tooltip-content {
        width: 240px;
        font-size: 12px;
        padding: 10px 14px;
    }
    
    .tooltip-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 1000;
    user-select: none;
}

.dark-mode-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 24px -6px rgba(0,0,0,0.2);
}

.dark-mode-toggle:active {
    transform: translateY(0) scale(0.95);
}

/* Icon animations */
.dark-mode-toggle .icon {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.dark-mode-toggle .sun-icon,
.dark-mode-toggle .moon-icon {
    position: absolute;
    transition: all 0.3s ease;
}

.dark-mode-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.dark-mode-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

body.dark-mode .dark-mode-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

body.dark-mode .dark-mode-toggle .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dark-mode-toggle {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Chart Time Period Buttons */
.chart-time-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 6px 14px;
    border: 2px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-medium);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.time-btn:hover {
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text);
}

.time-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.time-btn:active {
    transform: scale(0.95);
}

body.dark-mode .time-btn {
    border-color: var(--border);
    background: var(--bg-elevated);
    color: var(--text-medium);
}

body.dark-mode .time-btn:hover {
    background: #1a2332;
    border-color: var(--border-strong);
    color: var(--text);
}

body.dark-mode .time-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .chart-time-buttons {
        gap: 4px;
    }
    
    .time-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}


/* ========================================
   TIERING - PRO FEATURE LOCKED STYLES
   ======================================== */

/* Pro Feature Locked Card */
.pro-feature-locked {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin: 24px 0;
}

body.dark-mode .pro-feature-locked {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: var(--border-strong);
}

.pro-feature-locked .lock-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.pro-feature-locked h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.pro-feature-locked p {
    color: var(--text-medium);
    margin-bottom: 16px;
}

.pro-feature-locked ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.pro-feature-locked ul li {
    padding: 8px 0;
    color: var(--text);
    font-size: 14px;
}

.pro-feature-locked .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pro-feature-locked .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Upgrade Modal Styles */
.upgrade-benefits {
    background: var(--bg);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.upgrade-benefits h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.upgrade-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upgrade-benefits ul li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
}

/* Usage Counter Styles */
#stock-analysis-counter,
#screener-counter {
    display: none;
    font-size: 13px;
    color: var(--text-light);
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-top: 8px;
}

body.dark-mode #stock-analysis-counter,
body.dark-mode #screener-counter {
    background: var(--bg-elevated);
    color: var(--text-medium);
}

/* Guest Counter Styles */
#guest-stock-counter {
    display: none;
    font-size: 13px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    margin-top: 10px;
}

body.dark-mode #guest-stock-counter {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.15));
    border-color: rgba(59, 130, 246, 0.4);
}

#guest-stock-counter button {
    font-size: 12px !important;
}

/* ========================================
   UNIFIED LOCKED FEATURE MODAL & PRICING
   ======================================== */

/* Pricing Comparison Cards */
.pricing-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.pricing-card {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.recommended {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.recommended-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 20px;
}

.pricing-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.pricing-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin: 12px 0;
}

.pricing-amount span {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-medium);
}

.pricing-toggle {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}

.pricing-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-medium);
    cursor: pointer;
}

.pricing-toggle input[type="radio"] {
    cursor: pointer;
}

.save-badge {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pricing-benefits {
    margin: 20px 0;
}

.pricing-benefits strong {
    display: block;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 14px;
}

.pricing-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-benefits ul li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.no-credit-card {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-medium);
    font-weight: 600;
}

.btn-cta {
    width: 100%;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.btn-free {
    background: var(--secondary);
    color: white;
}

.btn-free:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-pro {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
}

.btn-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-pro-large {
    width: 100%;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.btn-pro-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Single Upgrade Card (for Free tier users) */
.upgrade-single-card {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(29, 78, 216, 0.05));
    border: 2px solid var(--primary);
    border-radius: 12px;
}

.pricing-toggle-center {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: 8px;
}

.pricing-toggle-center label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.pricing-toggle-center label:hover {
    background: var(--bg);
}

.pricing-toggle-center input[type="radio"] {
    cursor: pointer;
}

.upgrade-benefits {
    margin: 20px 0;
}

.upgrade-benefits h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.upgrade-benefits ul {
    list-style: none;
    padding: 0;
}

.upgrade-benefits ul li {
    padding: 10px 0;
    font-size: 15px;
    color: var(--text);
}

.reassurance {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-medium);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-medium);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
    transform: rotate(90deg);
}

/* Dark Mode Overrides */
body.dark-mode .pricing-card {
    background: var(--bg-elevated);
    border-color: var(--border);
}

body.dark-mode .pricing-card.recommended {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.dark-mode .upgrade-single-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(29, 78, 216, 0.1));
}

body.dark-mode .pricing-toggle-center {
    background: var(--bg);
}

body.dark-mode .modal-close {
    background: var(--bg);
    color: var(--text-medium);
}

body.dark-mode .modal-close:hover {
    background: var(--border);
    color: var(--text);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pricing-comparison {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pricing-amount {
        font-size: 28px;
    }
    
    .btn-cta {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .recommended-badge {
        font-size: 10px;
        padding: 3px 12px;
    }
}

/* AI Locked Card Styling */
.ai-locked-card {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(59, 130, 246, 0.05));
    border: 2px dashed var(--border);
    border-radius: 12px;
}

.ai-locked-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.ai-locked-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text);
}

.ai-locked-card > p {
    color: var(--text-medium);
    margin-bottom: 20px;
    font-size: 14px;
}

.ai-locked-benefits {
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
}

.ai-locked-benefits p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text);
}

.ai-locked-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-locked-benefits ul li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text);
}

.ai-locked-card .btn-pro {
    margin-top: 20px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-locked-card .btn-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

body.dark-mode .ai-locked-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
    border-color: var(--border-strong);
}

body.dark-mode .ai-locked-benefits {
    background: var(--bg-elevated);
}

/* Fix Pricing Card Symmetry */
.pricing-card {
    display: flex;
    flex-direction: column;
    min-height: 500px; /* Ensure consistent height */
}

.pricing-header {
    flex-shrink: 0; /* Don't shrink header */
}

.pricing-benefits {
    flex-grow: 1; /* Benefits take remaining space */
}

.pricing-benefits ul {
    min-height: 200px; /* Ensure list area has consistent height */
}

.btn-cta {
    flex-shrink: 0; /* Keep button at bottom */
    margin-top: auto; /* Push to bottom */
}

/* Ensure both cards have same height in comparison view */
.pricing-comparison .pricing-card {
    height: 100%; /* Fill parent height equally */
}

@media (max-width: 768px) {
    .pricing-card {
        min-height: auto; /* Allow natural height on mobile */
    }
}

/* Pro Badge for Advanced Options */
.pro-badge {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Disabled checkbox styling for locked features */
input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

label:has(input[type="checkbox"]:disabled) {
    opacity: 0.6;
    cursor: pointer;
}

/* Dark mode */
body.dark-mode .pro-badge {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
}

/* ========================================
   UNIFIED LOCKED FEATURE BANNER
   ======================================== */

.unified-locked-banner {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin: 24px 0;
    box-shadow: var(--shadow-lg);
}

.banner-header {
    text-align: center;
    margin-bottom: 32px;
}

.banner-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.banner-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.banner-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: start;
}

.banner-section {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.free-section {
    border-color: var(--secondary);
}

.pro-section {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.dark-mode .pro-section {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.section-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.free-badge {
    background: var(--secondary);
    color: white;
}

.pro-badge {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
}

.banner-section h3 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    margin: 12px 0 4px 0;
    line-height: 1;
}

.banner-section h3 .period {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-medium);
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-medium);
    margin: 0 0 16px 0;
    min-height: 20px;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    text-align: left;
}

.benefits-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.no-cc {
    font-size: 12px;
    color: var(--text-medium);
    margin: 16px 0;
    font-weight: 600;
}

.banner-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-free {
    background: var(--secondary);
    color: white;
}

.btn-free:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-pro {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
}

.btn-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.banner-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.banner-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 80%;
    background: var(--border);
}

.divider-text {
    background: var(--bg-elevated);
    padding: 8px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-medium);
    border: 2px solid var(--border);
    position: relative;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 968px) {
    .banner-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .banner-divider {
        display: none;
    }
    
    .banner-header h2 {
        font-size: 22px;
    }
    
    .banner-icon {
        font-size: 48px;
    }
    
    .banner-section h3 {
        font-size: 36px;
    }
}

/* Dark Mode */
body.dark-mode .unified-locked-banner {
    background: var(--bg);
    border-color: var(--border-strong);
}

body.dark-mode .banner-section {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

body.dark-mode .free-section {
    border-color: var(--secondary);
}

body.dark-mode .pro-section {
    border-color: var(--primary);
}

body.dark-mode .divider-text {
    background: var(--bg);
}

/* ========================================
   PRICING COMPARISON PAGE
   ======================================== */

.pricing-billing-toggle {
    display: inline-flex;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.billing-btn {
    padding: 12px 28px;
    border: none;
    background: transparent;
    color: var(--text-medium);
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.billing-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.billing-btn .save-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 700;
}

.pricing-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
    margin: 0 auto;
}

.pricing-comparison-card {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.pricing-comparison-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.pricing-comparison-card.pro-card {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    position: relative;
}

body.dark-mode .pricing-comparison-card.pro-card {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.plan-header {
    text-align: center;
    margin-bottom: 32px;
}

.plan-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.free-badge {
    background: var(--secondary);
    color: white;
}

.pro-badge {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
}

.plan-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px 0;
}

.plan-price {
    margin-bottom: 12px;
}

.price-amount {
    font-size: 56px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.price-period {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-medium);
}

.plan-description {
    font-size: 15px;
    color: var(--text-medium);
    margin: 0;
    min-height: 22px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    flex-grow: 1;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item.highlight {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), transparent);
    padding: 16px;
    margin: 0 -16px;
    border-radius: 8px;
    border-bottom: none;
}

.feature-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.feature-item strong {
    font-size: 16px;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.feature-detail {
    font-size: 13px;
    color: var(--text-medium);
    margin: 0;
}

.plan-cta {
    text-align: center;
}

.no-cc {
    font-size: 13px;
    color: var(--text-medium);
    margin: 0 0 16px 0;
    font-weight: 600;
}

.cancel-anytime {
    font-size: 13px;
    color: var(--text-medium);
    margin: 16px 0 0 0;
}

.btn-plan {
    width: 100%;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-free {
    background: var(--secondary);
    color: white;
}

.btn-free:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-pro {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
}

.btn-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* FAQ Section */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: left;
}

.faq-item h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
}

.faq-item p {
    font-size: 15px;
    color: var(--text-medium);
    margin: 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 968px) {
    .pricing-comparison {
        grid-template-columns: 1fr;
    }
    
    .pricing-billing-toggle {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .billing-btn {
        width: 100%;
    }
}

/* Dark Mode */
body.dark-mode .pricing-comparison-card {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

body.dark-mode .pricing-comparison-card.pro-card {
    border-color: var(--primary);
}

body.dark-mode .pricing-billing-toggle {
    background: var(--bg);
    border-color: var(--border-strong);
}

body.dark-mode .faq-item {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

/* ========================================
   CUSTOM FILTER BUILDER
   ======================================== */
.icon-selector {
    transition: all 0.2s ease;
}

.icon-selector:hover {
    transform: scale(1.1);
    border-color: var(--primary) !important;
}

.icon-selector.selected {
    border-color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.benefit-item {
    font-size: 14px;
    color: var(--text);
    margin: 8px 0;
    padding-left: 4px;
}

body.dark-mode .icon-selector {
    background: var(--bg);
    color: var(--text);
}

body.dark-mode .icon-selector:hover {
    background: var(--bg-elevated);
}

body.dark-mode .icon-selector.selected {
    background: rgba(37, 99, 235, 0.2) !important;
}

/* ========================================
   PRESET FILTER CUSTOMIZE BUTTON
   ======================================== */
.filter-btn:hover .preset-customize-btn {
    opacity: 1 !important;
}

.preset-customize-btn:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--primary) !important;
}

body.dark-mode .preset-customize-btn:hover {
    background: var(--bg-secondary) !important;
}
