/* --- General Styling & Variables --- */
:root {
	--color-bg: #ffffff; 
	--color-card: #FFFFFF; 
	--color-text-dark: #002554;
	--color-text-muted: #6B7280; 
	--color-accent-positive: #10B981; 
	--color-accent-negative: #EF4444; 
	--color-divider: #ccc;
	--font-family: "Inter", sans-serif
	--shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}



.container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto;
    box-sizing: border-box !important;
}

@media (min-width: 640px) {
    .container {
        padding: 20px !important;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 20px !important;
    }
}

body {
	font-family: var(--font-family);
	background-color: var(--color-bg);
    overflow-x: hidden;
}

/* Utility for text alignment within data points */
.data-value {
	text-align: left;
	font-weight: 500;
    color: var(--primary);
}

/* --- Custom Grid/Card Styling */
.stat-card-container {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

@media screen and (min-width: 768px) {
	.stat-card-container {
		grid-template-columns: repeat(2, 1fr);
	}
}

.stat-card {
	background-color: var(--color-card);
	border: 1px solid var(--lines);
	border-radius: 0px;
	padding: 20px;
	/* box-shadow: var(--shadow-md); */
	/* transition: transform 0.2s, box-shadow 0.2s; */
	display: grid;
	grid-template-columns: 1fr 100px; 
	grid-template-areas: 
		"name chart"
		"data data";
	gap: 10px;
}

/* .stat-card:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
} */

.stat-name {
	font-weight: 500;
	color: var(--primary);
	font-size: 1rem;
	grid-area: name;
}

.data-point {
	padding: 0;
	align-items: flex-start;
	border-left: 1px solid var(--color-divider);
	padding-left: 10px;
}

.data-label {
	display: block; 
	font-size: 13px;
	color: var(--primary);
	margin-bottom: 2px;
	text-align: left;
	white-space: nowrap;
    font-weight: 400;
}

.data-section {
	grid-area: data;
	display: grid;
	grid-template-columns: repeat(2, 1fr); 
	gap: 15px;
	padding-top: 10px;
	border-top: 1px solid var(--color-divider);
	margin-top: 10px;
}

.data-point:nth-child(2n+1) {
	border-left: none; 
	padding-left: 0;
}
.data-label, .data-value {
	text-align: left;
}

.chart-container {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	height: 40px;
	grid-area: chart;
}
.chart-inline {
	width: 100px;
	height: 100%;
	display: flex;
	justify-content: space-around;
	align-items: flex-end;
	opacity: 0.9;
}
.chart-bar {
	width: 10px;
	margin: 0 1px;
	border-radius: 2px 2px 0 0;
	transition: height 0.5s ease;
	background-color: var(--color-accent-positive);
}
.negative-trend .chart-bar {
	background-color: var(--color-accent-negative);
}
.neutral-trend .chart-bar {
	background-color: var(--color-divider);
}
.positive-change {
	color: var(--color-accent-positive);
	font-weight: 500;
}
.negative-change {
	color: var(--color-accent-negative);
	font-weight: 500;
}
.no-change {
	color: var(--color-text-muted);
	font-weight: 500;
}

.h1-heading
{
	font-size: 28px;
    color: var(--primary);
    font-weight: 500;
    line-height: 115%;
}

.header-row {
	display: none; 
}

/* Enhanced chart styles */
.chart-inline {
    display: flex;
    align-items: end;
    height: 70px;
    gap: 4px;
    padding: 8px 0;
    border-radius: 4px;
    padding: 8px 4px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #667c98, var(--primary));
    border-radius: 3px 3px 0 0;
    min-height: 5px;
    transition: all 0.3s ease;
    position: relative;
    cursor: help;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
	background: #001a3b;
}

.chart-bar.missing-data {
    background: repeating-linear-gradient(
        45deg,
        #f0e9db,
        #f0e9db 4px,
        #e0d9c9 4px,
        #e0d9c9 8px
    );
    opacity: 0.8;
    border: 1px solid #e0d9c9;
}

.chart-bar.growth-indicator {
    display: none;
}

/* Enhanced Chart Bar Tooltips */
.chart-bar {
    position: relative;
}

/* Custom tooltip for bars (appears on hover) */
.chart-bar::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--hover-blue);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.8;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

/* Tooltip arrow */
.chart-bar::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(31, 41, 55, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 101;
    pointer-events: none;
}

/* Show tooltip on hover */
.chart-bar:hover::after,
.chart-bar:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

.chart-bar:hover::before {
    transform: translateX(-50%) translateY(-4px);
}

/* Missing data tooltips */
.chart-bar.missing-data::after {
    background: rgba(107, 114, 128, 0.95);
}

.chart-bar.missing-data::before {
    border-top: 8px solid rgba(107, 114, 128, 0.95);
}

.chart-bar[title*="â†—"]::after {
    color: #10B981; /* Green for positive */
}

.chart-bar[title*="â†˜"]::after {
    color: #EF4444; /* Red for negative */
}

/* Mobile adjustments for tooltips */
@media screen and (max-width: 600px) {
    .chart-bar::after {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 100px;
        max-width: 150px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .chart-bar::before {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid rgba(31, 41, 55, 0.95);
    }
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: help;
}

.tooltip-icon {
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.tooltip-container:hover .tooltip-icon {
    opacity: 1;
}

.tooltip-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--hover-blue);
    color: var(--white);
    padding: 12px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 150%;
    font-weight: 400;
    width: 280px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    opacity: 0.8;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.tooltip-container:hover .tooltip-content {
    opacity: 0.8;
    visibility: visible;
    transform: translateY(5px);
}

.tooltip-arrow {
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1f2937;
}

.tooltip-text {
    font-weight: 400;
    font-size: 16px;
}

/* Heading with Tooltip Styles */
.heading-with-tooltip {
    position: relative;
    /* display: inline-block; */
}

.heading-with-tooltip .tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.heading-with-tooltip .tooltip-icon {
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    cursor: help;
}

.heading-with-tooltip .tooltip-icon:hover {
    opacity: 1;
}

.heading-with-tooltip .tooltip-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--hover-blue);
    color: #fff;
    padding: 16px;
    border-radius: 0px;
    font-size: 16px;
    line-height: 150%;
    font-weight: 400;
    width: 320px;
    max-width: 90vw;
    box-sizing: border-box;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    opacity: 0.8;
    visibility: hidden;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.heading-with-tooltip .tooltip-container:hover .tooltip-content {
    opacity: 0.8;
    visibility: visible;
    transform: translateX(-50%) translateY(8px);
}

.heading-with-tooltip .tooltip-arrow {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #1f2937;
}

.heading-with-tooltip .tooltip-text {
    font-weight: normal;
    text-align: left;
}

.heading-with-tooltip .tooltip-text p {
    margin-bottom: 8px;
}

.heading-with-tooltip .tooltip-text p:last-child {
    margin-bottom: 0;
}

.heading-with-tooltip .tooltip-text strong {
    color: #fff;
    font-weight: 400;
    text-align: left;
}

/* --- Mobile Responsiveness (Small Screens) --- */
@media screen and (max-width: 600px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .stat-card {
        grid-template-columns: 1fr 70px;
        grid-template-areas: 
            "name chart"
            "data data";
        padding: 14px;
        gap: 6px;
    }
    
    .stat-name {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .chart-container {
        justify-content: flex-end;
        align-items: flex-start;
        height: 45px;
    }
    
    .chart-inline {
        width: 70px;
        height: 45px;
        gap: 3px;
    }
    
    .chart-bar {
        width: 7px;
        border-radius: 1px 1px 0 0;
    }
    
    .data-section {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .data-point {
        border-left: none;
        padding-left: 0;
        border-bottom: 1px solid var(--color-divider);
        padding-bottom: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .data-point:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .data-label {
        font-size: 0.7rem;
        white-space: normal;
        flex: 1;
        margin-bottom: 0;
    }
    
    .data-value {
        font-size: 0.85rem;
        text-align: right;
        flex-shrink: 0;
        margin-left: 8px;
    }
    
    /* Mobile heading adjustments */
    .text-center.mb-5 {
        padding: 0 5px;
        text-align: center;
    }
    
    h1.text-4xl {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    /* SIMPLE MOBILE TOOLTIP */
    .heading-with-tooltip .tooltip-content {
        width: 280px !important;
        max-width: calc(100vw - 40px) !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(-10px) !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 10000 !important;
    }
    
    .heading-with-tooltip .tooltip-container:hover .tooltip-content {
        transform: translate(-50%, -50%) !important;
    }
    
    .heading-with-tooltip .tooltip-arrow {
        display: none !important;
    }
    
    /* overlay for mobile tooltips */
    .tooltip-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }
    
    .heading-with-tooltip .tooltip-content.show-on-mobile {
        display: block !important;
    }
    
    /* Force no horizontal scroll */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }
    
    .container {
        overflow-x: hidden !important;
    }
}