.containerInsights {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    padding-bottom: 100px;
}

.containerInsights h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
}

.insights-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.insight-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.insight-title {
    text-decoration: none;
    color: #007bff;
    font-weight: 600;
    font-size: 1.1rem;
}

.insight-title:hover {
    text-decoration: underline;
    color: #0056b3;
}

.no-insights {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 1.1rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

/* Filter Styles */
.insights-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.insight-generator-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #007bff;
    color: #fff;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.insight-generator-button:hover {
    background: #0056b3;
}

body {
    margin: 0;
}

.generator-page {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 20px;
    padding-bottom: 100px;
    box-sizing: border-box;
}

.generator-intro {
    margin-top: 8px;
    color: #555;
    line-height: 1.6;
}
.generator-table .clickable-row:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Or a light grey for white themes */
    transition: background 0.2s ease;
}

.generator-table img {
    background: #eee; /* Helps see transparent PNGs */
    display: block;
    margin: 0 auto;
}
.generator-panel {
    padding: 25px;
    background: #f8fbff;
    border: 1px solid #e7eff9;
    border-radius: 14px;
    margin-bottom: 100px;
}

.generator-section {
    margin-bottom: 24px;
    /* Add these lines */
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; /* Space between the filter boxes */
    align-items: flex-end; /* Keeps labels and selects aligned at the bottom */
}

.generator-section h2 {
    margin-bottom: 14px;
    font-size: 1.15rem;
    color: #1f3f72;
}

.generator-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    /* Change fixed width to a flexible base */
    flex: 1 1 250px; /* Grow, Shrink, and try to be at least 250px wide */
    max-width: 400px; /* Optional: prevents them from getting too huge on ultra-wide screens */
}

/* Ensure inputs take up 100% of their flexible container */
.generator-field select,
.generator-field input,
.generator-field fieldset {
    width: 100%;
    max-width: none; /* Remove the 320px restriction */
}

.generator-field label {
    font-weight: 600;
    color: #333;
}

.generator-field select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 2px solid #cfe1f8;
    border-radius: 8px;
    background: #fff;
    color: #1f3f72;
}

.generator-field fieldset {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 2px solid #cfe1f8;
    border-radius: 8px;
    background: #fff;
    color: #1f3f72;
}

.generator-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.generator-message {
    color: #333;
    font-size: 0.98rem;
}

.generator-loading {
    color: #0c63e4;
}

.generator-success {
    color: #155724;
}

.generator-warning {
    color: #856404;
}

.generator-error {
    color: #721c24;
}

.generator-results {
    margin-top: 20px;
}

.generator-empty {
    color: #666;
    padding: 20px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e8eef4;
}

.generator-table {
    margin-top: 15px;
}

@media (max-width: 768px) {
    .generator-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .generator-field {
        max-width: 100%;
    }

    .generator-panel {
        padding: 15px;
    }

    .generator-page {
        width: 100vw;
        padding: 15px;
    }
}

.insights-search-container {
    margin-bottom: 20px;
}

.insights-search {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 2px solid #007bff;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.insights-search:focus {
    border-color: #0056b3;
}

.insights-filter-container {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-btn {
    padding: 5px 10px;
    border: 2px solid #007bff;
    background: #fff;
    color: #007bff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e7f1ff;
    border-color: #0056b3;
}

.filter-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.filter-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Individual Insight Page Styles */
.containerInsight {
    /* max-width: 900px; */
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    padding-bottom: 100px;
}

.insight {
    line-height: 1.6;
    color: #333;
}

.insight > h1.insight-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #222;
    line-height: 1.3;
}

.insight-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

.insight-category {
    display: inline-block;
    background: #e7f3ff;
    color: #0056b3;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.insight-date {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.insight-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
    display: block;
}

/* Content Blocks */
.content-block {
    margin-bottom: 30px;
}

.text-block {
    font-size: 1rem;
    line-height: 1.8;
}

.text-block h1 {
    font-size: 2rem;
    margin: 30px 0 15px 0;
    color: #222;
}

.text-block h2 {
    font-size: 1.6rem;
    margin: 25px 0 12px 0;
    color: #333;
}

.text-block h3 {
    font-size: 1.3rem;
    margin: 20px 0 10px 0;
    color: #444;
}

.text-block p {
    margin-bottom: 15px;
}

.text-block strong {
    font-weight: 700;
}

/* Table Block */
.table-block {
    overflow-x: auto;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.content-table thead {
    background: #f8f9fa;
    font-weight: 700;
}

.content-table th {
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    color: #333;
}

.content-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.content-table tbody tr:hover {
    background: #f9f9f9;
}

/* Chart Block */
.chart-block {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.chart-container {
    position: relative;
    width: 100%;
}

/* SQL Loading Block */
.sql-loading {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px dashed #007bff;
}

/* Stat Block */
.stat-block {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.95;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Insight Block (Templated) */
.insight-block {
    background: #e7f3ff;
    border-left: 4px solid #0056b3;
    padding: 20px;
    border-radius: 4px;
    font-weight: 500;
    color: #0056b3;
}

.insight-block strong {
    font-weight: 700;
}

/* Insight Page with Sidebar */
.insight-page-wrapper {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.insights-sidebar {
    /* flex: 0 0 200px; */
    max-width: 350px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    max-height: fit-content;
    position: sticky;
    top: 20px;
    border: 1px solid #e0e0e0;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.sidebar-category {
    margin-bottom: 15px;
}

.category-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    padding-left: 5px;
}

.sidebar-category .insight-link {
    display: block;
    padding: 6px 8px;
    color: #007bff;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sidebar-category .insight-link:hover {
    background: #e7f3ff;
    color: #0056b3;
    padding-left: 15px;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .insight-page-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .insights-sidebar {
        flex: 0 1 100%;
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .containerInsight {
        padding: 15px;
    }

    .insight > h1.insight-title {
        font-size: 1.8rem;
    }

    .insight-meta {
        flex-direction: column;
        gap: 10px;
    }

    .content-table {
        font-size: 0.9rem;
    }

    .content-table th,
    .content-table td {
        padding: 10px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .insights-sidebar {
        padding: 15px;
    }

    .sidebar-title {
        font-size: 1.1rem;
    }
}


.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #f8fbff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e7eff9;
    margin-bottom: 25px;
    font-size: 13px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-item label {
    font-weight: 600;
    color: #1f3f72;
}

.filter-item select, 
.filter-item input {
    padding: 6px 10px;
    border: 1px solid #cfe1f8;
    border-radius: 4px;
    outline: none;
    background: white;
    font-size: 13px;
}

.search-filter {
    flex-grow: 1;
    min-width: 200px;
}

.search-filter input {
    width: 100%;
}

.insight-generator-button {
    background: #0c63e4;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-generator-button:hover {
    background: #0a58ca;
}

/* Data Table Header Styling */
.generator-results table thead th {
    background-color: #42445A !important;
    color: white !important;
    font-weight: 500;
    text-align: center;
    padding: 12px;
}

.generator-results table th,
.generator-results table td {
    text-align: center;
    vertical-align: middle; /* Ensures vertical centering for different row heights */
}

.insights-top-row h1 {
    font-size: 24px;
    color: #1f3f72;
    margin-bottom: 5px;
}



.asset-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.insight-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    border: 1px solid #eee;
}

.insight-card:hover {
    transform: translateY(-5px);
}

.card-image {
    position: relative;
    height: 150px;
    background: #f8f8f8;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2ecc71;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.card-info {
    padding: 12px;
}

.card-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-price {
    color: #e67e22;
    font-weight: bold;
    margin: 0;
}

canvas#insightChart {
    width: 100% !important;
    height: 100% !important;
}

#insightResults {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 24px;
    margin-top: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    overflow: hidden;
}
/* Tooltip & Legend Font */
#insightResults * {
    font-family: 'Inter', -apple-system, sans-serif !important;
}