/* Analysis Results - Modern Trading Dashboard */
.analysis-results-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    color: #e2e8f0;
    background: #0f172a;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* Dashboard Header */
.dashboard-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #131c31 0%, #1e293b 100%);
    border-bottom: 1px solid #1e293b;
}

.dashboard-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.time-filters {
    display: flex;
    gap: 8px;
    background: rgba(30, 41, 59, 0.6);
    padding: 5px;
    border-radius: 8px;
}

.time-filter {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-filter:hover {
    color: #fff;
}

.time-filter.active {
    background: #2563eb;
    color: #fff;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    grid-gap: 20px;
    padding: 20px;
}

/* Sidebar Styles */
.dashboard-sidebar, .dashboard-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Profile Card */
.profile-card, .stats-card, .chart-card, .broker-integration, .list-card {
    background: #1e293b;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}

.profile-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.profile-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #0f172a;
    border-radius: 8px;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.excluded-industries {
    margin-top: 15px;
}

.excluded-industries h4 {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 8px 0;
}

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

.industry-tag {
    background: #334155;
    color: #94a3b8;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Account Stats Card */
.account-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.account-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #0f172a;
    border-radius: 8px;
}

.upgrade-button-container {
    text-align: center;
    margin-top: 10px;
}

.upgrade-button {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

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

/* Main Dashboard Area */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Trending Strategies */
.trending-strategies h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

.strategy-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.strategy-card {
    background: #1e293b;
    border-radius: 10px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.strategy-card.blue::before {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.strategy-card.red::before {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.strategy-card.green::before {
    background: linear-gradient(90deg, #059669, #10b981);
}

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

.strategy-company {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    background: #0f172a;
    border-radius: 6px;
}

.strategy-card.blue .strategy-company {
    color: #3b82f6;
}

.strategy-card.red .strategy-company {
    color: #ef4444;
}

.strategy-card.green .strategy-company {
    color: #10b981;
}

.strategy-trend {
    width: 20px;
    height: 20px;
    position: relative;
}

.strategy-trend.up::before {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 6px 10px 6px;
    border-color: transparent transparent #10b981 transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.strategy-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 12px 0;
}

.strategy-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.strategy-reward, .strategy-risk {
    font-size: 12px;
    color: #94a3b8;
}

.strategy-reward span {
    color: #10b981;
    font-weight: 600;
}

.strategy-risk span {
    color: #f59e0b;
    font-weight: 600;
}

.strategy-chart {
    height: 50px;
    background: #0f172a;
    border-radius: 6px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.strategy-chart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.7));
}

.strategy-card.blue .strategy-chart {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(15, 23, 42, 1) 100%);
}

.strategy-card.red .strategy-chart {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.1) 0%, rgba(15, 23, 42, 1) 100%);
}

.strategy-card.green .strategy-chart {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 1) 100%);
}

.backtest-button {
    background: transparent;
    border: 1px solid #334155;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.backtest-button:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Stock Performance */
.stock-performance {
    background: #1e293b;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

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

.refresh-button {
    background: #334155;
    border: none;
    color: #fff;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-button::before {
    content: '↻';
    font-size: 14px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #0f172a;
    border-radius: 6px;
    padding: 4px 8px;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    padding: 4px 8px;
    width: 140px;
}

.search-box input:focus {
    outline: none;
}

.search-button {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    width: 24px;
    height: 24px;
    position: relative;
}

.search-button::before {
    content: '🔍';
    font-size: 12px;
}

.stock-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
}

.stock-table thead th {
    background: #0f172a;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    padding: 10px 16px;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.stock-table thead th:first-child {
    border-radius: 6px 0 0 6px;
}

.stock-table thead th:last-child {
    border-radius: 0 6px 6px 0;
}

.stock-table tbody tr {
    transition: all 0.2s ease;
}

.stock-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.6);
}

.stock-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #334155;
    font-size: 13px;
}

.stock-symbol {
    font-weight: 600;
    color: #fff;
}

.stock-name {
    color: #94a3b8;
}

.stock-price {
    font-weight: 600;
    color: #fff;
}

.stock-high, .stock-low {
    color: #94a3b8;
}

.stock-change {
    font-weight: 600;
}

.stock-change.positive {
    color: #10b981;
}

.stock-change.negative {
    color: #ef4444;
}

.stock-trend {
    padding: 0;
}

.trend-chart {
    height: 30px;
    width: 100%;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.trend-chart.positive {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.3) 100%);
}

.trend-chart.negative {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.3) 100%);
}

.stock-actions {
    display: flex;
    gap: 8px;
}

.action-button {
    background: transparent;
    border: 1px solid #334155;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-button.buy {
    border-color: #10b981;
    color: #10b981;
}

.action-button.watch {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Backtest CTA */
.backtest-cta {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
}

.cta-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.cta-button {
    background: #fff;
    border: none;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Chart Card */
.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

.pie-chart-container {
    text-align: center;
}

.pie-chart {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    position: relative;
    background: conic-gradient(#3b82f6 0% 45%, #f59e0b 45% 70%, #10b981 70% 90%, #94a3b8 90% 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.pie-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: #1e293b;
    border-radius: 50%;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.color-dot.us {
    background: #3b82f6;
}

.color-dot.europe {
    background: #f59e0b;
}

.color-dot.asia {
    background: #10b981;
}

.color-dot.other {
    background: #94a3b8;
}

/* Broker Integration */
.broker-integration h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
}

.broker-integration p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 16px 0;
}

.broker-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.broker-button {
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 12px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
}

.broker-button:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* List Card */
.list-tabs {
    display: flex;
    border-bottom: 1px solid #334155;
    margin-bottom: 16px;
}

.list-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
}

.list-tab.active {
    color: #fff;
}

.list-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3b82f6;
}

.lists-container {
    max-height: 200px;
    overflow-y: auto;
}

.list-content {
    display: none;
}

.list-content.active {
    display: block;
}

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

.list-content li {
    padding: 8px;
    border-bottom: 1px solid #334155;
    font-size: 13px;
    color: #94a3b8;
}

.empty-message {
    text-align: center;
    padding: 20px !important;
    color: #64748b !important;
    font-style: italic;
}

/* Debug Output */
.debug-output {
    background: #1e293b;
    border-radius: 10px;
    padding: 16px;
    margin-top: 20px;
}

.debug-output h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

.debug-output pre {
    background: #0f172a;
    color: #94a3b8;
    border-radius: 6px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 220px 1fr 250px;
    }
    
    .strategy-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .strategy-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .strategy-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .profile-details, .broker-options {
        grid-template-columns: 1fr;
    }
}

/* Top Ranked Stocks Section */
.top-ranked-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

.rank-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.rank-card {
    background: #1e293b;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.rank-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.rank-card.rank-1 {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #10b981;
}

.rank-card.rank-2 {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #3b82f6;
}

.rank-card.rank-3 {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #f59e0b;
}

.rank-number {
    position: absolute;
    top: -10px;
    left: -10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.rank-card.rank-1 .rank-number {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    font-size: 16px;
    padding: 6px 12px;
}

.rank-details {
    padding-top: 15px;
}

.rank-symbol {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.rank-company {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-price {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.rank-score {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.rank-score span {
    font-weight: 600;
    color: #10b981;
    margin-left: 4px;
}

.rank-card.rank-1 .rank-score span {
    color: #f59e0b;
}

.rank-allocation {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 15px;
}

.rank-allocation span {
    font-weight: 600;
    color: #3b82f6;
    margin-left: 4px;
}

.rank-actions {
    display: flex;
    gap: 8px;
}

.rank-actions .action-button {
    flex: 1;
    padding: 6px 0;
    font-size: 13px;
    border-radius: 6px;
}

/* Highlight value on stats card */
.highlight-value {
    color: #10b981 !important;
    font-weight: 700 !important;
}

/* Stock Table Modifications */
.stock-table th:first-child,
.stock-table td:first-child {
    width: 60px;
    text-align: center;
}

.stock-rank {
    font-weight: 600;
    color: #94a3b8;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

tr.top-rank {
    background: rgba(16, 185, 129, 0.05);
}

tr.top-rank:hover {
    background: rgba(16, 185, 129, 0.1) !important;
}

tr.top-rank .stock-rank {
    background: #10b981;
    color: #fff;
}

tr.top-rank:first-child {
    background: rgba(245, 158, 11, 0.05);
}

tr.top-rank:first-child:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

tr.top-rank:first-child .stock-rank {
    background: #f59e0b;
    color: #fff;
}

.stock-score {
    font-weight: 600;
    color: #10b981;
}

.stock-quantity {
    font-weight: 600;
    color: #3b82f6;
}

.stock-allocation {
    font-weight: 600;
    color: #fff;
}

/* Pie Chart and Legend Updates */
.color-dot.cash {
    background: #475569;
}

/* Save List Actions */
.save-list-actions {
    margin-top: 15px;
}

.save-lists-button {
    width: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-lists-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.save-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
}

.save-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.save-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.save-status.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .rank-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .rank-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .rank-cards {
        grid-template-columns: 1fr;
    }
} 