/* tab_styles.css - Tab Navigation Styles */

/* Tab Navigation Bar */
.app-tabs {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 0 20px 0;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-bottom: 0px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Tab Buttons */
.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 1);
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.tab-btn:focus {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

.tab-btn.active {
    background: white;
    color: #333;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-size: 14px;
    color: inherit;
}

.tab-btn:not(.active) .tab-label {
    color: white;
}

/* Tab Badge (for counts) */
.tab-badge {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
}

/* Tools Dropdown */
.tab-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.2s;
}

.tab-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.tab-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background: #f8f9fa;
    padding-left: 20px;
}

.item-icon {
    font-size: 16px;
}

.item-badge {
    margin-left: auto;
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

/* Tab Content Container */
.tab-content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Fix for flex children */
}

/* Tab Panes - Defined in style.css (removed duplicates to avoid conflicts) */

/* Trade Assistant Tab - Full 3-column layout */
#assistantTab {
    flex-direction: row !important;
    overflow: hidden;
}

#assistantTab .messages-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Portfolio v2.0 Tab - 4-tab sub-navigation layout */
/* Only applies when .portfolio-v2 class is present */
#portfolioTab.portfolio-v2 {
    flex-direction: row !important;
    overflow: hidden;
}

/* Tools Tabs - Column layout */
#watchlistTab,
#planningTab,
#scannersTab,
#learningTab {
    flex-direction: column !important;
    overflow-y: auto;
}
.home-container {
    display: flex;
    height: calc(100vh - 60px);
    gap: 0;
    overflow: hidden;
    margin-top: 0;
}

/* Home Left Sidebar */
.home-sidebar {
    width: 220px;
    background: white;
    padding: 15px;
    padding-top: 5px;
    overflow-y: auto;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-section {
    margin-bottom: 15px;
}

.sidebar-heading {
    color: #000;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

/* Sidebar Actions */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #000;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-action-btn:hover {
    background: #f5f5f5;
    transform: translateX(2px);
}

.sidebar-action-btn .action-icon {
    font-size: 16px;
}

.sidebar-action-btn .action-label {
    flex: 1;
    text-align: left;
}

/* Sidebar Queries */
.sidebar-queries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-query-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #000;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sidebar-query-btn:hover {
    background: #f5f5f5;
    transform: translateX(2px);
}

.sidebar-query-btn .query-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-query-btn .query-label {
    flex: 1;
}

/* Home Main Content */
.home-main-content {
    flex: 1;
    padding: 15px 20px;
    padding-top: 5px;
    overflow-y: auto;
    background: #f8f9fa;
}

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

.scanners-header h2 {
    font-size: 24px;
    color: #333;
}

.custom-scan-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-scan-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

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

.scanner-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.scanner-card:hover {
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.scanner-card .scanner-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.scanner-card .scanner-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.scanner-card .scanner-desc {
    font-size: 12px;
    color: #6c757d;
}

.scanner-results {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Welcome Card - Horizontal Layout */
.welcome-card {
    background: white;
    border-radius: 6px;
    padding: 3px 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.welcome-card h2 {
    font-size: 11px;
    margin-bottom: 2px;
    color: #333;
}

.welcome-card p {
    font-size: 9px;
    color: white;
    margin-bottom: 2px;
}

.welcome-steps {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.step-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 3px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.step-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.step-number {
    font-size: 12px;
}

.step-title {
    font-size: 8px;
    font-weight: 600;
    color: #333;
}

/* Old home grid styles removed - using new sidebar layout */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.quick-action-card:hover {
    background: #e9ecef;
    border-color: #28a745;
    transform: translateX(4px);
}

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

.action-title {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

/* Popular Queries - Compact */
.popular-queries {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.popular-queries h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.queries-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.query-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.query-card:hover {
    background: #e9ecef;
    border-color: #28a745;
    transform: translateX(4px);
}

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

.query-text {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

/* Coming Soon Placeholder */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 60px 20px;
}

.coming-soon h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.coming-soon p {
    font-size: 18px;
    color: #6c757d;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .home-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .welcome-steps {
        flex-direction: column;
    }

    .queries-grid {
        grid-template-columns: 1fr;
    }

    .app-tabs {
        overflow-x: auto;
        gap: 3px;
        padding: 8px 10px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .tab-label {
        display: none;
    }

    .tab-icon {
        font-size: 20px;
    }

    .home-hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }
}

/* Adjust main layout for tabs */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.header {
    flex-shrink: 0;
}

.app-tabs {
    flex-shrink: 0;
}

.main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Assistant tab should fill the space */
#assistantTab .messages-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* Home Tab Styles */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.home-hero {
    text-align: center;
    margin-bottom: 40px;
}

.home-hero h1 {
    font-size: 48px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: #6c757d;
}

/* Welcome Card (New Users) */
.welcome-card {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.welcome-card h2 {
    margin-bottom: 10px;
    font-size: 32px;
}

.welcome-card > p {
    font-size: 18px;
    margin-bottom: 30px;
}

.welcome-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.step-card {
    background: white;
    color: #333;
    padding: 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.step-number {
    font-size: 48px;
    margin-bottom: 15px;
}

.step-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.step-desc {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.step-cta {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

/* Dashboard Card (Returning Users) */
.dashboard-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-card h2 {
    margin-bottom: 30px;
    font-size: 28px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-subvalue {
    font-size: 14px;
    margin-top: 5px;
    color: #6c757d;
}

.stat-value.positive { color: #28a745; }
.stat-value.negative { color: #dc3545; }

.dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.dashboard-btn {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.dashboard-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Market Highlights */
.market-highlights {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.market-highlights h2 {
    margin-bottom: 30px;
    font-size: 28px;
}

.market-movers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.movers-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #6c757d;
}

.movers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mover-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

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

.mover-symbol {
    font-weight: bold;
    font-size: 16px;
}

.mover-change {
    font-weight: bold;
    font-size: 16px;
}

.mover-change.positive { color: #28a745; }
.mover-change.negative { color: #dc3545; }

.view-all-btn {
    width: 100%;
    padding: 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.view-all-btn:hover {
    background: #ee5a52;
    transform: translateY(-2px);
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quick-actions h2 {
    margin-bottom: 30px;
    font-size: 28px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quick-action-card {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.action-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.action-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.action-desc {
    font-size: 14px;
    opacity: 0.9;
}

/* Popular Queries */
.popular-queries {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.popular-queries h2 {
    margin-bottom: 30px;
    font-size: 28px;
}

.queries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.query-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.query-card:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateX(5px);
}

.query-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.query-text {
    font-size: 14px;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .home-hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .welcome-steps,
    .dashboard-stats,
    .actions-grid,
    .queries-grid {
        grid-template-columns: 1fr;
    }

    .market-movers {
        grid-template-columns: 1fr;
    }
}

/* Portfolio v2.0 Tab Styles - Only applies when .portfolio-v2 class is present */
#portfolioTab.portfolio-v2 .portfolio-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

#portfolioTab.portfolio-v2 .portfolio-sidebar {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    border-right: 1px solid #dee2e6;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Sidebar Portfolio Header */
#portfolioTab.portfolio-v2 .sidebar-portfolio-header {
    padding: 8px 15px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
}

#portfolioTab.portfolio-v2 .sidebar-portfolio-header h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    word-wrap: break-word;
    line-height: 1.4;
}

#portfolioTab.portfolio-v2 .sidebar-portfolio-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-small {
    padding: 6px 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.sidebar-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

#portfolioTab.portfolio-v2 .new-portfolio-btn {
    width: calc(100% - 30px);
    margin: 15px;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

#portfolioTab.portfolio-v2 .new-portfolio-btn:hover {
    background: #218838;
}

#portfolioTab.portfolio-v2 .portfolios-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 15px 15px 15px;
}

#portfolioTab.portfolio-v2 .portfolio-item {
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#portfolioTab.portfolio-v2 .portfolio-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

#portfolioTab.portfolio-v2 .portfolio-item.active {
    background: #e7f3ff;
    border-color: #007bff;
}

#portfolioTab.portfolio-v2 .portfolio-item-info {
    flex: 1;
    min-width: 0;
}

#portfolioTab.portfolio-v2 .portfolio-item-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#portfolioTab.portfolio-v2 .portfolio-item-count {
    font-size: 11px;
    color: #666;
}

#portfolioTab.portfolio-v2 .portfolio-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

#portfolioTab.portfolio-v2 .portfolio-delete-btn:hover {
    opacity: 1;
}

#portfolioTab.portfolio-v2 .portfolio-name {
    font-weight: bold;
    margin-bottom: 5px;
}

#portfolioTab.portfolio-v2 .portfolio-value {
    font-size: 14px;
    color: #666;
}

#portfolioTab.portfolio-v2 .portfolio-change {
    font-size: 12px;
    font-weight: bold;
}

#portfolioTab.portfolio-v2 .portfolio-change.positive { color: #28a745; }
#portfolioTab.portfolio-v2 .portfolio-change.negative { color: #dc3545; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-hint {
    font-size: 12px;
    margin-top: 10px;
}

#portfolioTab.portfolio-v2 .portfolio-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}

#portfolioTab.portfolio-v2 .portfolio-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

#portfolioTab.portfolio-v2 .portfolio-empty h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

#portfolioTab.portfolio-v2 .portfolio-empty p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
}

.create-first-btn {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.create-first-btn:hover {
    background: #0056b3;
}

#portfolioTab.portfolio-v2 .portfolio-viewer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#portfolioTab.portfolio-v2 .portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

#portfolioTab.portfolio-v2 .portfolio-header h3 {
    font-size: 24px;
    margin: 0;
}

#portfolioTab.portfolio-v2 .portfolio-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #0056b3;
}

#portfolioTab.portfolio-v2 .portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

.summary-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.coming-soon-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.coming-soon-note p {
    margin: 5px 0;
    color: #856404;
}

@media (max-width: 768px) {
    .portfolio-container {
        flex-direction: column;
    }

    .portfolio-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .portfolio-actions {
        flex-wrap: wrap;
    }
}

/* Tools Tabs Styles */
.tools-container {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.tools-header-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.tools-action-btn {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.tools-action-btn:hover {
    background: #0056b3;
}

.tools-empty {
    text-align: center;
    padding: 80px 20px;
}

.tools-empty .empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.tools-empty h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.tools-empty p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
}

/* Scanners Grid */
.scanners-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 20px;
    margin-bottom: 20px;
    max-width: 1200px;
}

.scanner-card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
    text-align: center;
}

.scanner-card:hover {
    border-color: #007bff;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.scanner-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.scanner-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.scanner-desc {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.scanner-preview {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.preview-row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

.preview-symbol {
    font-weight: 600;
    color: #333;
}

.preview-price {
    color: #495057;
    text-align: right;
}

.preview-change {
    font-weight: 600;
    text-align: right;
}

.preview-change.positive {
    color: #28a745;
}

.preview-change.negative {
    color: #dc3545;
}


@media (max-width: 768px) {
    .tools-container {
        padding: 20px;
    }

    .tools-header-section {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .scanners-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
    }
}

/* Learning Tab - iframe */
#learningTab {
    padding: 0 !important;

/* Learning Tab - Override flex layout for iframe */
#learningTab.tab-pane {
    display: none;
}

#learningTab.tab-pane.active {
    display: block !important;
    flex: none !important;
    height: calc(100vh - 120px) !important;
    overflow: hidden !important;
}

#learningTab iframe.learning-iframe,
#learningTab .learning-iframe {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 600px !important;
    border: none !important;
    background: white;
}

/* Focus styles for accessibility */
.quick-action-btn:focus,
.popular-query-card:focus,
.scanner-card:focus,
.portfolio-card:focus,
.step-card:focus {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

/* Toast notifications */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Scanner Results */
.scanner-results {
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* All Scanners Grid View */
.all-scanners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.scanner-mini-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.scanner-mini-card h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.mini-table table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    padding: 8px 4px;
    border-bottom: 1px solid #e9ecef;
}

.mini-table td {
    font-size: 13px;
    padding: 8px 4px;
    border-bottom: 1px solid #f8f9fa;
}

.mini-table .symbol {
    font-weight: 600;
    color: #333;
}

.mini-table .change.positive {
    color: #28a745;
    font-weight: 600;
}

.mini-table .change.negative {
    color: #dc3545;
    font-weight: 600;
}


.scanner-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.scanner-results-header h3 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.close-results-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-results-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.scanner-results-table {
    overflow-x: auto;
}

.scanner-results-table table {
    width: 100%;
    border-collapse: collapse;
}

.scanner-results-table thead {
    background: #f8f9fa;
}

.scanner-results-table th {
    padding: 12px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.scanner-results-table td {
    padding: 12px;
    font-size: 16px;
    border-bottom: 1px solid #f8f9fa;
}

.stock-row {
    cursor: pointer;
    transition: background 0.2s;
}

.stock-row:hover {
    background: #f8f9fa;
}

.stock-row .symbol {
    font-weight: 600;
    color: #333;
    font-size: 18px;
}

.stock-row .price {
    color: #495057;
    font-size: 18px;
}

.stock-row .change.positive {
    color: #28a745;
    font-weight: 600;
}

.stock-row .change.negative {
    color: #dc3545;
    font-weight: 600;
}

.stock-row .volume {
    color: #6c757d;
}

.scanner-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scanner-error {
    text-align: center;
    padding: 40px;
}

.scanner-error p {
    font-size: 16px;
    color: #dc3545;
    margin-bottom: 10px;
}

.scanner-error .error-message {
    font-size: 14px;
    color: #6c757d;
}

.scanner-error button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.scanner-error button:hover {
    background: #5568d3;
}


/* Signal Badge Styles */
.signal-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.signal-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.signal-badge-buy {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.signal-badge-hold {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.signal-badge-sell {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Allocation & Risk Analysis Grid */
.allocation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.allocation-chart-container,
.volatility-chart-container {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.allocation-chart-container h4,
.volatility-chart-container h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Volatility Chart Styles */
.volatility-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.volatility-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volatility-symbol {
    font-weight: 600;
    min-width: 60px;
    font-size: 13px;
}

.volatility-bar-container {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.volatility-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.volatility-low {
    background: linear-gradient(90deg, #28a745, #5cb85c);
}

.volatility-medium {
    background: linear-gradient(90deg, #ffc107, #ffdb4d);
}

.volatility-high {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.volatility-unknown {
    background: #999;
}

.volatility-value {
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-size: 13px;
}

.volatility-average {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 14px;
    text-align: center;
}

.signal-summary {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

/* Signal Details 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: 10000;
}

/* News & Sentiment Section */
.collapsible {
    cursor: pointer;
    user-select: none;
}

.collapsible:hover {
    background: #f8f9fa;
}

.toggle-icon {
    float: right;
    font-size: 14px;
    color: #666;
}

.portfolio-sentiment-summary {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    text-align: center;
}

.news-stocks-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stock-news-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
}

.stock-news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.stock-news-header strong {
    font-size: 16px;
    color: #333;
}

.sentiment-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f0f0f0;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

.news-item:hover {
    background: #e9ecef;
}

.news-sentiment {
    font-size: 16px;
    flex-shrink: 0;
}

.news-title {
    flex: 1;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
}

.news-title:hover {
    text-decoration: underline;
}

.news-title-nolink {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.news-time {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

/* Signal Details 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: 10000;
}

.signal-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.signal-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.signal-strength {
    font-size: 14px;
    line-height: 1.6;
}

.indicator-section,
.recommendation-section {
    margin-top: 20px;
}

.indicator-section h4,
.recommendation-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.indicator-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.indicator-label {
    font-weight: 600;
    color: #666;
}

.indicator-value {
    font-weight: 600;
    color: #333;
}

.indicator-signal {
    font-size: 13px;
}

.recommendation-section p {
    line-height: 1.6;
    color: #555;
}

/* Analysis History Section */
.analysis-history-section {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding: 15px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.history-header:hover {
    background: #ebebeb;
}

.history-toggle {
    font-size: 12px;
}

.history-content {
    margin-top: 10px;
}

.history-loading, .history-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.history-best {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

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

.history-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #2196F3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
}

.history-item.best {
    border-color: #ffd700;
    background: #fffef0;
}

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

.history-date {
    color: #666;
    font-size: 11px;
}

.history-score {
    background: #2196F3;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.history-item.best .history-score {
    background: #ffd700;
    color: #333;
}

.history-item-details {
    color: #999;
    font-size: 11px;
}

.history-view-all {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #2196F3;
}

.history-view-all:hover {
    background: #ebebeb;
}


/* Analysis Detail 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: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.analysis-detail-section {
    margin-bottom: 20px;
}

.analysis-detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #2196F3;
}

.analysis-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
}

.metric-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.metric-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.holdings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.holdings-table th {
    background: #f5f5f5;
    padding: 8px;
    text-align: left;
    font-weight: 600;
}

.holdings-table td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.analysis-detail-section ul {
    margin: 0;
    padding-left: 20px;
}

.analysis-detail-section li {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.analysis-detail-section p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}


/* Portfolio title */
#current-portfolio-name {
    font-size: 20px;
    margin-bottom: 12px;
}

#portfolioTab.portfolio-v2 .portfolio-summary-grid {
    margin-top: 0;
}


/* ============================================
   INVESTOR ANALYSIS MODAL STYLES
   ============================================ */

.investor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.investor-checkbox {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.investor-checkbox:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.investor-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.investor-checkbox input[type="checkbox"]:checked + span {
    color: #3b82f6;
    font-weight: 600;
}

.investor-checkbox small {
    color: #666;
    font-size: 11px;
    margin-top: 5px;
    margin-left: 30px;
}

/* Investor Results */
.investor-results {
    margin-top: 30px;
}

.investor-result-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.investor-result-card h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
}

.investor-analysis-content {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
}

.investor-analysis-content pre {
    margin: 0;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Fix for learning tab iframe */
#learningTab {
    display: block !important;
}

/* Removed duplicate - see line 1450 for learning iframe styles */
