h1, h2{
    color: black;
}

h1.main_title {
    color: white;
}
#jg-charts-app {
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#jg-charts-form {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    border: 1px solid #d9d9d9;
}

.text-content {
    color: rgb(17, 24, 39);
    margin-bottom: 24px;
}

.text-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgb(17, 24, 39);
}

.text-content p {
    font-size: 14px;
    line-height: 1.6;
    color: rgb(75, 85, 99);
}

.node rect {
    stroke: white;
    stroke-width: 1px;
}

.node text {
    font-size: 12px;
    font-weight: 500;
}

.table-container {
    display: none;
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.table-container.active {
    display: block;
}

.charts-container.hidden {
    display: none;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    border-top-color: rgb(59, 130, 246);
    animation: spin 1s ease-in-out infinite;
    margin-right: 12px;
}

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

.loading-message {
    font-size: 14px;
    font-weight: 500;
    color: rgb(17, 24, 39);
}

.error-message, .success-message {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background-color: rgb(254, 242, 242);
    border-left: 4px solid rgb(220, 38, 38);
}

.success-message {
    background-color: rgb(240, 253, 244);
    border-left: 4px solid rgb(34, 197, 94);
}

.error-icon, .success-icon {
    margin-right: 12px;
    font-size: 18px;
}

.error-text, .success-text {
    flex: 1;
    font-size: 14px;
}

.error-text {
    color: rgb(185, 28, 28);
}

.success-text {
    color: rgb(22, 163, 74);
}

.error-close, .success-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.error-close:hover, .success-close:hover {
    opacity: 1;
}

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

/* No data message */
.no-data-message {
    padding: 32px;
    text-align: center;
    color: rgb(107, 114, 128);
    font-size: 16px;
    background-color: rgb(243, 244, 246);
    border-radius: 8px;
    margin: 24px 0;
}

/* Utility classes */
.text-blue-600 {
    color: rgb(37, 99, 235);
}

.text-red-600 {
    color: rgb(220, 38, 38);
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.font-medium {
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .bar-chart-section {
        grid-template-columns: 1fr;
    }
    
    .section-container {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    #jg-charts-app {
        padding: 16px;
    }
    
    .dynamic-select {
        width: 100%;
    }
    
    #jg-charts-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .submit-button, .view-toggle-button {
        width: 100%;
        margin-left: 0;
    }
    
    .view-toggle-button {
        margin-top: 8px;
    }
}

/* Form Container Styles */
.form-section {
    margin-bottom: 24px;
}

.filter-form {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: solid;
    border-color: "#d9d9d9";
    border-width: 1px;
}

/* Form Controls Container */
.form-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    align-items: flex-end;
}

/* Individual Form Group Styles */
.form-group {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 300px;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgb(55, 65, 81);
}


.dynamic-select {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 24px;
    color: rgb(17, 24, 39);
    background-color: white;
    border: 1px solid rgb(229, 231, 235);
    border-radius: 6px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.dynamic-select:hover {
    border-color: rgb(209, 213, 219);
}

.dynamic-select:focus {
    outline: none;
    border-color: rgb(59, 130, 246);
    box-shadow: 0 0 0 2px rgb(191, 219, 254);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: start;
    align-items: flex-start;
}

.submit-button, .view-toggle-button {
    min-width: 80px;
    height: 40px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-button {
    color: white;
    background-color: rgb(59, 130, 246);
}

.view-toggle-button {
    height: 40px;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: rgb(75, 85, 99);
    background-color: white;
    border: 1px solid rgb(75, 85, 99);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.view-toggle-button:hover {
    background-color: rgb(243, 244, 246);
}

.view-toggle-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(209, 213, 219);
}

.view-toggle-button.inverted {
    color: white;
    background-color: rgb(75, 85, 99);
    border-color: rgb(75, 85, 99);
}

.view-toggle-button.inverted:hover {
    background-color: rgb(55, 65, 81);
}

.view-toggle-button.inverted:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(209, 213, 219);
}

.submit-button:hover {
    background-color: rgb(37, 99, 235);
}


.submit-button:focus, .view-toggle-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(191, 219, 254);
}

@media (max-width: 768px) {
    .form-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group {
        max-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .submit-button, .view-toggle-button {
        width: 100%;
    }
}

.form-controls.three-dropdowns .form-group {
    flex: 1 1 calc(33.333% - 16px);
}

.form-controls.four-dropdowns .form-group {
    flex: 1 1 calc(25% - 16px);
}

@media (min-width: 1024px) {
    .form-controls.three-dropdowns .form-group,
    .form-controls.four-dropdowns .form-group {
        min-width: initial;
    }
}
.chart-section {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Typography */
.chart-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: hsl(240, 5%, 10%);
    line-height: 1.2;
}

.chart-description {
    font-size: 14px;
    line-height: 1.6;
    color: hsl(240, 4%, 46%);
    margin-bottom: 24px;
}

.chart-title-text {
    font-size: 16px;
    font-weight: 600;
    fill: hsl(240, 5%, 10%);
}

.axis-label {
    font-size: 14px;
    fill: hsl(240, 4%, 46%);
}

.axis-text {
    font-size: 12px;
    fill: hsl(240, 4%, 46%);
}

/* Filter Form Styles */
.filter-container {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.filter-form-trend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-section {
    flex: 1;
    min-width: 180px;
    margin-bottom: 8px;
}

.filter-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: hsl(240, 4%, 36%);
    margin-bottom: 6px;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.filter-select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid hsl(240, 5%, 88%);
    border-radius: 6px;
    background-color: white;
    color: hsl(240, 4%, 26%);
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: hsl(240, 5%, 70%);
}

.filter-select:focus {
    outline: none;
    border-color: hsl(240, 100%, 60%);
    box-shadow: 0 0 0 2px hsla(240, 100%, 65%, 0.2);
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid hsl(240, 4%, 46%);
    pointer-events: none;
}

.range-inputs {
    display: flex;
    gap: 12px;
}

.range-input {
    flex: 1;
}

.year-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid hsl(240, 5%, 88%);
    border-radius: 6px;
    color: hsl(240, 4%, 26%);
    transition: all 0.2s ease;
}

.year-input:hover {
    border-color: hsl(240, 5%, 70%);
}

.year-input:focus {
    outline: none;
    border-color: hsl(240, 100%, 60%);
    box-shadow: 0 0 0 2px hsla(240, 100%, 65%, 0.2);
}

.apply-button {
    background-color: hsl(240, 100%, 60%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 2px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 36px;
    margin-bottom: 0.60em;
}

.apply-button:hover {
    background-color: hsl(240, 100%, 50%);
}

.apply-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsla(240, 100%, 65%, 0.3);
}

/* Chart Container */
.chart-container {
    width: 100%;
    height: auto;
    padding: 16px;
    border-radius: 8px;
    background-color: white;
    overflow-x: auto;
    border: 1px solid #d9d9d9;
}

/* SVG and D3 elements */
svg {
    display: block;
    max-width: 100%;
}

.line-path {
    stroke: hsl(226, 100%, 60%);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.zero-line {
    stroke: hsl(240, 5%, 65%);
    stroke-width: 1;
    stroke-dasharray: 3,3;
}

.data-point {
    cursor: pointer;
    transition: all 0.2s ease;
}

.tooltip-text {
    fill: white;
    font-size: 12px;
    font-weight: 500;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.tooltip-trigger {
    pointer-events: none;
}

.tooltip-trigger text {
    background-color: hsl(240, 5%, 26%);
    padding: 4px 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-form-trend {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-section {
        width: 100%;
    }
    
    .range-inputs {
        flex-direction: column;
        gap: 8px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
  }
  
  @media (min-width: 768px) {
    .stats-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
  
.stat-card {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid #d9d9d9;
    transition: transform 0.2s, box-shadow 0.2s;
}
  
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card .icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    opacity: 0.5;
}

.stat-card h3 {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: left;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    margin: 12px 0 8px;
    text-align: left;
    line-height: 1.2;
}

.stat-card .value .stat-card-str {
    font-size: 18px
}

.stat-card .subtext {
    font-size: 14px;
    color: #6b7280;
    text-align: left;
}

.stat-card .positive {
    color: #1B7C4C;
}
  
.stat-card .negative {
    color: #E71E1E;
}
  
.stat-card .neutral {
    color: #6b7280;
}

#industry-data-table {
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

#industry-data-table thead th {
    background-color: #f9fafb;
    padding: 16px 24px;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
}

#industry-data-table tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #ffffff;
}

#industry-data-table tbody tr:hover {
    background-color: #f3f4f6;
}

#industry-data-table td:nth-child(3) {
    font-weight: 500;
}

#industry-data-table td:nth-child(3).positive {
    color: #16a34a;
}

#industry-data-table td:nth-child(3).negative {
    color: #dc2626;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-controls .dataTables_filter {
    margin-right: 16px;
}

.table-controls .dt-buttons {
    display: flex;
    gap: 8px;
}

.table-footer {
    margin-top: 16px;
}

div.dt-buttons .dt-button {
    border-radius: 6px;
    padding: 8px 16px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
}

div.dt-buttons .dt-button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

/* ShadCN UI inspired styling for MSA Regional Comparison Chart */

/* Main container styling */
.chart-section {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid hsl(214.3 31.8% 91.4%);
}

/* Text content styling */
.text-content {
    color: hsl(214.3 31.8% 25.1%);
    margin-bottom: 24px;
}

.text-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: hsl(214.3 31.8% 25.1%);
    line-height: 1.2;
}

.text-content p {
    font-size: 15px;
    line-height: 1.6;
    color: hsl(214.3 31.8% 45.1%);
    margin-bottom: 16px;
}

/* Region composition cards */
.region-composition {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.region-card {
    background-color: hsl(214.3 31.8% 98%);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    transition: all 0.2s ease;
}

.region-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.region-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: hsl(214.3 31.8% 25.1%);
}

.region-card p {
    font-size: 14px;
    color: hsl(214.3 31.8% 45.1%);
    line-height: 1.5;
    margin: 0;
}

/* Chart containers */
.chart-container {
    width: 100%;
    height: auto;
    padding: 16px;
    border-radius: 8px;
    background-color: white;
    overflow-x: auto;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.chart-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Grid layout */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Table styling */
.table-container {
    margin-top: 20px;
    grid-column: span 2;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.region-table, .msa-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.region-table th, .msa-summary-table th {
    text-align: left;
    padding: 12px 16px;
    background-color: hsl(214.3 31.8% 98%);
    font-weight: 600;
    color: hsl(214.3 31.8% 25.1%);
    font-size: 14px;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
}

.region-table td, .msa-summary-table td {
    padding: 12px 16px;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
    font-size: 14px;
    color: hsl(214.3 31.8% 35.1%);
}

.region-table tr:last-child td, .msa-summary-table tr:last-child td {
    border-bottom: none;
}

.region-table tr:nth-child(even), .msa-summary-table tr:nth-child(even) {
    background-color: hsl(214.3 31.8% 98%);
}

.region-table tr:hover, .msa-summary-table tr:hover {
    background-color: hsl(214.3 31.8% 96%);
}

/* First and last cell radius */
.region-table thead th:first-child, 
.msa-summary-table thead th:first-child {
    border-top-left-radius: 8px;
}

.region-table thead th:last-child,
.msa-summary-table thead th:last-child {
    border-top-right-radius: 8px;
}

.region-table tbody tr:last-child td:first-child,
.msa-summary-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.region-table tbody tr:last-child td:last-child,
.msa-summary-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Summary container styling */
.msa-summary-container {
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-title {
    padding: 16px;
    background-color: white;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
}

.summary-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: hsl(214.3 31.8% 25.1%);
    margin: 0;
}

.summary-title p {
    font-size: 14px;
    color: hsl(214.3 31.8% 45.1%);
    margin: 4px 0 0 0;
}

.positive-value {
    color: #10b981 !important;
    font-weight: 500;
}

.negative-value {
    color: #ef4444 !important;
    font-weight: 500;
}

.axis path,
.axis line {
    stroke: hsl(214.3 31.8% 65.1%);
    shape-rendering: crispEdges;
}

.axis text {
    fill: hsl(214.3 31.8% 45.1%);
    font-size: 12px;
}

.bar {
    transition: opacity 0.2s ease;
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    font-size: 12px;
    font-weight: 500;
}

.negative {
    fill: #ef4444;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        grid-column: span 1;
        overflow-x: auto;
    }
    
    .region-composition {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

.warning-banner {
    margin: 1rem 0;
    width: 100%;
  }
  .alert-warning {
    display: flex;
    padding: 0.75rem 1rem;
    background-color: #fef9c3;
    border: 1px solid #eab308;
    border-radius: 0.5rem;
    color: #854d0e;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .alert-title {
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
  }
  .alert-description {
    margin: 0;
    font-size: 0.875rem;
  }
  .lucide-alert-triangle {
    color: #ca8a04;
    flex-shrink: 0;
    margin-top: 0.125rem;
  }