/* --- CSS Variables and Global Styles --- */
:root {
	--bg-color: #e2e8f0; 
	--card-color: #ffffff; 
	--border-color: #ccc;
	--input-bg-color: #ecf0f1; 
	--text-color-light: #d1d5db; 
	--text-color-dark: #002554;
	--text-color-white: #ffffff;
	--accent-color: #B9975b; 
	--accent-color-hover: #001a3b; 
	--accent-text-color: #5eead4; 
	--font-family-sans: "Inter", sans-serif;
	--font-family-mono: "Inter", sans-serif;
}


/* --- Base Body Styles --- */
body {
	font-family: var(--font-family-sans);
	background-color:  rgba(255, 255, 255, 0.7);  /* White at 70% opacity */
	color: var(--primary);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	margin: 0 auto;
}

/* --- Scrollbar Styles --- */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}
::-webkit-scrollbar-track {
	background: #2d3748;
}
::-webkit-scrollbar-thumb {
	background: #4a5568;
	border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
	background: #718096;
}

/* --- Main Layout & Container --- */
.container {
	max-width: 80rem; /* 1280px */
	/* margin-left: auto; */
	margin: 0 auto;
	padding: 20px;
}

/* --- Header Styles --- */
.header {
	margin-bottom: 2rem;
	background: var(--primary);
    padding: 13px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
	color: var(--white);
	border-top-left-radius: 0px;
    border-top-right-radius: 0px;
	/* display: flex;
	justify-content: center;
	align-items: center; */
}

.header .dividend-icon img {
	width: 30px;
	height: 30px;
	margin-right: 12px;
	margin-top: 2px;
}

.header h1 {
	font-size: 28px; /* 30px */
	line-height: 115%; /* 36px */
	font-weight: 500;
	color: var(--white);
	position: relative;
	margin: 0 0 10px 0;
}

h1 {
	margin-bottom: 0px 0px 10px 0px;
}

.header h1 span {
	color: #fff;
}
.header p {
	/* padding-bottom: 10px; */
	font-size: 18px; /* 18px */
	color: var(--white);
	margin: 0;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	line-height: 150%;
}

/* --- Grid Layout for Main Content --- */
.main-grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 2rem;
	align-items: start; /* This prevents cards from stretching to same height */
}

/* --- Card Styles --- */
.card {
	background-color: var(--card-color);
	padding: 1.5rem;
	border-radius: 0px 0 0px 0px; /* 16px */
	/* box-shadow: 
			  0 20px 25px -5px rgba(0, 0, 0, 0.06),  
			  0 10px 10px -5px rgba(0, 0, 0, 0.04),  
			  0 -10px 15px -5px rgba(0, 0, 0, 0.04);  */
	border: 1px solid var(--lines);
}

/* Calculator Card - Fixed Height */
.calculator-card {
	height: fit-content; /* Natural height based on content */
	align-self: start; /* Prevents stretching with other cards */
}

.history-card {
	background-color: rgba(255, 255, 255, 0.7);
	height: auto; /* Allow to grow with content */
}

.card-title {
	font-size: 20px; /* 24px */
	font-weight: 500;
	color: var(--primary);
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
}
.card-title svg {
	width: 1.5rem;
	height: 1.5rem;
	margin-right: 0.75rem;
	color: var(--primary);
}

/* --- Form Styles --- */
.form-group {
	margin-bottom: 1.5rem;
}
.form-label {
	display: block;
	font-size: 18px; /* 14px */
	font-weight: 500;
	color: var(--primary);
	margin-bottom: 0.5rem;
}
.form-input, .form-select {
	width: 100%;
	background-color: #ffffff;
	border: 1px solid var(--lines);
	color: var(--primary);
	border-radius: 5px; 
	padding: 10px 16px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	font-family: var(--font);
	font-size: 16px;
}

.form-select:focus-visible {
	outline: none;
}

.form-select {
	appearance: none;
	background-image: url('images/down-arrow-black.svg');
	background-repeat: no-repeat;
	background-size: 18px;
	background-position: right 11px center;
	padding-right: 36px;
}

/* .form-input:focus, .form-select:focus {
	border-color: var(--accent-color);
	box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.5);
} */

/* --- Button Styles --- */

.button-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    /* background-color: var(--white); */
    border-bottom: var(--button-border);
    padding: 12px 6px 12px 0px; 
    min-width: 180px;    /* Keeps button size consistent */
    overflow: hidden;
    cursor: pointer;
    color: var(--primary)
}

/* Make the actual input invisible but fill the whole container */
.btn-Go {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 10; /* Sits on top to capture clicks */
    cursor: pointer;
	color: var(--primary);
}

.btn-content {
    display: flex;
    align-items: center;
    width: 100%;
    pointer-events: none; /* Let clicks pass through to the input */
}

.btn-text {
    color: var(--primary);
    font-family: var(--font);
    font-weight: 500;
    flex-shrink: 0;
}

.btn-icon {
    width: 20px;
    height: auto;
    flex-shrink: 0;
    margin-left: auto; /* Pushes icon to the right side */
    /* Starts 5px away from the right edge */
    transform: translateX(-5px); 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Hover States --- */

.button-container:hover .btn-icon {
    /* Moves the icon the last 5px to the absolute edge */
    transform: translateX(5px); 
}

.download-button:hover .download-btn-icon {
    /* Moves the icon the last 5px to the absolute edge */
    transform: translateY(6px); 
}

.button-container:hover .progress-line {
    width: 100%;
}

.download-button:hover .progress-line {
    width: 100%;
}

/* --- Progress Bar --- */
.progress-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--button-border-small);
    transition: width 0.4s ease;
    z-index: 5;
}


.button {
    width: 100%;
}
/* .button {
	width: 100%;
	background-color: var(--text-color-dark);
	color: var(--card-color);
	font-weight: 500;
	padding: 10px 36px 10px 16px;
	border: none;
	border-radius: 6px; 
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	cursor: pointer;
	transform: scale(1);
	transition: background-color 0.3s, transform 0.3s;
	font-family: 'arial-mt-std', Arial, Helvetica, sans-serif;
	font-size: 14px;
	text-align: left;
	display: inline-block;
	align-items: center;
	justify-content: center;
    overflow: hidden;
    position: relative;
} */

/* .button::before {
	position: absolute;
	content: '';
	background-image: url('right-arrow-white.svg');
	background-repeat: no-repeat;
	width: 20px;
	height: 20px;
	right: 11px;
	top: 8px;
}

.button:hover {
    background-color: rgb(174 174 174 / 30%);
    backdrop-filter: blur(12px);
    border: 1px solid #000;
    color: #000;
    text-decoration: none;
    transition: all .8s ease;
	color: transparent;
}

.button:hover::before {
    background-image: url('right-arrow-black.svg');
    transition: all .8s ease;
    right: 2px;
    width: 25px;
    height: 25px;
}

.button:hover::after {
    transform: translate(1%);
    top: 28%;
    transition: all .8s ease;
} 

.button::after {
    content: attr(data-hover);
    position: absolute;
    left: 15px;
    right: 40px;
    text-align: left;
    color: #000;
    transform: translateY(140%);
    transition: transform .8s ease;
    white-space: nowrap;
    font-weight: 100;
} */

/* .button:hover {
	background-color: var(--accent-color-hover);
	transform: scale(1.05);
} */



/* --- Result Display Styles --- */
.result-display {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 0px solid var(--border-color);
	text-align: center;
}
.result-display .label {
	font-size: 16px; /* 14px */
	color: var(--primary);
}
.result-display .amount {
	font-size: 1.875rem; /* 30px */
	font-weight: 700;
	color: var(--primary);
	margin-top: 0.5rem;
}

/* --- Div-based Table Styles --- */
.table-wrapper {
	overflow-x: auto;
}
.data-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	width: 100%;
	text-align: left;
	white-space: wrap;
}

.data-grid-row div {
	border-right: 1px solid #fff;
	/* height: 32px; */
  }

  .data-grid-header div {
	border-right: 1px solid #fff;
	/* height: 32px; */
  }
  
  /* Remove the line from the last column */
  .grid-item:nth-child(3n) {
	border-right: none;
  }
.data-grid-header {
	display: contents;
}
.data-grid-header > div {
	font-size: 16px; /* 12px */
	color: var(--white);
	padding: 16px 16px;
	/* border-bottom: 2px solid #b42025; */
	font-weight: 600;
	background-color: var(--primary);
}
.data-grid-body {
	display: contents;
}
.data-grid-row {
	display: contents;
}
.data-grid-row > div {
	padding: 16px;
	border-bottom: 0px solid #ccc;
	transition: background-color 0.2s;
	display: flex;
	align-items: center;
}

.data-grid-row:nth-child(even) > div {
	background-color: var(--primarylighter);
}

.data-grid-row:last-child > div {
	border-bottom: none;
}
.text-right {
	text-align: left;
	/* justify-content: flex-end; */
}
.font-mono {
	font-family: var(--font-family-mono);
}
.font-semibold {
	color: var(--primary);
}
.text-accent {
	color: var(--primary);
}
.text-light {
	color: #000;
}
.text-dark {
	color: var(--primary);
}

/* --- Card Footer --- */
.card-footer {
    text-align: right;
    margin-top: 15px; /* 32px */
    font-size: 12px; /* 12px */
    color: var(--color-text-subtle);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.poweredby img {
    height: 10px;
}

/* --- Responsive Design --- */
@media (min-width: 768px) { /* md breakpoint */
	/* .container {
		padding: 0rem 2rem;
	} */
	/* .header {
		margin-bottom: 1rem;
	} */
	.header h1 {
		font-size: 28px; 
	}
	
	/* Desktop hover effects */
	.data-grid-row:hover > div {
		/* background-color: rgba(55, 65, 81, 0.5);  */
	}

	.button:hover::after {
		transform: translate(0%);
		top: 28%;
		transition: all .8s ease;
	} 
	
	.button::after {
		content: attr(data-hover);
		position: absolute;
		left: 16px;
		right: 40px;
		text-align: left;
		color: #000;
		transform: translateY(140%);
		transition: transform .8s ease;
		white-space: nowrap;
		font-weight: 100;
	}
}

@media (max-width: 751px) {
	.button:hover::after {
		transform: translate(0%);
		top: 28%;
		transition: all .8s ease;
	} 
	
	.button::after {
		content: attr(data-hover);
		position: absolute;
		left: 16px;
		right: 40px;
		text-align: left;
		color: #000;
		transform: translateY(140%);
		transition: transform .8s ease;
		white-space: nowrap;
		font-weight: 100;
	}
}

@media (min-width: 1125px) { /* lg breakpoint */
	.main-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		align-items: start; /* Important: prevents stretching on desktop */
	}
	.calculator-card {
		grid-column: span 1 / span 1;
		height: fit-content;
		align-self: start;
		position: sticky;
		top: 2rem; /* Optional: makes it stick when scrolling */
	}
	.history-card {
		grid-column: span 3 / span 3;
		height: auto;
	}

	
}

/* Mobile responsive styles for the data grid */
@media (max-width: 878px) {
	.data-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
	.data-grid-header {
		display: none;
	}
	.data-grid-row {
		display: grid;
		grid-template-columns: 1fr;
		gap: 0.5rem;
		padding: 1rem;
		border-bottom: 0px solid var(--border-color);
		/* background-color: rgba(255, 255, 255, 0.9); */
	}
	.data-grid-row:nth-child(even) {
		background-color: var(--primarylighter);
	}
	.data-grid-row > div {
		border-bottom: none;
		padding: 0.25rem 0;
		display: flex;
		justify-content: space-between;
		color: var(--text-color-dark); /* Ensure text is visible on mobile */
	}
	.data-grid-row > div::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--text-color-dark);
	}
	.text-accent {
		color: #0d9488; /* More visible teal on mobile */
		
	}
	.text-light {
		color: #1f2937; /* Darker for better visibility */
		
	}
	.text-dark {
		color: #4b5563; /* Slightly darker for better visibility */
	}

	
}

@media (max-width: 425px) {
	.header h1 {
		font-size: 22px;
	}

	.header p {
		font-size: 16px;
	}

	.card-title {
		font-size: 18px;
	}

	.fomr-label {
		font-size: 16px;
	}
}
