
/* --- Base & Body Styles --- */
:root {
	/* Color Palette */
	--color-background: #FAF9F6;
	--color-surface: #ffffff;
	--color-border: #e8e8e8;
	--color-surface-muted: #f2f2f2;
	--color-text-primary: #4B4B4B;
	--color-text-secondary: #4b5563;
	--color-text-subtle: #6b7280;
	--color-positive: #79BF43;
    --color-negative: #f87171;
	--color-neutral: #6b7280; /* Color for no change */
	--color-gradient-start: #184A87;
	--color-gradient-end: #4B4B4B;
	--color-indicator-border: #79BF43;

	/* Shadows */
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1),
    0 -6px 12px -4px rgba(0, 0, 0, 0.1);
}

body {
	font-family: var(--font);
	background-color: rgba(255, 255, 255, 0.7);
	color: var(--color-text-secondary);
	margin: 0;
	display: flex;
	align-items: center;
	/* justify-content: center; */
	padding: 1rem; /* 16px */
}

/* --- Main Card Component --- */
.card {
	width: 100%;
	max-width: 1100px; /* 672px */
	background-color: var(--color-surface);
	border-radius: var(--border-radius); /* 16px */
	box-shadow: var(--shadow-lg);
	padding: 1.5rem; /* 24px */
}

/* --- Card Header --- */
.card-header {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-bottom: 1.5rem; /* 24px */
	border-bottom: 1px solid var(--color-border);
}
.card-header__info h1 {
	font-size: var(--text-2xl); /* 24px */
	font-weight: 700;
	color: var(--primary);
	font-family: var(--font-display);
	margin: 0;
}
.card-header__info p {
	font-size: var(--text-xl); /* 14px */
	font-weight: 700;
	font-family: var(--font-display);
	color: var(--primary);
	margin: 0;
	margin-top: 0.5rem
}
.card-header__price {
	text-align: left;
	margin-top: 1rem; /* 16px */
}
.card-header__price .current-price {
	font-size: var(--text-4xl); /* 36px */
	font-weight: 700;
	/* letter-spacing: -0.025em; */
	color: var(--primary);
	margin: 0;
	font-family: var(--font-display);
}

.current-price > small {
	font-family: var(--font);
	font-weight: 600;
	color: var(--text-muted);
	font-size: var(--text-lg);
}

.current-price > small {
	font-family: var(--font);
	font-weight: 600;
	color: var(--text-muted);
}

.card-header__price .price-change-container {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	margin-top: 0.25rem; /* 4px */
	font-size: var(--text-md); /* 18px */
	font-weight: 700;
}
.price-change-container svg {
	height: 0.9rem; /* 24px */
	width: 0.9rem; /* 24px */
}
.price-change-container p {
	margin: 0 0 0 0.25rem; /* 4px */
}
.price-change-container.is-positive { color: var(--color-positive); }
.price-change-container.is-negative { color: var(--color-negative); }
.price-change-container.is-neutral { color: var(--color-neutral); }

.arrow-icon.is-positive { background-color: var(--color-positive); }
.arrow-icon.is-negative { background-color: var(--color-negative); }
.arrow-icon.is-neutral { background-color: var(--color-neutral); }

/* --- Day's Range Visualizer --- */
.range-visualizer {
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
}
.range-visualizer__labels {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--text-sm);
	font-weight: 400;
	color: var(--secondary);
	margin-bottom: 0.5rem; /* 8px */
}
.range-visualizer__bar {
	position: relative;
	height: 0.5rem; /* 8px */
	background-color: var(--color-border);
	border-radius: 9999px;
}
.range-visualizer__fill {
	position: absolute;
	top: 0;
	height: 100%;
	background-image: linear-gradient(to right, var(--color-gradient-start), var(--color-gradient-end));
	border-radius: 9999px;
}
.range-visualizer__indicator {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}
.range-visualizer__indicator div {
	width: 1.25rem; /* 20px */
	height: 1.25rem; /* 20px */
	background-color: var(--color-surface);
	border-radius: 50%;
	box-shadow: var(--shadow-lg);
	border: 2px solid var(--color-indicator-border);
}
.range-visualizer__values {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--text-sm);
	font-weight: 700;
	color: var(--primary);
	margin-top: 0.5rem; /* 8px */
}

/* --- Key Metrics Grid --- */
.metrics-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem; /* 24px */
	padding-top: 1.5rem; /* 24px */
	border-top: 1px solid var(--color-border);
}
.metric-item {
	background-color: var(--color-surface-muted);
	border-radius: var(--border-radius); /* 8px */
	padding: 1rem; /* 16px */
}
.metric-item__label {
	font-size: var(--text-sm); 
	font-weight: 400;
	color: var(--secondary);
	margin: 0;
}
.metric-item__label .date-label {
	font-weight: 400;
	margin-left: 0.5em;
}
.metric-item__value {
	font-size: var(--text-sm);
	font-weight: 700;
	color: var(--primary);
	margin: 0.25rem 0 0 0;
}

/* --- Card Footer --- */
.card-footer {
    text-align: center;
    margin-top: 24px; /* 32px */
    font-size: var(--text-xs);
    color: var(--secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.card-footer a {
	text-decoration: none; 
	color: var(--secondary)
}

.card-footer p {
	margin: 0;
    text-align: left;
}

.poweredby img {
    height: 10px;
}

/* --- Loading Skeleton Styles --- */
.loading-placeholder {
	background-color: var(--color-border);
	border-radius: 0.25rem; /* 4px */
	color: transparent !important; /* Hide any text inside */
	-webkit-user-select: none;
	user-select: none;
	animation: pulse 1.5s infinite ease-in-out;
	min-height: 1.2em; /* Ensure it has height */
	display: inline-block;
	width: 60%; /* Default placeholder width */
}
.loading-placeholder.w-full { width: 100%; }
.loading-placeholder.w-short { width: 30%; }
.loading-placeholder.w-price { width: 40%; }
.loading-placeholder.w-metric { width: 50%; }

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* --- Responsive Styles --- */
@media (min-width: 768px) {
	/* .card {
		padding: 2rem;
	} */
	.card-header {
		flex-direction: row;
		align-items: center;
	}
	.card-header__price {
		text-align: right;
		margin-top: 0;
	}
	.card-header__price .price-change-container {
		justify-content: flex-end;
	}
	/* .card-header__price .current-price {
		font-size: 3rem;
	} */
	.metrics-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 634px) {
    .card-footer > div.poweredby {
        margin-left: auto;
    }
}

@media (max-width: 550px) {
    .metrics-grid {
		grid-template-columns: repeat(1, minmax(0, 1fr));
	}
}