/**
 * MANIBOT MATERIAL DESIGN
 * Clean, modern, professional design system
 */

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f5f5f5;
    color: #212121;
    line-height: 1.6;
}

/* COLORS */
:root {
    --primary: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary: #dc004e;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --divider: #e0e0e0;
}

/* APP BAR */
.app-bar {
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-bar-leading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* BUTTONS */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.btn-text {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-text:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--primary);
}

.icon-btn {
    background: transparent;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--error);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* USER PROFILE */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.balance-chip {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* NAVIGATION RAIL */
.navigation-rail {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    width: 88px;
    background: var(--surface);
    border-right: 1px solid var(--divider);
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 16px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(25, 118, 210, 0.08);
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(25, 118, 210, 0.12);
    border-left-color: var(--primary);
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* MAIN CONTENT */
.main-content {
    margin-left: 88px;
    padding: 24px;
    max-width: calc(1400px + 88px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 20px;
    box-sizing: border-box;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: -1;
    pointer-events: none;
}

.modal-dialog {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    z-index: 1;
    pointer-events: auto;
    margin: 0 auto;
}

.modal-dialog.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--divider);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--divider);
}

/* Learning Center Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-in-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Hidden Utility */
.hidden {
    display: none !important;
}

.view-header {
    margin-bottom: 24px;
}

.view-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

/* CARDS */
.card {
    background: var(--surface);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* FORMS */
.form-group {
    margin-bottom: 14px;
}

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

/* Profile Modal Compact Form */
#profileModal .form-group {
    margin-bottom: 12px;
}

#profileModal .form-group:last-child {
    margin-bottom: 0;
}

#profileModal input,
#profileModal textarea,
#profileModal select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--md-sys-color-outline, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#profileModal input:focus,
#profileModal textarea:focus,
#profileModal select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

#profileModal textarea {
    resize: vertical;
    min-height: 60px;
}

#profileModal .readonly-input {
    background: var(--md-sys-color-surface-variant, #f5f5f5);
    cursor: not-allowed;
    opacity: 0.8;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Input with Prefix (Dollar Sign) */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.input-with-prefix .form-input,
.input-with-prefix .form-input-enhanced {
    padding-left: 28px;
}

/* Enhanced Form Controls */
.form-input-enhanced,
.form-select-enhanced {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s, background-color 0.2s;
}

.form-input-enhanced:focus,
.form-select-enhanced:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-select-enhanced {
    font-size: 13px;
    cursor: pointer;
}

.form-select-enhanced option {
    font-size: 13px;
    padding: 8px;
}

.form-textarea-enhanced {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.form-textarea-enhanced:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* TABLES */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--divider);
}

th {
    background: #f5f5f5;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* CHIPS */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--divider);
    color: var(--text-primary);
}

.chip.success { background: #e8f5e9; color: #2e7d32; }
.chip.warning { background: #fff3e0; color: #f57c00; }
.chip.error { background: #ffebee; color: #c62828; }

/* LOADING */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* NOTIFICATION PANEL */
.notification-panel {
    position: absolute;
    right: 0;
    top: 60px;
    width: 360px;
    max-height: 480px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
}

.notification-header {
    padding: 16px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

/* LANDING PAGE */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
}

.hero-section {
    text-align: center;
    padding: 60px 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .navigation-rail {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 64px;
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-right: none;
        border-top: 1px solid var(--divider);
        padding: 8px 4px;
        gap: 0;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    .navigation-rail::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
        padding: 16px;
        padding-bottom: 80px;
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .sidebar-widget {
        display: none !important;
    }
    
    .nav-label {
        font-size: 11px;
    }
    
    .nav-item {
        flex-direction: column;
        padding: 8px 12px;
        gap: 4px;
        flex-shrink: 0;
        min-width: 70px;
    }
}

/* ========== LEARNING CENTER STYLES ========== */

/* Learning Tabs */
.tabs-container {
    background: var(--surface);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(0,0,0,0.05);
}

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

.tab .material-icons {
    font-size: 20px;
}

.learning-tab-content {
    display: none;
}

.learning-tab-content.active {
    display: block;
}

/* Lesson Cards */
.tutorials-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.lesson-category h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.lessons-list {
    display: grid;
    gap: 16px;
}

.lesson-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.lesson-header h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.lesson-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.completion-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Glossary */
.search-bar-container {
    position: relative;
}

.search-bar-container .search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 2px solid var(--divider);
    border-radius: 8px;
    font-size: 16px;
}

.search-bar-container .material-icons {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

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

.glossary-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.glossary-term {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.glossary-definition {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Strategy Education Cards */
.strategy-filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    border: 2px solid var(--divider);
    background: var(--surface);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.strategy-education-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.strategy-education-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.strategy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.strategy-card-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-low {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.badge-medium {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
}

.badge-high {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.strategy-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.strategy-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.strategy-params {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card.unlocked {
    border: 2px solid var(--success);
}

.achievement-card.unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success), var(--primary));
}

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

.achievement-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.achievement-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.achievement-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.achievement-card.unlocked .achievement-badge {
    background: var(--success);
    color: white;
}

.achievement-card.locked .achievement-badge {
    background: var(--divider);
    color: var(--text-secondary);
}

/* Accessibility Controls */
.accessibility-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* High Contrast Mode */
body.high-contrast {
    background: #000;
    color: #fff;
}

body.high-contrast .trading-card,
body.high-contrast .lesson-card,
body.high-contrast .glossary-card,
body.high-contrast .strategy-education-card,
body.high-contrast .achievement-card {
    background: #1a1a1a;
    border: 2px solid #fff;
}

body.high-contrast .app-bar {
    background: #000;
    border-bottom: 2px solid #fff;
}

/* Lesson Content Styles */
.tip-box,
.example-box,
.formula-box,
.warning-box {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.tip-box {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success);
}

.example-box {
    background: rgba(33, 150, 243, 0.1);
    border-left: 4px solid var(--primary);
}

.formula-box {
    background: rgba(156, 39, 176, 0.08);
    border-left: 4px solid #9c27b0;
    font-family: 'Courier New', monospace;
}

.formula-box strong {
    color: #6a1b9a;
    font-size: 15px;
}

.formula-box small {
    color: #757575;
    font-style: italic;
    display: block;
    margin-top: 8px;
}

.warning-box {
    background: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--error);
}

.info-text {
    background: rgba(33, 150, 243, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

/* Responsive Learning Center */
@media (max-width: 768px) {
    .glossary-grid {
        grid-template-columns: 1fr;
    }
    
    .strategy-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab {
        flex-shrink: 0;
    }
}

/* ==================== PREFERENCES/SETTINGS VIEW ==================== */
.preference-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 2px solid var(--surface-elevated);
    padding-bottom: 0;
    scrollbar-width: thin;
}

.preference-tabs::-webkit-scrollbar {
    height: 4px;
}

.preference-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.preference-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.preference-tab:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.preference-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(33, 150, 243, 0.1);
}

.preference-tab .material-icons {
    font-size: 18px;
}

.preference-content {
    position: relative;
    min-height: 500px;
}

.preference-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.preference-panel.active {
    display: block;
}

.preference-panel .trading-card {
    max-width: 800px;
}

.preference-panel .checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

.checkbox-group small {
    display: block;
    margin-left: 32px;
    color: var(--text-secondary);
    font-size: 13px;
}

.preference-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--surface-elevated);
}

.info-box {
    margin-top: 20px;
    padding: 12px;
    background: rgba(33, 150, 243, 0.1);
    border-left: 3px solid #2196f3;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Left Sidebar Enhancements */
.sidebar-widget {
    padding: 16px;
    margin-bottom: 16px;
    background: var(--surface-elevated);
    border-radius: 8px;
}

.sidebar-widget h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-performance-widget {
    text-align: center;
}

.performance-value {
    font-size: 24px;
    font-weight: 700;
    margin: 8px 0;
}

.performance-value.positive {
    color: #4caf50;
}

.performance-value.negative {
    color: #f44336;
}

.performance-value.neutral {
    color: var(--text-secondary);
}

.performance-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorites-ticker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: var(--surface);
    border-radius: 4px;
    transition: background 0.2s;
}

.ticker-item:hover {
    background: var(--surface-hover);
}

.ticker-symbol {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.ticker-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.ticker-price.up {
    color: #4caf50;
}

.ticker-price.down {
    color: #f44336;
}

.ticker-price .material-icons {
    font-size: 16px;
}

/* ========== STRATEGY TILES (New Design) ========== */
.strategy-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.strategy-selection-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.strategy-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.strategy-tile {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.strategy-tile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.strategy-tile-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.strategy-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.strategy-icon .material-icons {
    font-size: 28px;
    color: white;
}

.strategy-tile-info {
    flex: 1;
    min-width: 0;
}

.strategy-tile-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strategy-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategy-tile-meta {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.meta-item .material-icons {
    font-size: 20px;
    color: var(--text-secondary);
}

.meta-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-item small {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-strategy-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--surface);
    border: 2px dashed var(--divider);
    border-radius: 12px;
    text-align: center;
}

.empty-strategy-state .material-icons {
    font-size: 64px;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 12px;
}

.empty-strategy-state p {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.empty-strategy-state small {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Mobile responsive for strategy tiles */
@media (max-width: 768px) {
    .strategy-tiles {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .strategy-selection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .strategy-selection-header button {
        width: 100%;
    }
    
    .strategy-tile-meta {
        flex-direction: column;
        gap: 12px;
    }
}

/* ========== COMPACT UI IMPROVEMENTS ========== */
.control-section.compact {
    margin-bottom: 20px;
}

.section-header-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.section-header-inline h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.btn-sm {
    padding: 8px 16px !important;
    font-size: 13px !important;
    height: auto !important;
}

.btn-sm .material-icons {
    font-size: 18px !important;
}

.strategy-tiles-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.strategy-tiles-compact .strategy-tile {
    padding: 12px;
    border-radius: 8px;
}

.strategy-tiles-compact .strategy-icon {
    width: 40px;
    height: 40px;
}

.strategy-tiles-compact .strategy-icon .material-icons {
    font-size: 24px;
}

.strategy-tiles-compact .strategy-tile-info h4 {
    font-size: 14px;
}

.strategy-tiles-compact .strategy-type-badge {
    font-size: 10px;
    padding: 2px 6px;
}

.strategy-tiles-compact .strategy-tile-meta {
    padding-top: 10px;
    gap: 12px;
}

.strategy-tiles-compact .meta-item .material-icons {
    font-size: 18px;
}

.strategy-tiles-compact .meta-item small {
    font-size: 10px;
}

.strategy-tiles-compact .meta-item strong {
    font-size: 13px;
}

/* Compact scanner controls */
.scanner-controls {
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.control-section {
    margin-bottom: 24px;
}

.control-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Reduce view header padding */
.view-header {
    margin-bottom: 20px;
}

.view-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.view-header .subtitle {
    font-size: 14px;
}

/* Compact empty state */
.empty-strategy-state {
    padding: 32px 20px;
}

.empty-strategy-state .material-icons {
    font-size: 48px;
    margin-bottom: 8px;
}

.empty-strategy-state p {
    font-size: 14px;
}

.empty-strategy-state small {
    font-size: 12px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .section-header-inline {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .section-header-inline .btn-sm {
        flex: 0 0 auto;
    }
    
    .strategy-tiles-compact {
        grid-template-columns: 1fr;
    }
    
    .scanner-controls {
        padding: 12px;
    }
}

/* ========== STRATEGY SELECTOR MODAL ========== */
.modal-lg {
    max-width: 1200px !important;
    width: 95vw;
}

.strategy-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    height: 42px;
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.strategy-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.strategy-tile-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.strategy-tile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.strategy-tile-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.strategy-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.strategy-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.strategy-card-icon .material-icons {
    color: white;
    font-size: 28px;
}

.strategy-card-badge {
    padding: 4px 10px;
    background: var(--background);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.strategy-card-checkbox {
    margin-left: auto;
}

.strategy-card-checkbox .material-icons {
    font-size: 24px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.strategy-tile-card.selected .strategy-card-checkbox .material-icons {
    color: var(--primary);
}

/* Strategy Help Button */
.strategy-help-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    color: var(--text-secondary);
    margin-left: auto;
    margin-right: 8px;
}

.strategy-help-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.strategy-help-btn .material-icons {
    font-size: 20px;
}

/* Strategy Help Tooltip */
.strategy-help-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 13px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

.strategy-help-tooltip.hidden {
    display: none;
}

.strategy-help-tooltip .help-section {
    margin-bottom: 16px;
}

.strategy-help-tooltip .help-section:last-child {
    margin-bottom: 0;
}

.strategy-help-tooltip strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 14px;
}

.strategy-help-tooltip ul {
    margin: 8px 0;
    padding-left: 20px;
}

.strategy-help-tooltip li {
    margin-bottom: 6px;
    color: var(--text-primary);
}

.strategy-help-tooltip p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

[data-theme="dark"] .strategy-help-tooltip {
    background: rgba(30, 30, 30, 0.98);
    border-color: var(--primary);
}

.strategy-card-body h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.strategy-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.strategy-card-footer {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.strategy-meta-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.strategy-meta-chip .material-icons {
    font-size: 16px;
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.no-results .material-icons {
    font-size: 64px;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 16px;
}

.no-results p {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.no-results small {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.selected-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 16px;
    background: var(--background);
    border-radius: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 100vw;
        width: 100vw;
        margin: 0;
    }
    
    .strategy-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .strategy-tiles-grid {
        grid-template-columns: 1fr;
        max-height: 400px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .selected-count {
        width: 100%;
        text-align: center;
    }
    
    .modal-actions {
        width: 100%;
    }
    
    .modal-actions button {
        flex: 1;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .strategy-tile-card {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .strategy-tile-card.selected {
    background: rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .filter-select {
    background: rgba(255, 255, 255, 0.05);
}

/* Button consistency overrides for modal */
#clearFilters {
    height: 42px;
}

.modal-actions .btn-text,
.modal-actions .btn-primary {
    min-width: 120px;
    justify-content: center;
}

/* ========== PROFESSIONAL HEADER BRANDING ========== */
.brand-info {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1;
}

/* ========== HEADER PERFORMANCE WIDGET ========== */
.header-performance-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-right: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.perf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}

.perf-icon .material-icons {
    color: white;
    font-size: 20px;
}

.perf-content {
    display: flex;
    flex-direction: column;
}

.perf-value {
    font-size: 16px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.perf-value.positive {
    color: #10b981;
}

.perf-value.negative {
    color: #ef4444;
}

.perf-value.neutral {
    color: rgba(255, 255, 255, 0.9);
}

.perf-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header-performance-widget {
        padding: 6px 12px;
        margin-right: 8px;
    }
    
    .perf-icon {
        width: 32px;
        height: 32px;
    }
    
    .perf-icon .material-icons {
        font-size: 18px;
    }
    
    .perf-value {
        font-size: 14px;
    }
    
    .perf-label {
        font-size: 9px;
    }
    
    .brand-name {
        font-size: 18px;
    }
    
    .brand-tagline {
        font-size: 10px;
    }
}

/* Hide performance widget when not logged in */
.header-performance-widget.hidden {
    display: none;
}

/* ========== SCANNER UI FIXES ========== */

/* Reduce header padding to save space */
.app-bar {
    padding: 12px 24px;
}

/* Scanner toolbar */
.scanner-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.strategy-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-height: 42px;
    align-items: center;
}

/* Action buttons - uniform icon buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.icon-btn-large {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn-large:hover {
    background: var(--background);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-btn-large.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.icon-btn-large.primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.icon-btn-large .material-icons {
    font-size: 24px;
}

/* Table header alignment fix */
.data-table th .th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th .sort-icon {
    font-size: 18px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.data-table th.sortable:hover .sort-icon {
    opacity: 1;
}

.data-table th.sorted-asc .sort-icon {
    opacity: 1;
    transform: rotate(180deg);
}

.data-table th.sorted-desc .sort-icon {
    opacity: 1;
}

/* Compact scanner controls */
.scanner-controls {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Results section optimization */
.results-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.results-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.results-updated {
    font-size: 12px;
    color: var(--text-secondary);
}

#resultsCount {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .app-bar {
        padding: 8px 16px;
    }
    
    .scanner-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .strategy-chips-container {
        width: 100%;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .scanner-controls {
        padding: 16px;
    }
    
    .results-section {
        padding: 16px;
    }
}

/* ========== MODAL FILTERS CONSISTENCY ========== */

/* Filter labels - match section header style */
.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

/* Strategy filter grid */
.strategy-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 16px;
    margin-bottom: 24px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-select {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Modal footer consistency */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.selected-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Mobile responsive for modal filters */
@media (max-width: 768px) {
    .strategy-filters {
        grid-template-columns: 1fr;
    }
    
    .strategy-filters .icon-btn-large {
        justify-self: center;
    }
}

/* ========== PROFILE DROPDOWN MENU ========== */
.profile-menu-container {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: all 0.2s ease;
}

.user-avatar:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 1000;
    overflow: hidden;
    animation: profileDropdownFadeIn 0.2s ease;
}

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

.profile-dropdown-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.profile-dropdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.profile-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f8f9fa;
}

.profile-menu-item .material-icons {
    font-size: 20px;
    color: var(--text-secondary);
}

.profile-menu-item:hover .material-icons {
    color: var(--primary);
}

.profile-menu-item:active {
    background: #e9ecef;
}

/* Click outside to close */
.profile-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

/* ========== ACTIONS MENU ========== */
.actions-menu {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
    animation: fadeInScale 0.2s ease;
}

.action-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.action-menu-item:hover {
    background: #f5f5f5;
}

.action-menu-item .material-icons {
    font-size: 20px;
    color: #757575;
}

.action-menu-item:hover .material-icons {
    color: #2563eb;
}

.action-menu-item:active {
    background: #e9ecef;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== NEWS MODAL ========== */
.news-modal {
    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: 10001;
    animation: fadeIn 0.2s ease;
}

.news-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.news-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.news-modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #212121;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-modal-header .material-icons {
    color: #2563eb;
}

.news-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.news-item {
    padding: 16px;
    border-left: 3px solid #2563eb;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.news-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.news-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.news-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 8px;
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #757575;
}

.news-item-description {
    font-size: 14px;
    color: #212121;
    line-height: 1.6;
    margin-bottom: 8px;
}

.news-item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.news-item-link:hover {
    text-decoration: underline;
}

.news-loading {
    text-align: center;
    padding: 40px;
    color: #757575;
}

.news-empty {
    text-align: center;
    padding: 40px;
    color: #757575;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.btn-text-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #2563eb;
    color: #2563eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.btn-text-small:hover {
    background: #2563eb;
    color: white;
}

/* UNIVERSAL MANIBOT LOADER */
.manibot-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.manibot-loader-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.manibot-loader-content {
    background: white;
    padding: 48px 56px;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 500px;
}

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

.manibot-loader-logo {
    position: relative;
}

.mani-logo-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.mani-logo-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 15px 35px rgba(37, 99, 235, 0.5));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-8px) rotate(-3deg) scale(1.02);
    }
    50% {
        transform: translateY(-12px) rotate(3deg) scale(1.05);
    }
    75% {
        transform: translateY(-8px) rotate(-2deg) scale(1.02);
    }
}

.mani-logo-circle {
    animation: circleRotate 8s linear infinite;
    transform-origin: center;
}

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

.mani-logo-text,
.mani-logo-dollar {
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.manibot-loader-text {
    text-align: center;
}

.manibot-loader-text h3 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.manibot-loader-text p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 20px;
    font-weight: 500;
}

.manibot-loader-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.manibot-loader-dots span {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.manibot-loader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.manibot-loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.manibot-loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.manibot-loader-context {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 100%;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

.mani-context-chip {
    padding: 8px 16px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
    animation: chipFadeIn 0.3s ease;
}

@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mani-context-stock,
.mani-context-trade {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-radius: 16px;
    color: #2563eb;
    font-weight: 600;
}

.mani-context-divider {
    color: #94a3b8;
    margin: 0 4px;
}

/* ======================================
   FORM VALIDATION STYLES
   ====================================== */

.form-error {
    display: none;
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
    animation: errorSlideIn 0.2s ease;
}

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

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

.form-input-enhanced.error,
.form-select-enhanced.error {
    border-color: #dc2626 !important;
    background-color: #fef2f2;
}

.form-input-enhanced.error:focus,
.form-select-enhanced.error:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* ======================================
   REDDIT-STYLE COMMUNITY LAYOUT
   ====================================== */

/* Community View Background */
#community {
    background: #DAE0E6;
    min-height: 100vh;
    padding: 0 !important;
}

.reddit-layout {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Sidebar */
.reddit-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.reddit-sidebar-card {
    background: #FFFFFF;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 16px;
    box-shadow: none;
    margin-bottom: 16px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #EDEFF1;
}

.sidebar-header h3 {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #878A8C;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Channels Sidebar List */
.channels-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1c;
}

.channel-sidebar-item:hover {
    background: #F6F7F8;
}

.channel-sidebar-item.active {
    background: #0079D3;
    color: #FFFFFF;
    font-weight: 700;
}

.channel-sidebar-item .material-icons {
    font-size: 20px;
}

/* Wall of Fame Compact */
.wall-of-fame-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wall-of-fame-item-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.wall-of-fame-item-compact:hover {
    background: var(--theme-surface-secondary);
}

.wall-of-fame-rank {
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-text-tertiary);
    min-width: 24px;
}

.wall-of-fame-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.wall-of-fame-info {
    flex: 1;
}

.wall-of-fame-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 2px;
}

.wall-of-fame-score {
    font-size: 11px;
    color: var(--theme-text-secondary);
}

/* Donor Leaderboard Compact */
.donor-leaderboard-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.donor-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.donor-leaderboard-item:hover {
    background: var(--theme-surface-secondary);
}

.donor-rank {
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-text-tertiary);
    min-width: 24px;
}

.donor-info {
    flex: 1;
}

.donor-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 2px;
}

.donor-stats {
    font-size: 11px;
    color: var(--theme-text-secondary);
}

/* Main Feed */
.reddit-main-feed {
    flex: 1;
    min-width: 0;
}

.feed-header {
    background: #FFFFFF;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: none;
}

.feed-sort-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feed-sort-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #878A8C;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.feed-sort-tab .material-icons {
    font-size: 18px;
}

.feed-sort-tab:hover {
    background: #F6F7F8;
    color: #1c1c1c;
}

.feed-sort-tab.active {
    background: #0079D3;
    color: #FFFFFF;
}

/* Reddit Posts Container */
.reddit-posts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Reddit Post Card */
.reddit-post-card {
    display: flex;
    background: #FFFFFF;
    border-radius: 4px;
    border: 1px solid #ccc;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: none;
}

.reddit-post-card:hover {
    border-color: #898989;
}

/* Vote Section (Left) */
.reddit-vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #F8F9FA;
    min-width: 48px;
    border-right: 1px solid #EDEFF1;
}

.reddit-vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: var(--theme-text-secondary);
}

.reddit-vote-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--theme-primary);
}

.reddit-vote-btn.upvoted {
    color: #ff4500;
}

.reddit-vote-btn.downvoted {
    color: #7193ff;
}

.reddit-vote-btn .material-icons {
    font-size: 22px;
}

.reddit-vote-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-text-primary);
    margin: 4px 0;
}

/* Post Content (Right) */
.reddit-post-content {
    flex: 1;
    padding: 12px 16px;
    cursor: pointer;
}

.reddit-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--theme-text-secondary);
}

.reddit-post-channel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--theme-text-primary);
    padding: 2px 8px;
    background: var(--theme-surface-secondary);
    border-radius: 12px;
}

.reddit-post-author {
    font-weight: 500;
}

.reddit-post-time {
    color: var(--theme-text-tertiary);
}

.reddit-post-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.reddit-post-preview {
    font-size: 14px;
    color: var(--theme-text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.reddit-post-tickers {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.reddit-ticker-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #0079D3;
    color: #FFFFFF;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.reddit-post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.reddit-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    transition: all 0.2s ease;
}

.reddit-action-btn:hover {
    background: var(--theme-surface-secondary);
    color: var(--theme-text-primary);
}

.reddit-action-btn .material-icons {
    font-size: 18px;
}

/* Empty State */
.reddit-empty-state {
    background: #FFFFFF;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 80px 40px;
    text-align: center;
    box-shadow: none;
}

.reddit-empty-state .empty-content .material-icons {
    font-size: 80px;
    color: #878A8C;
    opacity: 0.5;
    margin-bottom: 16px;
}

.reddit-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1c1c1c;
    margin-bottom: 8px;
}

.reddit-empty-state p {
    color: #7c7c7c;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .reddit-layout {
        flex-direction: column;
        padding: 16px;
    }
    
    .reddit-sidebar {
        width: 100%;
        order: 2;
        margin-top: 24px;
    }
    
    .reddit-main-feed {
        order: 1;
    }
    
    .reddit-vote-section {
        padding: 8px 6px;
        min-width: 40px;
    }
    
    .reddit-post-title {
        font-size: 16px;
    }
}

/* ========== AI MODEL PREFERENCES ENHANCEMENTS ========== */

/* Spin animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Radio button selection highlight */
.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary, #2563eb) !important;
    background: rgba(37, 99, 235, 0.08) !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
}

.radio-label {
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: rgba(37, 99, 235, 0.4) !important;
    background: rgba(37, 99, 235, 0.03) !important;
}

/* ========== COMING SOON WATERMARK ========== */
.coming-soon-watermark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.watermark-content {
    text-align: center;
    pointer-events: none;
}

.watermark-content .material-icons {
    font-size: 64px;
    color: rgba(37, 99, 235, 0.5);
    margin-bottom: 12px;
    animation: pulse 2s ease-in-out infinite;
}

.watermark-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: rgba(37, 99, 235, 0.6);
    letter-spacing: 2px;
    margin: 0 0 8px 0;
    text-transform: uppercase;
}

.watermark-content p {
    font-size: 15px;
    color: rgba(100, 116, 139, 0.8);
    margin: 0;
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Dark mode watermark adjustments */
[data-theme="dark"] .coming-soon-watermark {
    background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .watermark-content .material-icons {
    color: rgba(96, 165, 250, 0.6);
}

[data-theme="dark"] .watermark-content h2 {
    color: rgba(96, 165, 250, 0.7);
}

[data-theme="dark"] .watermark-content p {
    color: rgba(203, 213, 225, 0.8);
}
