/* Analysis History Tab Styles */
#portfolioTab .history-header {
    margin-bottom: 24px;
}

#portfolioTab .history-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* Filters */
#portfolioTab .history-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

#portfolioTab .history-filters select,
#portfolioTab .history-filters input {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
}

#portfolioTab .history-filters select {
    cursor: pointer;
}

#portfolioTab .history-filters input:focus,
#portfolioTab .history-filters select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#portfolioTab .history-filters .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-weight: 500;
}

#portfolioTab .history-filters .btn-secondary:hover {
    background: #f9fafb;
}

/* Analysis Cards */
#portfolioTab .history-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

#portfolioTab .analysis-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

#portfolioTab .analysis-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

#portfolioTab .card-header {
    padding: 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#portfolioTab .card-header h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

#portfolioTab .analysis-date {
    display: block;
    font-size: 13px;
    color: #6b7280;
    font-weight: normal;
}

#portfolioTab .analysis-type {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    border-radius: 4px;
    text-transform: capitalize;
}

#portfolioTab .recommendation {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

#portfolioTab .recommendation.buy {
    background: #d1fae5;
    color: #065f46;
}

#portfolioTab .recommendation.sell {
    background: #fee2e2;
    color: #991b1b;
}

#portfolioTab .recommendation.hold {
    background: #fef3c7;
    color: #92400e;
}

#portfolioTab .risk-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

#portfolioTab .risk-badge.low {
    background: #d1fae5;
    color: #065f46;
}

#portfolioTab .risk-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

#portfolioTab .risk-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

#portfolioTab .card-body {
    padding: 16px;
}

#portfolioTab .card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

#portfolioTab .key-findings {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

#portfolioTab .key-findings div {
    margin-bottom: 4px;
}

#portfolioTab .card-actions {
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

#portfolioTab .card-actions button {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

#portfolioTab .card-actions button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#portfolioTab .card-actions .btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

#portfolioTab .card-actions .btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Empty State */
#portfolioTab .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* Loading */
#portfolioTab .loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* Error Message */
#portfolioTab .error-message {
    grid-column: 1 / -1;
    padding: 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .history-sub-tabs {
        width: 100%;
    }

    .sub-tab {
        flex: 1;
        justify-content: center;
    }

    .history-filters {
        flex-direction: column;
    }

    .history-filters select,
    .history-filters input {
        width: 100%;
    }

    .history-content {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-direction: column;
    }
}
