.insights-page {
    margin: 0 auto;
    padding: 20px;
}

.company-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 8px;
}

.price-display {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* Price change styling */
#price-change {
    font-weight: bold;
}

#price-change.positive,
#previous-close-change.positive,
.positive {
    color: #10b981;
}

#price-change.negative,
#previous-close-change.negative,
.negative {
    color: #ef4444;
}

/* Asset badge styling */
#asset-badge.badge-stock {
    background-color: #d1fae5;
    color: #059669;
}

/* Current Price card border */
.border-primary-green {
    border-color: #86efac !important;
}

/* Price card label styling */
.price-card-label {
    color: #A5A5A5;
}

/* Price divider styling */
.price-divider-container {
    position: absolute;
    left: 50%;
    margin-left: -3px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.price-divider {
    width: 2px;
    height: 120px;
    background: linear-gradient(to bottom, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
}

/* AI Insights horizontal section divider */
.ai-section-divider {
    margin: 30px auto;
    width: 33.333%; /* col-lg-4 equivalent */
    height: 2px;
    background: linear-gradient(to right, transparent, #d1d5db 20%, #d1d5db 80%, transparent);
}

/* Main page section divider */
.section-divider {
    margin: 40px auto;
    width: 33.333%; /* col-lg-4 equivalent */
    height: 2px;
    background: linear-gradient(to right, transparent, #d1d5db 20%, #d1d5db 80%, transparent);
}

#market-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

#market-status.live {
    background-color: #10b981;
}

#market-status.closed {
    background-color: #6b7280;
}

.info-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.insights-metric-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child,
.insights-metric-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
}

.metric-label {
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.info-icon {
    width: 14px;
    height: 14px;
    color: #3b82f6;
    cursor: help;
}

.info-icon:hover {
    color: #2563eb;
}

.info-value,
.insights-metric-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

.insights-metric-value.positive {
    color: #10b981;
}

.insights-metric-value.negative {
    color: #ef4444;
}

#chart-range-buttons .btn {
    min-width: 50px;
}

#chart-range-buttons .btn.active {
    background-color: #EDB809;
    border-color: #EDB809;
    color: white;
}

#period-toggle .btn.active {
    background-color: #EDB809;
    border-color: #EDB809;
    color: white;
}

/* Remove borders from cards only on insights page (except AI insights) */
.insights-page .chart-section .card,
.insights-page .company-info-section .card,
.insights-page .financial-overview-section .card,
.insights-page .financial-charts-section .card,
.insights-page .insider-trading-section .card,
.insights-page .technical-indicators-section .card,
.insights-page .price-section .card {
    box-shadow: none;
    border: none;
}

/* AI Insights card should have border */
.insights-page .ai-insights-section .card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.card-subtitle {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

/* Chart title without filter - compensate for filter height */
.chart-title-no-filter {
    margin-top: 5px;
    margin-bottom: 1.4rem;
}

/* Financial Charts section - borderless cards */
.financial-charts-section .card {
    border: none;
    box-shadow: none;
}

/* Specific chart container heights */
#expense-chart {
    height: 380px !important;
}

#segment-chart {
    height: 450px !important;
}

#cash-debt-chart {
    height: 328px !important;
}

#holdings-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #4b5563;
}

#holdings-table tbody tr:hover {
    background-color: #f9fafb;
}

/* ETF Information styling */
.etf-info-item {
    font-size: 15px;
    line-height: 1.6;
}

.etf-info-item strong {
    font-size: 14px;
}

.etf-information-section .text-muted {
    font-size: 15px;
    line-height: 1.7;
}

/* Financial Overview 20% width cards */
.financial-overview-card {
    flex: 0 0 20%;
    max-width: 20%;
}

@media (max-width: 991px) {
    .financial-overview-card {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 575px) {
    .financial-overview-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Financial Charts row spacing */
.chart-row {
    margin-bottom: 75px;
}

.chart-row:last-child {
    margin-bottom: 0;
}

/* Specific row spacing adjustments */
#chart-row-2 {
    margin-bottom: 0px !important;
}

#chart-row-3 {
    margin-bottom: 30px !important;
}

/* Section spacing */
.section-spacing {
    margin-bottom: 4rem;
}

/* News Section */
.news-section {
    border: none;
    background: transparent;
}

#stock-news-container {
    border: none;
    box-shadow: none;
    background: transparent;
}

#stock-news-grid {
    border: none;
    box-shadow: none;
    background: transparent;
}

#stock-news-grid .col-md-4 {
    margin-bottom: 2rem;
}

.news-card {
    padding: 10px;
    height: 320px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    background-color: #ffffff;
}

.news-card-image {
    height: 195px;
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: 5px;
}

.news-card-image img {
    width: 100%;
    height: 195px;
    object-fit: cover;
}

.news-card-title {
    margin-top: 0;
    font-size: 1rem;
    line-height: 1.3;
    height: 50px;
    overflow: hidden;
}

.news-card-title a {
    text-decoration: none;
    color: #4e89e8;
}

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

.news-card-date,
.news-card-publisher {
    font-size: 0.8rem;
    color: #666666;
    margin-bottom: 4px;
}

#stock-news-pagination {
    margin-top: 0;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.pagination-controls .news-nav-btn {
    background: none;
    border: none;
    color: #EDB809;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: opacity 0.2s;
}

.pagination-controls .news-nav-btn:hover:not(:disabled) {
    opacity: 0.7;
}

.pagination-controls .news-nav-btn:disabled {
    color: #cccccc;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
}

@media (max-width: 768px) {
    .insights-page {
        padding: 10px;
    }

    .company-logo {
        width: 40px;
        height: 40px;
    }

    #chart-range-buttons .btn {
        min-width: 40px;
        font-size: 0.875rem;
    }

    .price-display {
        padding: 15px;
    }

    #current-price {
        font-size: 2rem !important;
    }
    
    .section-spacing {
        margin-bottom: 4rem;
    }
}

/* Holdings Table Scrollable Container */
.holdings-table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.holdings-table-container::-webkit-scrollbar {
    width: 8px;
}

.holdings-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.holdings-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.holdings-table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#holdings-table thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* ETF Financial Overview Styles */
.etf-fin-header-spacer {
    height: 2px;
    background-color: #dee2e6;
    width: 100%;
    max-width: 185px;
}

.etf-fin-item {
    display: flex;
    flex-direction: column;
}

.etf-fin-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.etf-fin-value {
    font-size: 1rem;
    font-weight: 500;
    color: #000;
}

/* Holdings Table Grid Lines */
.holdings-grid-table {
    border-collapse: collapse;
}

.holdings-grid-table th,
.holdings-grid-table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
}

.holdings-grid-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Sortable Column Headers */
.holdings-grid-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.holdings-grid-table th.sortable:hover {
    background-color: #e9ecef;
}

.sort-indicator {
    margin-left: 5px;
    font-size: 0.75rem;
    color: #6c757d;
}

.sort-indicator::after {
    content: '⇅';
}

.sort-indicator.asc::after {
    content: '↑';
    color: #0d6efd;
}

.sort-indicator.desc::after {
    content: '↓';
    color: #0d6efd;
}

/* Column Visibility */
.holdings-grid-table th.hidden-column,
.holdings-grid-table td.hidden-column {
    display: none;
}

/* ETF Performance Tables */
.etf-performance-table {
    margin-bottom: 0;
}

.etf-performance-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding: 10px 12px;
    font-size: 0.875rem;
}

.etf-performance-table tbody td {
    padding: 8px 12px;
    font-size: 0.875rem;
    vertical-align: middle;
}

.etf-performance-table tbody tr:hover {
    background-color: #f8f9fa;
}

.etf-performance-table tbody td:first-child {
    font-weight: 500;
}

.etf-performance-table .positive-return {
    color: #10b981;
    font-weight: 500;
}

.etf-performance-table .negative-return {
    color: #ef4444;
    font-weight: 500;
}

/* Performance Tables Grid Lines */
.performance-grid-table {
    border-collapse: collapse;
}

.performance-grid-table th,
.performance-grid-table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
}

.performance-grid-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Sortable Column Headers for Performance Tables */
.performance-grid-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.performance-grid-table th.sortable:hover {
    background-color: #e9ecef;
}

/* Column Visibility for Performance Tables */
.performance-grid-table th.hidden-column,
.performance-grid-table td.hidden-column {
    display: none;
}
