/* Styles for AI Analysis Section */
.analysis-section {
    margin-top: 2rem;
    max-width: 100%;
    min-height: 100%;
    position: relative;
}

.analysis-card {
    background: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    min-height: 1000px; /* Doubled minimum height for desktop */
}

.ai-badge {
    background-color: #10a37f;
    color: white;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.analysis-content {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.5) rgba(255, 255, 255, 0.05);
    max-height: 85vh; /* Increase height */
    color: #e0e0e0;
}

.analysis-content::-webkit-scrollbar {
    width: 8px;
}

.analysis-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.analysis-content::-webkit-scrollbar-thumb {
    background-color: rgba(96, 165, 250, 0.5);
    border-radius: 10px;
}

/* Enhanced Executive Summary Styling */
.enhanced-summary {
    font-size: 1.1rem;
    line-height: 1.7;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #60a5fa;
    margin-bottom: 1rem;
}

/* Highlight price mentions in executive summary */
.enhanced-summary:has-text("$") {
    position: relative;
}

.summary-content {
    position: relative;
}

/* Style for potential price highlights */
.price-highlight {
    background: linear-gradient(120deg, #fbbf24, #f59e0b);
    color: #1f2937;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.05em;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .enhanced-summary {
        font-size: 1rem;
        padding: 1.2rem;
        line-height: 1.6;
    }
}

/* PDF Generation Styles */
.pdf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.pdf-loading-spinner {
    background: #1e293b;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

.pdf-loading-spinner p {
    margin-top: 15px;
    color: white;
    font-size: 16px;
}

.pdf-loading-spinner .neural-network {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 45deg, #60a5fa, #3b82f6, #60a5fa);
    animation: rotate 2s linear infinite;
    position: relative;
    margin: 0 auto;
}

.pdf-loading-spinner .neural-network::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 40%;
    background: #1e293b;
    border-radius: 50%;
    z-index: 1;
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-pdf-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    vertical-align: middle;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-pdf-download:hover {
    background: rgba(96, 165, 250, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pdf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.pdf-loading-spinner {
    background: #1e293b;
    padding: 25px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-loading-spinner p {
    margin-top: 15px;
    color: white;
    font-size: 16px;
}

.analysis-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(96, 165, 250, 0.8);
}

.analysis-content-inner {
    padding-bottom: 2rem; /* Add padding at the bottom for better scrolling */
}

.analysis-summary,
.analysis-trend,
.analysis-key-points,
.analysis-recommendation {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.analysis-summary:hover,
.analysis-trend:hover,
.analysis-key-points:hover,
.analysis-recommendation:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.analysis-summary h3,
.analysis-trend h3,
.analysis-key-points h3,
.analysis-recommendation h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.analysis-summary h3 i,
.analysis-trend h3 i,
.analysis-key-points h3 i,

/* Styles cho phần phân tích nâng cao */
.analysis-content-inner {
    padding: 0 0.5rem;
}

.analysis-metadata {
    margin-left: 10px;
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}

.market-direction-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.direction-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.direction-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #94a3b8;
}

.direction-value {
    color: white;
}

.inflection-points {
    margin-top: 0.5rem;
}

.points-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.points-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.points-list li i {
    color: #60a5fa;
    margin-top: 0.15rem;
}

/* Grid layout for technical analysis */
.technical-grid {
    display: grid;
    gap: 1rem;
    margin-top: 0.75rem;
}

.levels-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.price-levels {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 0;
}

.price-levels.resistance {
    border-left: 3px solid #ef4444;
}

.price-levels.support {
    border-left: 3px solid #10b981;
}

.level-title, .pattern-title, .momentum-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

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

.price-levels ul li {
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.price-levels ul li:last-child {
    border-bottom: none;
}

.pattern-momentum {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
}

.patterns, .momentum {
    margin-bottom: 1rem;
}

.patterns p, .momentum p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Grid for volatility and sentiment */
.analysis-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.volatility-card, .sentiment-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.volatility-card h4, .sentiment-card h4 {
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volatility-card i, .sentiment-card i {
    color: #60a5fa;
}

.volatility-card p, .sentiment-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.volatility-periods ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 1rem;
}

.volatility-periods ul li {
    position: relative;
    padding-left: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.volatility-periods ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #60a5fa;
}

/* Recommendations styling */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.recommendation-group {
    background: rgba(25, 41, 65, 0.7);
    border-radius: 8px;
    padding: 1rem;
    height: 100%; /* Đảm bảo chiều cao đồng đều */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease; /* Thêm hiệu ứng mượt mà khi hover */
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.recommendation-group:hover {
    background: rgba(25, 41, 65, 0.85);
    transform: translateY(-2px);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.investor-type {
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.investor-type.conservative {
    color: #10b981;
}

.investor-type.moderate {
    color: #f59e0b;
}

.investor-type.aggressive {
    color: #ef4444;
}

.recommendation-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1; /* Chiếm phần còn lại của container */
}

.recommendation-group ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    transition: background-color 0.2s ease; /* Thêm hiệu ứng mượt mà */
    padding: 0.5rem 0.5rem 0.5rem 1.75rem;
    border-radius: 4px;
}

.recommendation-group ul li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.recommendation-group ul li:before {
    content: "→";
    position: absolute;
    left: 0.5rem;
    color: #60a5fa;
}

/* Đã loại bỏ thông báo tham khảo vào sau section khuyến nghị */

.entry-points, .position-management {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.entry-points h4, .position-management h4 {
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

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

.entry-points ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.entry-points ul li:before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: #60a5fa;
}

/* Confidence assessment styling */
.confidence-assessment {
    margin-top: 1.5rem;
    margin-bottom: 2rem; /* Thêm margin dưới để đảm bảo nội dung hiển thị đầy đủ */
}

.confidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.confidence-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.confidence-label {
    font-size: 0.85rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.5rem;
}

.confidence-value {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.limitations {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem; /* Thêm margin dưới để tránh bị cắt nội dung */
    border-left: 3px solid #f59e0b; /* Thêm viền để nhấn mạnh phần giới hạn */
}

.limitations h4 {
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f59e0b;
}

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

.limitations ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

.limitations ul li:before {
    content: "!";
    position: absolute;
    left: 0.5rem;
    color: #f59e0b;
    font-weight: bold;
}

/* CSS cho thông báo đã bị xóa */

/* Responsive adjustments */
@media (max-width: 768px) {
    .analysis-insight-grid,
    .recommendations-grid,
    .confidence-grid {
        grid-template-columns: 1fr;
    }

    .levels-container {
        flex-direction: column;
    }
}

.analysis-recommendation h3 i {
    color: #60a5fa;
}

.summary-content,
.analysis-trend p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.95rem;
}

.summary-disclaimer {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.summary-disclaimer i {
    color: #ffd700;
}

.analysis-key-points ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-key-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.analysis-key-points li i {
    color: #60a5fa;
    margin-top: 0.25rem;
}

.analysis-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .analysis-section {
        width: 100%;
        margin: 1rem 0;
        max-width: 100vw;
        overflow: hidden;
    }

    .analysis-card {
        width: 100%;
        border-radius: 16px;
        margin: 0 auto;
        min-height: 450px; /* Tăng chiều cao trên mobile để hiển thị tốt hơn */
        max-height: none; /* Remove max height constraint on mobile */
        display: flex;
        flex-direction: column;
    }

    .card-header {
        position: sticky;
        top: 0;
        z-index: 10;
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 16px; /* Thêm padding để dễ nhấp hơn */
    }

    .analysis-content {
        padding: 1rem;
        gap: 1rem;
        overflow-y: auto;
        overflow-x: hidden; /* Prevent horizontal scrolling */
        -webkit-overflow-scrolling: touch;
        max-height: 75vh; /* Tăng chiều cao viewport để hiển thị nhiều nội dung hơn */
        min-height: 400px; /* Tăng chiều cao tối thiểu */
        scrollbar-width: thin;
        scrollbar-color: rgba(96, 165, 250, 0.5) rgba(255, 255, 255, 0.05);
        overscroll-behavior: contain; /* Prevent scroll chaining */
        padding-bottom: 3rem; /* Tăng padding dưới để dễ cuộn */
        word-wrap: break-word; /* Force word wrapping */
        overflow-wrap: break-word; /* Modern standard for word wrapping */
        hyphens: auto; /* Enable hyphenation for better text flow */
    }

    /* Cải thiện hiệu ứng cuộn */
    .analysis-content::-webkit-scrollbar {
        width: 8px; /* Tăng độ rộng thanh cuộn để dễ thao tác */
    }

    /* Cải thiện khoảng cách giữa các phần */
    .analysis-summary,
    .analysis-trend,
    .analysis-key-points,
    .analysis-recommendation {
        margin-bottom: 1.5rem; /* Tăng khoảng cách */
        padding: 1.2rem; /* Tăng padding */
    }

    /* Tăng cỡ chữ cho dễ đọc trên điện thoại */
    .summary-content,
    .analysis-trend p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .analysis-content::-webkit-scrollbar {
        width: 6px;
    }

    .analysis-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }

    .analysis-content::-webkit-scrollbar-thumb {
        background-color: rgba(96, 165, 250, 0.5);
        border-radius: 10px;
    }

    /* Add visual indicator for scrollable content */
    .analysis-content::after {
        content: '';
        display: block;
        height: 30px; /* Extra space at bottom */
    }

    /* Improve touch interaction */
    .analysis-summary,
    .analysis-trend,
    .analysis-key-points,
    .analysis-recommendation {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
        white-space: normal;
        margin-bottom: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        box-sizing: border-box;
    }

    .summary-content {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 0.5rem; /* Extra space to improve readability */
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
        white-space: normal;
    }

    /* Ensure last item has enough space for comfortable scrolling */
    .analysis-content > *:last-child {
        margin-bottom: 40px;
    }

    .analysis-actions {
        flex-direction: column;
        position: sticky;
        bottom: 0;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(10px);
        margin: 0;
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    .analysis-actions button {
        width: 100%;
    }
    .analysis-key-points ul {
        padding-left: 0;
        list-style-position: inside;
    }
    .summary-disclaimer {
        font-size: 0.85rem;
        padding: 0.75rem;
        margin-top: 0.5rem;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
    }
    .analysis-recommendation {
        margin: 0.5rem auto;
        padding: 1rem;
        border-radius: 10px;
        background: rgba(16, 163, 127, 0.1);
        border-left: 3px solid #10a37f;
    }
    .analysis-recommendation h3 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    .analysis-recommendation i {
        margin-right: 0.4rem;
    }
    .analysis-recommendation p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    .analysis-key-points li {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
    }
    .summary-content,
    .analysis-trend p,
    .analysis-key-points li,
    .analysis-recommendation p {
        font-size: 0.95rem;
        line-height: 1.6;
        overflow-wrap: break-word;
        word-wrap: break-word;
        white-space: normal;
        max-width: 100%;
    }
    .analysis-summary,
    .analysis-trend,
    .analysis-key-points,
    .analysis-recommendation {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
        white-space: normal;
        margin-bottom: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        box-sizing: border-box;
    }

    /* Thêm hiệu ứng khi scroll */
    .analysis-section::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 30px;
        background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
        pointer-events: none;
        opacity: 0.8;
        z-index: 1;
    }
}

/* Chỉnh sửa để loại bỏ hiệu ứng nhấp nháy trên phần khuyến nghị chiến lược */
.analysis-recommendation h3,
.analysis-recommendation h4,
.analysis-recommendation ul li {
    animation: none !important;
    transition: all 0.3s ease;
}

/* CSS cho khung disclaimer đã bị xóa */
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(96, 165, 250, 0.2);
    padding: 10px;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-body {
    max-height: 250px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.table-row:hover {
    background: rgba(96, 165, 250, 0.1);
}

.date-column {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    opacity: 0.9;
}

.value-column {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #60a5fa;
    text-align: right;
}

@media (max-width: 768px) {
    .table-body {
        max-height: 200px;
    }

    .date-column, .value-column {
        font-size: 0.85rem;
    }
}

.analysis-content h3 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    color: #ffffff; /* Change text color to lighter */
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.api-missing-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.api-missing-warning i {
    color: #856404;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.api-missing-warning p {
    margin: 0 1rem 0 0;
    flex: 1;
}

.api-missing-warning .btn {
    white-space: nowrap;
}

.analysis-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
}

.analysis-error i {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.analysis-error .error-details {
    margin-top: 0.5rem;
    background-color: #f8eaec;
    border-radius: 4px;
    padding: 0.5rem;
}

.analysis-error .error-details pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.8rem;
    color: #721c24;
}

.analysis-error .error-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}


.analysis-summary {
    margin-bottom: 1.5rem;
}

.analysis-key-points ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.analysis-key-points li {
    margin-bottom: 0.5rem;
}

.analysis-recommendation {
    background-color: #e8f4fc;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.analysis-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.loading-analysis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-analysis p {
    margin-top: 1rem;
}


.summary-content {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: justify;
    color: rgba(255, 255, 255, 1);
}

.summary-disclaimer {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-style: italic;
    border-left: 3px solid rgba(96, 165, 250, 0.5);
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Thêm hiệu ứng khi cuộn */
.analysis-key-points li {
    transition: all 0.3s ease;
}

.analysis-key-points li:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.summary-disclaimer i {
    color: #60a5fa;
}

.summary-disclaimer small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .analysis-actions {
        flex-direction: column;
    }

    .analysis-actions button {
        width: 100%;
    }
    .summary-disclaimer {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Report Modal */
.report-modal {
    max-width: 800px;
}

.report-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.report-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

@media print {
    .report-content {
        border: none;
    }

    body * {
        visibility: hidden;
    }

    .report-content,
    .report-content * {
        visibility: visible;
    }

    .report-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

.analysis-summary .summary-disclaimer {
    color: var(--color-light-gray);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
}

.info-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.info-text i {
    color: var(--color-accent);
}

/* API Key Configuration Styles */
.api-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 0.5rem;
    border-left: 3px solid #f44336;
}

.api-warning i {
    color: #f44336;
}

.api-warning p {
    margin: 0;
    color: #ffffff;
    font-size: 0.875rem;
    flex-grow: 1;
}

.api-config-btn {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-config-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Badge cho GPT-4o */
.gpt4o-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1e293b;
    margin: 15% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
}

.close-modal {
    color: #94a3b8;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
}

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

.modal-body {
    padding: 1.5rem;
    color: #e2e8f0;
}

.modal-body p {
    margin-top: 0;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.modal-footer {
    padding-top: 1.25rem;
    text-align: right;
}

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

@keyframes highlightBg {
    0% { background-color: rgba(255, 255, 255, 0.0); }
    50% { background-color: rgba(255, 255, 255, 0.0); }
    100% { background-color: rgba(255, 255, 255, 0.0); }
}

/* On-Chain Metrics Analysis Styles */
.analysis-onchain {
    background-color: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.analysis-onchain h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f7931a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.onchain-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .onchain-analysis-grid {
        grid-template-columns: 1fr;
    }
}

.onchain-card {
    background: rgba(18, 24, 38, 0.8);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.onchain-card:hover {
    background: rgba(20, 27, 45, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.onchain-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #f7931a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.onchain-card p {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.onchain-summary-card {
    background: rgba(18, 24, 38, 0.8);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    grid-column: 1 / -1;
}

.onchain-metrics-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .onchain-metrics-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-summary {
    display: flex;
    flex-direction: column;
    background: rgba(22, 28, 45, 0.6);
    padding: 10px;
    border-radius: 8px;
}

.metric-label {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: #f7931a;
}

.onchain-analysis-text {
    background: rgba(22, 28, 45, 0.4);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #f7931a;
}

.onchain-analysis-text p {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.onchain-analysis-text p:last-child {
    margin-bottom: 0;
}
/* Realtime indicators */
.realtime-indicator {
    animation: pulse 2s infinite;
}

.realtime-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

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

.text-success {
    color: #28a745 !important;
}

/* Modern Forecast Chart Styles */
.modern-chart-section {
    margin: 24px 0;
}

.chart-card {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(247, 147, 26, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.forecast-chart-wrapper {
    min-height: 400px;
    position: relative;
}

.forecast-chart-container {
    width: 100%;
    height: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-title {
    color: #f7931a;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title i {
    font-size: 18px;
}

.chart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-points {
    background: rgba(247, 147, 26, 0.1);
    color: #f7931a;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(247, 147, 26, 0.2);
}

.chart-wrapper {
    position: relative;
    height: 350px;
    margin: 20px 0;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #94a3b8;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(247, 147, 26, 0.2);
    border-top: 3px solid #f7931a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #ef4444;
    text-align: center;
}

.chart-error i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chart-card {
        padding: 16px;
        margin: 16px 0;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chart-title {
        font-size: 18px;
    }

    .chart-wrapper {
        height: 280px;
    }

    .chart-legend {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .forecast-chart-wrapper {
        min-height: 350px;
    }
}

/* Styles for On-Chain Analysis */
.onchain-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}