/**
 * Bitcoin Lifespan Simulator - Main Stylesheet
 * Custom styles for the Bitcoin Lifespan Simulator application
 */

/* Print Styles */
@media print {
	.print-hide {
		display: none !important;
	}
}

#reportSummary {
	font-size: 12pt;
}

#reportSummary .print-hide {
	display: none !important;
}

/* Animations */
.fade-in {
	animation: fadeIn 0.6s forwards;
	opacity: 0;
}

@keyframes fadeIn {
	to {
		opacity: 1;
	}
}

/* Logo - Light/Dark Mode Toggle */
:root[data-bs-theme="dark"] .logo-light {
	display: none !important;
}

:root[data-bs-theme="dark"] .logo-dark {
	display: block !important;
}

/* Sticky Container */
#stickyContainer {
	position: sticky;
	top: 0;
	z-index: 1030;
}

#stickyContainer::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -1rem;
	right: -1rem;
	height: 110px;
	background: linear-gradient(to bottom, #f8f9fa 88%, transparent 100%);
	pointer-events: none;
	z-index: -1;
}

/* Dark mode override */
[data-bs-theme="dark"] #stickyContainer::after {
	background: linear-gradient(to bottom, #212529 88%, transparent 100%);
}

/* On mobile, adjust the pseudo-element so it doesn't cause horizontal overflow */
@media (max-width: 768px) {
	#stickyContainer::after {
		left: -10px;
		right: -10px;
	}
}

/* Hover effect on left cards */
.left-panel-card {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.left-panel-card:hover {
	transform: translateY(1px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

#CookiebotWidget {
	display: none !important;
}

/* Table Styling */
#detailsTable table th, #detailsTable table td {
	text-align: right;
}

#detailsTable table th:first-child, #detailsTable table td:first-child {
	text-align: left;
}

/* Keep column headings on one line */
#detailsTable table th {
	white-space: nowrap;
}

/* Results cards: slimmer side padding so the labels fit on one line, five across */
.result-cards .card-body {
	padding-left: 0.375rem;
	padding-right: 0.375rem;
}

.table.table-striped.table-sm * {
	font-size: 92%;
}

/* Card Headers */
.card-header {
	font-size: 1.25rem;
	background: none;
	font-weight: 500;
	border-bottom: none;
	padding-top: 1.3rem;
	color: darkslategrey;
	letter-spacing: -0.03rem;
}

#pageIndicator {
	font-size: 0.85rem;
}

/* Override for dark mode */
:root[data-bs-theme="dark"] .card-header {
	color: lightgray;
}

/* On mobile, reduce card header font size */
@media (max-width: 768px) {
	.card-header {
		font-size: 1.125rem;
	}
}

/* Traffic Light Classes for Longevity (based on raw longevity in years) */
.longevity-low {
	background: linear-gradient(135deg, #dc3545 0%, #b52b3a 100%);
	color: #fff !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border: none;
}

.longevity-mid {
	background: linear-gradient(135deg, #fd7e14 0%, #f76707 100%);
	color: #fff !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border: none;
}

.longevity-high {
	background: linear-gradient(135deg, #198754 0%, #157347 100%);
	color: #fff !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border: none;
}

/* Card Gradients */
.card-stats-gradient {
	background: linear-gradient(135deg,rgba(0, 0, 0, 0.02) 0%,rgba(0, 0, 0, 0.06) 100%);
	color: var(--bs-body-color);
	border: 1px solid rgba(255, 255, 255, 1);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Override for dark mode */
:root[data-bs-theme="dark"] .card-stats-gradient {
	background: linear-gradient(135deg,rgba(255, 255, 255, 0.05) 0%,rgba(255, 255, 255, 0.1) 100%);
	border: 1px solid rgba(255, 255, 255, 0.15);
	box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

.card-withdrawn-gradient {
	background: linear-gradient(135deg, #6c757d 0%, #343a40 100%);
	color: #fff;
	border: none;
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

:root[data-bs-theme="dark"] .card-withdrawn-gradient {
	background: linear-gradient(135deg, #495057 0%, #212529 100%);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.15);
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Donate Button */
.donate-button {
	position: fixed;
	top: 82px;
	right: 0;
	border-top-left-radius: 8px;
	border-bottom-left-radius: 8px;
	box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.3);
	z-index: 1050;
	padding: 8px 12px;
	background-color: #ffc107;
	color: #000;
	font-weight: bold;
	text-decoration: none;
}

.donate-button:hover {
	background-color: #e0a800;
	color: #000;
	cursor: pointer;
}

/* Donate Button on mobile */
@media (max-width: 768px) {
	.donate-button {
		top: auto;
		bottom: 30px;
		right: 0;
	}
}

/* Reset Link */
.reset-link {
	font-size: 0.9rem;
	text-align: center;
	display: block;
	margin-top: 8px;
}

/* Navbar Toggler */
.navbar-toggler-icon {
	width: 1em;
	height: 1em;
}

.navbar-toggler {
	padding: 0.25rem 0.5rem;
}

/* Horizontal lines in menu when on mobile */
@media (max-width: 991px) {
	.navbar-nav .nav-item + .nav-item {
		border-top: 1px solid #dee2e6;
		margin-top: 0.5rem;
		padding-top: 0.5rem;
	}
}

/* Chart Container */
.chart-container {
	position: relative;
	width: 100%;
}

/* Table Headers - Sticky */
.table-responsive table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
}

/**
 * Safari Sticky Header Workaround
 * This CSS block covers a sub-pixel gap that appears in Safari above sticky table headers.
 */
#detailsTable {
	position: relative;
}

#detailsTable::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	right: 0;
	height: 2px;
	background-color: #fff;
	z-index: 100;
}

[data-bs-theme="dark"] #detailsTable::before {
	background-color: #212529;
}

/* Yearly View - Scrollable Container */
#detailsTable.yearly .table-responsive {
	max-height: 446px;
	overflow-y: auto;
	padding-bottom: 10px;
}

#detailsTable.yearly .table-responsive::after {
	content: "";
	position: absolute;
	bottom: 8px;
	left: 0;
	right: 0;
	height: 60px;
	background: linear-gradient(transparent, rgba(255,255,255,1));
	pointer-events: none;
	z-index: 1;
}

#detailsTable {
	padding-bottom: 0.85rem;
}

/* Monthly View - Remove Extra Padding */
#detailsTable:not(.yearly) .table-responsive {
	padding-bottom: 0;
}

[data-bs-theme="dark"] #detailsTable.yearly .table-responsive::after {
	background: linear-gradient(transparent, rgba(33,37,41,1));
}

/* Spend less in downturns: "lean" tag in the breakdown table */
.lean-badge { font-size: 0.7em; vertical-align: middle; }
