/**
 * Savings Calculator Block Styles
 * Matching purple/lavender design from mockup
 */

.block--savings-calculator {
	padding: 3rem 0;
}

/* Utility Classes */
.hidden {
	display: none !important;
}

.calculator-container {
	max-width: 1140px;
	margin: 0 auto;
	padding-left: calc(1.5rem * .5);
    padding-right: calc(1.5rem * .5);
}

/* Calculator Header Section */
.calculator-header {
/* 	max-width: 800px; */
	margin: 0 auto 3rem auto;
	text-align: center;
}

.calculator-heading {
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.2;
	color: #1E0A3C;
	margin-bottom: 1rem;
}

.calculator-description {
/* 	font-size: 1.125rem;
	line-height: 1.6;
	color: #555; */
}

.calculator-description p {
	margin-bottom: 0.75rem;
}

.calculator-description p:last-child {
	margin-bottom: 0;
}

@media (max-width: 991px) {
	.calculator-header {
		margin-bottom: 2rem;
	}
	
	.calculator-heading {
		font-size: 2rem;
	}
	
	.calculator-description {
		font-size: 1rem;
	}
}

.calculator-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	align-items: start;
}

@media (min-width: 992px) {
	.calculator-row {
		grid-template-columns: 350px 1fr;
	}
}

/* Input Panel - Light Purple */
.calculator-input-panel {
	background: #ECE9FF;
	border-radius: 12px;
	padding: 2.5rem 2rem;
}

.calculator-title {
	font-size: 1.5rem;
	font-weight: 400;
	color: #23004B;
	margin: 0 0 2rem 0;
	font-family: "Avenir LT Pro Regular", sans-serif;
}

.calculator-container .input-group {
	margin-bottom: 1.5rem;
}

.calculator-container .input-label {
	display: block;
	font-size: 1rem;
	color: #23004B;
	margin-bottom: 0.5rem;
	font-weight: 500;
}

.subscribers-input {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 2px solid #D0C9E0;
	border-radius: 8px !important;
	font-size: 1rem;
	background: #ffffff;
	color: #23004B;
	transition: all 0.3s ease;
}

.subscribers-input:focus {
	outline: none;
	border-color: #4D5FFF;
	box-shadow: 0 0 0 3px rgba(77, 95, 255, 0.1);
}

.subscribers-input::placeholder {
	color: #9B95A8;
}

.calculate-btn {
	width: 100%;
	padding: 0.875rem 1.5rem;
	background: #4D5FFF;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
	
}

.calculate-btn:hover {
	background: #3D4FEF;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(77, 95, 255, 0.3);
}

.calculate-btn:active {
	transform: translateY(0);
}

.calculate-btn:disabled {
	background: #9B95A8;
	cursor: not-allowed;
	transform: none;
}

/* Results Panel - Dark Purple */
.calculator-results-panel {
	background: #23004B;
	border-radius: 12px;
	padding: 2.5rem 2rem;
	color: #ffffff;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	height: 100%;;
	position:relative;
}

.calculator-results-panel.results-updated {
	animation: pulseGlow 1s ease;
}

@keyframes pulseGlow {
	0%, 100% {
		box-shadow: 0 0 0 rgba(77, 95, 255, 0);
		transform: scale(1);
	}
	50% {
		box-shadow: 0 0 20px rgba(77, 95, 255, 0.4);
		transform: scale(1.01);
	}
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.results-heading-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap:wrap-reverse;
	row-gap: 1.5rem;
}
.results-heading-row .btn-wrapper{
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}
.results-heading-row .btn-wrapper a { 
	margin-left: 10px;
	white-space: nowrap;
}

.results-summary {
	margin-bottom: 1.5rem;
}

.result-item {
	margin-bottom: 1.5rem;
}

.result-item:last-child {
	margin-bottom: 0;
}

.result-item label {
	display: flex;
	align-items: center;
	/* font-size: 0.875rem; */
	color: #828CE1;
	margin-bottom: 0.5rem;
	font-weight: 400;
	font-size: 24px;
	font-style: normal;
	font-weight: 500;
	line-height: 38px;
	font-family: "Avenir LT Pro Regular", sans-serif;
	
}

.result-item label {
	position: relative;
	display: inline-flex;
}

/* Remove bullet dot for labels without tooltips */
.result-item label::after {
	content: '●';
	margin-left: 0.5rem;
	font-size: 0;
	color: rgba(255, 255, 255, 0.5);
}

.tooltip-trigger {
	flex-shrink:0;
}
/* Remove bullet dot when label has a tooltip */
.result-item label:has(.tooltip-trigger)::after {
	content: none;
}

/* Tooltip Styles */
.tooltip-trigger {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 0.5rem;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.6);
	transition: color 0.2s ease;
}

.tooltip-trigger:hover {
	color: rgba(255, 255, 255, 1);
}

.tooltip-trigger svg {
	width: 16px;
	height: 16px;
}
.procedures-table .tooltip-trigger {
	position:absolute;
	top:5px;
	margin-left: 0;
	right:5px;
}
/* table .tooltip-trigger {
	position:absolute;
	top:3px;
	margin-left: 0;
	right:2px;
} */

.tooltip-content {
	position: absolute;
	top: 50%;
	left: calc(100% + 0.75rem);
	transform: translateY(-50%);
	padding: 1rem 1.25rem;
	background: #f8f9fa;
	color: #2c3e50;
	border-radius: 10px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
	min-width: 220px;
	max-width: 320px;
	z-index: 1000;
	font-size: 0.8125rem;
	line-height: 1.5;
	animation: tooltipFadeIn 0.2s ease;
	min-height: fit-content;
	text-align: left;
}

.tooltip-content.active {
	display: block !important;
}

@keyframes tooltipFadeIn {
	from {
		opacity: 0;
		transform: translateY(-50%) translateX(-5px);
	}
	to {
		opacity: 1;
		transform: translateY(-50%) translateX(0);
	}
}

.tooltip-content p {
	margin: 0 0 0.5rem 0;
	color: #2c3e50;
}

.tooltip-content p:first-child {
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.tooltip-content p:last-child {
	margin-bottom: 0;
}

.tooltip-content strong {
	color: #2c3e50;
	font-weight: 600;
}

.tooltip-content ul,
.tooltip-content ol {
	margin: 0.5rem 0;
	padding-left: 1.5rem;
}

.tooltip-content li {
	margin-bottom: 0.25rem;
}

/* Tooltip arrow - points LEFT by default */
.tooltip-content::before {
	content: '';
	position: absolute;
	top: 50%;
	right: 100%;
	margin-top: -8px;
	width: 0;
	height: 0;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-right: 8px solid #f8f9fa;
}

/* Header cell tooltips - position above */
.header-cell .tooltip-content {
	top: auto;
	bottom: calc(100% - 0.25rem);
	left: 50%;
	transform: translateX(-50%);
	min-width: 200px;
	max-width: 280px;
}

.header-cell .tooltip-content::before {
	top: 100%;
	right: auto;
	left: 50%;
	margin-left: -8px;
	margin-top: 0;
	border-top: 8px solid #f8f9fa;
	border-right: 8px solid transparent;
	border-bottom: none;
	border-left: 8px solid transparent;
}

.header-cell .tooltip-content.active {
	animation: tooltipFadeInDown 0.2s ease;
}

@keyframes tooltipFadeInDown {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(5px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

/* Tooltip flip positioning classes for viewport bounds */
.tooltip-content.flip-left {
	left: auto;
	right: calc(100% + 0.75rem);
}

.tooltip-content.flip-left::before {
	right: auto;
	left: 100%;
	border-right: none;
	border-left: 8px solid #f8f9fa;
}

.tooltip-content.flip-up {
	top: auto;
	bottom: 50%;
	transform: translateY(50%);
}

.tooltip-content.flip-down {
	top: 50%;
	bottom: auto;
}

@media (max-width: 791px) {
	.tooltip-content {
		top: auto;
		bottom: 100%;
		left: 50%;
		margin-bottom: 0.75rem;
		transform: translateX(-50%);
		min-width: 260px;
	}
	
	/* Mobile: arrow points down */
	.tooltip-content::before {
		top: 100%;
		right: auto;
		left: 50%;
		margin-left: -8px;
		margin-top: 0;
		border-top: 8px solid #f8f9fa;
		border-right: 8px solid transparent;
		border-bottom: none;
		border-left: 8px solid transparent;
	}
	
	
	@keyframes tooltipFadeIn {
		from {
			opacity: 0;
			transform: translateX(-50%) translateY(5px);
		}
		to {
			opacity: 1;
			transform: translateX(-50%) translateY(0);
		}
	}
}

@media (max-width: 551px) {

	.result-item label {
		display: flex;;
	}
}

.result-value {
	font-size: 1.75rem;
	font-weight: 700;
	color: #ffffff;
	animation: countUp 0.8s ease;
}

@keyframes countUp {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.calc-disclaimer {
	margin-top: 1rem;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.7);
}
/* Procedures Table */
.procedures-table-wrapper {
	margin-top: 1.5rem;
	overflow: visible;
}

.procedures-table {
	width: 100%;
	font-size: 1rem;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-radius: 8px;
	overflow: visible;
}

/* Header Row */
.procedures-header {
	display: flex;
/* 	background: rgba(255, 255, 255, 0.05); */
	border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    margin-right: 8px;
    margin-left: 8px;
}

.procedures-header .cell {
	padding: 1rem;
	font-weight: 600;
	color: #ffffff;
	position: relative;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
	display: flex;
	align-items: center;
/* 	justify-content: flex-end; */
}

/* Data Rows */
.procedures-row {
	display: flex;
	border-bottom: 1px solid rgba(255, 255, 255, 0.5);
	transition: background 0.2s ease;
    margin-right: 8px;
    margin-left: 8px;
}

.procedures-row:last-child {
	border-bottom: none;
}

.procedures-row:hover {
	background: rgba(255, 255, 255, 0.03);
}

.procedures-row .cell {
	padding: 0.875rem 1rem;
	color: rgba(255, 255, 255, 0.9);
}

/* Column width distribution */
.cell:nth-child(1) {
	flex: 0 0 25%;
	text-align: left;
}

.cell:nth-child(2),
.cell:nth-child(3),
.cell:nth-child(4) {
	flex: 0 0 25%;
	text-align: left;
}


/* Loading State */
.calculate-btn.loading-ogk {
	position: relative;
	color: transparent;
}

.calculate-btn.loading-ogk::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	top: 50%;
	left: 50%;
	margin-left: -10px;
	margin-top: -10px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: spinner 0.6s linear infinite;
}

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

/* Error State */
.input-error {
	border-color: #ff4d4d !important;
}

.error-message {
	color: #ff4d4d;
	font-size: 0.75rem;
	margin-top: 0.5rem;
	display: none;
}

.error-message.show {
	display: block;
	animation: shake 0.3s ease;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
	.block--savings-calculator {
		padding: 2rem 0;
	}

	.calculator-input-panel,
	.calculator-results-panel {
		padding: 2rem 1.5rem;
	}

	.calculator-title {
		font-size: 1.25rem;
	}

	.result-value {
		font-size: 1.5rem;
	}

	.procedures-table {
		font-size: 0.875rem;
	}

	.procedures-table th,
	.procedures-table td {
		padding: 0.75rem;
	}

	

}

@media (max-width: 650px) {
    .procedures-table th, .procedures-table td {
        padding: 0.75rem 0.5rem;
    }
	.procedures-table {
		font-size: 0.825rem;
	}
	.results-heading-row .btn-wrapper.dsktp{
		display: none;
	}
	.btn-wrapper.mobl{
		display: flex!important;
		justify-content: center;
		width: 100%;
	}
	.btn-wrapper.mobl a{
		width: 100%; 
	}  
}
/* Print Styles */
@media print {
	.calculator-input-panel {
		display: none;
	}

	.calculator-results-panel {
		background: #ffffff;
		color: #000000;
		border: 2px solid #23004B;
	}

	.result-item label,
	.procedures-header .cell,
	.procedures-row .cell {
		color: #000000;
	}
}
