/**
 * AI Analysis Page Styles
 * @author instock
 * @date 2026/02/01
 */

/* Loading Overlay */
.ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ai-loading-overlay.show {
    display: flex;
}

.ai-loading-content {
    background: #fff;
    padding: 30px 50px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ai-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

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

/* Stock Summary Bar */
.ai-stock-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ai-stock-summary .stock-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.ai-stock-summary .stock-code {
    font-size: 14px;
    opacity: 0.8;
}

.ai-stock-summary .stock-price {
    font-size: 32px;
    font-weight: bold;
}

.ai-stock-summary .stock-change {
    font-size: 18px;
    margin-left: 10px;
}

.ai-stock-summary .stock-change.up {
    color: #4ade80;
}

.ai-stock-summary .stock-change.down {
    color: #f87171;
}

/* Suggestion Labels */
.ai-suggestion {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.ai-suggestion.buy {
    background: #10b981;
    color: #fff;
}

.ai-suggestion.sell {
    background: #ef4444;
    color: #fff;
}

.ai-suggestion.hold {
    background: #f59e0b;
    color: #fff;
}

/* Analysis Cards */
.ai-card {
    min-height: 200px;
    margin-bottom: 20px;
}

.ai-card .widget-header {
    border-bottom: 2px solid #e5e7eb;
}

.ai-card .widget-body {
    padding: 15px;
}

.ai-card-technical .widget-header {
    border-bottom-color: #3b82f6;
}

.ai-card-fund .widget-header {
    border-bottom-color: #10b981;
}

.ai-card-news .widget-header {
    border-bottom-color: #f59e0b;
}

.ai-card-suggestion .widget-header {
    border-bottom-color: #8b5cf6;
}

.ai-card-risk .widget-header {
    border-bottom-color: #ef4444;
}

/* Markdown Content Styles */
.ai-markdown-content {
    font-size: 14px;
    line-height: 1.8;
}

.ai-markdown-content h1,
.ai-markdown-content h2,
.ai-markdown-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-weight: 600;
}

.ai-markdown-content h1 { font-size: 20px; }
.ai-markdown-content h2 { font-size: 18px; }
.ai-markdown-content h3 { font-size: 16px; }

.ai-markdown-content p {
    margin-bottom: 10px;
}

.ai-markdown-content ul,
.ai-markdown-content ol {
    padding-left: 25px;
    margin-bottom: 10px;
}

.ai-markdown-content li {
    margin-bottom: 5px;
}

.ai-markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.ai-markdown-content th,
.ai-markdown-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.ai-markdown-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.ai-markdown-content tr:nth-child(even) {
    background: #f8f9fa;
}

.ai-markdown-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.ai-markdown-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
}

.ai-markdown-content pre code {
    background: none;
    padding: 0;
}

.ai-markdown-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 15px;
    margin: 10px 0;
    color: #6b7280;
}

/* History Table */
.ai-history-table {
    font-size: 13px;
}

.ai-history-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.ai-history-table .price-up {
    color: #10b981;
}

.ai-history-table .price-down {
    color: #ef4444;
}

/* Search Box */
.ai-search-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.ai-search-box .form-control {
    height: 42px;
    font-size: 16px;
}

.ai-search-box .btn {
    height: 42px;
    padding: 0 25px;
    font-size: 15px;
}

.ai-search-box .checkbox {
    margin-top: 10px;
}

/* Date Picker */
.ai-date-picker {
    margin-bottom: 20px;
}

.ai-date-picker .btn-group {
    margin-left: 10px;
}

/* Batch Report Item */
.ai-batch-item {
    margin-bottom: 25px;
}

.ai-batch-item .widget-header {
    cursor: pointer;
}

.ai-batch-item .widget-header:hover {
    background: #f8f9fa;
}

.ai-batch-item .stock-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-batch-item .stock-info .name {
    font-weight: bold;
    font-size: 16px;
}

.ai-batch-item .stock-info .code {
    color: #6b7280;
}

.ai-batch-item .stock-info .price {
    font-weight: bold;
}

/* Trend Indicators */
.ai-trend {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.ai-trend.bullish {
    background: #dcfce7;
    color: #166534;
}

.ai-trend.bearish {
    background: #fee2e2;
    color: #991b1b;
}

.ai-trend.neutral {
    background: #fef3c7;
    color: #92400e;
}

/* Empty State */
.ai-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.ai-empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
}

.ai-empty-state p {
    font-size: 16px;
}

/* Error State */
.ai-error-state {
    text-align: center;
    padding: 40px 20px;
    background: #fef2f2;
    border-radius: 8px;
    color: #991b1b;
}

.ai-error-state i {
    font-size: 36px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-stock-summary .stock-name {
        font-size: 20px;
    }

    .ai-stock-summary .stock-price {
        font-size: 24px;
    }

    .ai-search-box .form-control,
    .ai-search-box .btn {
        height: 38px;
    }
}
