/* style.css */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500;700&display=swap');

/* Main body styling */
/* Fade effect on body */
body {
  font-family: 'Montserrat', sans-serif;
  background-color: #fef1f4;
  margin: 0;
  padding: 1rem;
  /* line-height: 1.5; */
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

body.fade-out {
  opacity: 0;
}

/* Page title */
h1 {
  font-size: 2.6rem;
  color: #d6336c;
  /* margin-bottom: 1.0rem; */
  font-family: 'Dancing Script', cursive;
}

h2 {
  font-size: 2.0rem;
  color: #d6336c;
  /* margin-top: 1.5rem; */
  /* margin-bottom: 1rem; */
  /* font-weight: 600; */
  font-family: 'Dancing Script', cursive;
}

h3 {
  font-size: 1.6rem;
  color: #d6336c;
  margin-top: 1.2rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

p {
  font-size: 1.2rem;
  color: #d6336c;
  margin-bottom: 1rem;
  font-family: 'Dancing Script', cursive;
}

p.pages-text {
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-family: 'Montserrat', sans-serif;
  color: #777;
  text-align: left;
  line-height: 30px;
}

a {
  font-size: 1.0rem;
  color: #d6336c;
  font-family: 'Dancing Script', cursive;
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
  color: #ff4081; /* Change color on hover */
  text-decoration: underline; /* Add an underline on hover */
}

li {
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-family: 'Montserrat', sans-serif;
  color: #777;
  text-align: left;
  line-height: 30px;
}


/* Loading overlay and spinner */
#loadingOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#loadingOverlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #d6336c;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.9s linear infinite;
  }

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

/* Main content wrapper */
.container {
  /* width: 100%; */
  max-width: 600px;
  margin: 15px auto;
  padding: 1rem;
  text-align: center;
  background: #ffffff;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  position: relative;
}

/* Currency selector grid */
.currency-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Each currency card */
.currency-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fffafc;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: #d6336c;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, background-color 0.3s;
}

.currency-card:hover {
  transform: scale(1.05);
  background: #ffe4e6;
  text-decoration: none;
}

.currency-card img.flag {
	width: 32px;
	height: 20px;
	object-fit: contain;
	margin-bottom: 0.5rem;
}

.currency-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: #d6336c;
}

/* Flag emoji in currency card */
.flag {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
}

/* #convertedResults wrapper */
#convertedResults img {
  vertical-align: middle;
  margin-right: 4px;
}

#convertedResults {
  display: flex;
  justify-content: center;
  /* padding: 1.5rem 0; */
  overflow-x: auto;
}

/* desktop */
#convertedResults table {
  width: 100%;
  max-width: 480px;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0 auto;
  }

#convertedResults th,
#convertedResults td {
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

#convertedResults thead th {
  background-color: #ffe4e6;
  color: #d6336c;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: right;
}

/* select button */
#convertedResults td:nth-child(1),
#convertedResults th:nth-child(1) {
  width: 9%;
  text-align: left;
}
/* flag */
#convertedResults td:nth-child(2),
#convertedResults th:nth-child(2) {
  width: 8%;
  text-align: center;
}
/* ticker */
#convertedResults td:nth-child(3),
#convertedResults th:nth-child(3) {
  width: 12%;
  text-align: left;
}
/* graph button */
#convertedResults td:nth-child(4),
#convertedResults th:nth-child(4) {
  width: 9%;
  text-align: center;
}
/* result */
#convertedResults td:nth-child(5),
#convertedResults th:nth-child(5) {
  width: 28%;
  text-align: right;
  font-weight: bold;
  color: #d6336c;
}
/* copy button*/
#convertedResults td:nth-child(6),
#convertedResults th:nth-child(6) {
  width: 9%;
  text-align: right;
}
/* spacer */
#convertedResults td:nth-child(7),
#convertedResults th:nth-child(7) {
  width: 0%;
  text-align: right;
}

#convertedResults tbody tr {
  border-bottom: 1px solid #f8bbd0;
}

#convertedResults tbody tr:hover {
  background-color: #fff0f4;
}

/* Input wrapper for amount and buttons */
.input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

/* Amount input field */
.amount-input {
  width: 100%;
  max-width: 480px;
  min-width: 260px;
  text-align: center;
  font-size: 1.6rem;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid #f8bbd0;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
}

.amount-input:focus {
  outline: none;
  border-color: #d6336c;
  box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.2);
}

/* TOP Buttons like reset, home */
.modern-btn, .home-btn {
  /* font-size: 1rem; */
  padding: 0.75rem 1.5rem;
  background-color: #d6336c;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.15s ease;
  font-family: 'Montserrat', sans-serif;
  
  display: inline-flex; /* ← makes icon and text align in a row */
  align-items: center;  /* ← vertical center */
  /* gap: 0.5rem; */
}

.modern-btn:hover, .home-btn:hover {
  background-color: #a02550;
  transform: translateY(-1px);
}

.modern-btn:active, .home-btn:active {
  transform: scale(0.98);
}

.modern-btn svg {
  vertical-align: top;
}

button.close {
  position: fixed;
  top: 15px;
  right: 15px;
  /* bottom: 15px; */
  /* left: 15px; */
  font-size: 1.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #d6336c;
  transition: transform 0.3s ease, color 0.3s ease;
  z-index: 10;
}

button.close:hover {
  color: #a02550;
  transform: rotate(90deg) scale(1.2);
}
button.close:hover {
  /* transform: scale(1.1); <- remove this */
  color: #a02550;
}

/* Chart background overlay with fade transition */
#chartOverlay {
  visibility: hidden;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgb(255, 255, 255, 0.6);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.9s ease;
}

/* When chart is activated */
#chartOverlay.active {
  display: flex;
  visibility: visible;
  opacity: 1;
}

#chartPopup {
	background: #ffffff;
	padding: 1rem 1rem 1rem 1rem; /* ↓ reduced top padding */
	border-radius: 12px;
	max-width: 700px;
	width: 90%;
	max-height: none; /* ⬅ Remove max-height restriction */
	overflow-y: visible; /* Allow popup to grow */
	position: relative;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	transform: scale(0.95);
	opacity: 0;
	transition: transform 0.4s ease, opacity 0.4s ease;
	/* opacity: 1; */
	/* transform: none; */
	/* transition: none; */
}

/* Popup grow in and fade in */
#chartOverlay.active #chartPopup {
  transform: scale(1);
  opacity: 1;
}

/* #chartOverlay.active #rateChart { */
  /* transform: scale(1); */
  /* opacity: 1; */
/* } */

/* === Chart Canvas Animation === */
#rateChart {
  width: 100%;
  height: auto;
  max-height: 600px;
  margin-bottom: 0.5rem;
  /* transition: transform 0.6s ease, opacity 0.6s ease; */
  /* transform: scale(0.98); */
  /* opacity: 0; */
  transform: none;
  opacity: 1;
  transition: none;
}

/* Generic input/button font inheritance */
input, button {
  font-family: inherit;
}

/* Footer text */
footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #777;
  text-align: center;
}

/* Rate date below amount */
.rate-date {
  color: #d6336c;
  font-weight: 500;
}

/* For cleaned input preview text */
.cleaned-preview {
  margin-top: -0.5rem;
  font-size: 0.85rem;
  color: #888;
}

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #d6336c;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 10000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

#livePreview {
  display: none;
}

.select-btn {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  background-color: #e4e4e4;
  color: #333;
  font-size: 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.select-btn:hover {
  background-color: #ccc;
}

.currency-select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* background-color: #ffe4e6; */
  background-color: #ffffff;
  color: #d6336c;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 10px;
  width: 2.2rem;
  height: 2.2rem;
  text-decoration: none;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.currency-select-btn:hover {
  background-color: #ffffff;
  transform: scale(1.1);
}

.currency-select-btn:active {
  background-color: #ffffff;
  color: white;
  transform: scale(0.95);
}

/* .currency-select-btn svg { */
  /* width: 1.2em; */
  /* height: 1.2em; */
/* } */

.currency-symbol {
  font-size: 0.85em;
  color: #777;
  margin-left: 2px;
  font-weight: normal;
  opacity: 0.85;
}

.currency-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: #d6336c;
  display: inline;
}

/* Global show desktop version, hide mobile */
.desktop-only {
  display: inline-block;
}
.mobile-only {
  display: none;
}

/* Matches desktop reset/select styles */
.chart-btn, .copy-btn, .pick-btn {
  font-size: 1.0rem;
  padding: 0.4rem 0.4rem;
  background-color: #d6336c;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.3s, transform 0.2s;
  text-decoration: none;
  justify-content: center;
}

.chart-btn:hover, .copy-btn:hover, .pick-btn:hover {
  background-color: #fff0f4;
  transform: scale(1.08);
  color: #a02550;
}

.chart-btn:active, .copy-btn:active, .pick-btn:active {
  background-color: #d6336c;
  color: #fff;
  transform: scale(0.95);
}

.chart-btn, .copy-btn, .pick-btn svg {
  width: 1.4em;
  height: 1.4em;
}

.emoji-flag {
  font-size: 1.5rem;
  vertical-align: top;
}

.chart-ranges {
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.range-btn {
  background: #ffe4e6;
  border: 2px solid #d6336c;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-weight: bold;
  color: #d6336c;
  cursor: pointer;
  transition: background 0.3s;
}

.range-btn.active,
.range-btn:hover {
  background: #d6336c;
  color: white;
}

#calcPreview {
  /* position: absolute; */
  top: 12px;
  right: 16px;
  background: #fef1f4;
  padding: 3px;
  font-size: 0.65rem;
  color: #333;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 999;
  font-family: monospace;
  opacity: 0.9;
  max-width:600px;
  text-align: right;
}

.top-meta {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 0.85rem;
  color: #999;
  text-align: right;
}

.not-our-fault {
  text-align: justify;
  color: #555;
  font-size: 0.6rem;
  border-bottom: 1px solid #ddd;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background: #ffffff;
  position: relative;
}

.text-page {
  text-align: justify;
  color: #555;
  font-size: 0.6rem;
  border-bottom: 0px solid #ddd;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background: #ffffff;
  position: relative;
}

.site-footer {
  text-align: center;
  color: #555;
  font-size: 0.6rem;
  max-width: 600px;
  margin: 30px auto;
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  position: relative;
}

.site-footer .footer-links {
  margin-bottom: 0.5rem;
}

.site-footer .footer-links a {
  color: #444;
  text-decoration: none;
  margin: 0 0.75rem;
  font-weight: 500;
}

.site-footer .footer-links a:hover {
  text-decoration: underline;
}

.a2a-buttons {
	margin:0 auto; 
	width:600px;
	left:50px; 
	top:50px;
}

	@media (max-width: 480px) {
	  body {
		padding: 0;
	  }

	  .container {
		border-radius: 0;
		box-shadow: none;
		margin: 0px auto;
	  }
	  
	  .desktop-only {
		display: none;
	  }

	  .mobile-only {
		display: inline-flex;
	  }  

	  h1 {
		font-size: 2rem;
	  }

	  h2 {
		font-size: 1.4rem;
		margin-top: 1rem;
		margin-bottom: 0.8rem;
	  }

	  h3 {
		font-size: 1.3rem;
		color: #666;
		margin-top: 1.2rem;
		margin-bottom: 0.8rem;
		font-weight: 600;
	  }

	  p {
		font-size: 1rem;
		line-height: 1.5;
		margin-bottom: 0.8rem;
	  }


		.site-footer {
		text-align: center;
		color: #555;
		font-size: 0.6rem;
		border-top: 0px solid #ddd;
		max-width: 600px;
		margin: 0 auto;
		padding: 1rem;
		background: #ffffff;
		box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
		border-radius: 0;
		position: relative;
		}
		
	  .currency-picker {
		gap: 0.5rem;
	  }

	  .currency-card {
		font-size: 0.9rem;
		padding: 0.7rem;
	  }

	  .currency-symbol {
		font-size: 0.8rem;
		opacity: 0.6;
	  }

	  .amount-input {
		font-size: 1.4rem;
		padding: 0.8rem;
		width: 100%;
		max-width: 90%;
	  }

	  .modern-btn {
		font-size: 1.1rem;
		padding: 1rem;
		width: 100%;
	  }

	  #convertedResults table {
		width: 100%;
		font-size: 1.1rem;
	  }

	  #convertedResults th,
	  #convertedResults td {
		padding: 0.8rem 0.4rem;
		font-size: 1.1rem;
	  }

	  #chartPopup {
		max-height: none;
		height: auto;
		overflow-y: visible;
		padding: 1rem;
	  }

	  #rateChart {
		/* max-height: 480px; */
		max-height: 80%;
	  }

	  #chartOverlay.active #chartPopup {
		margin: 0 auto;
	  }

	  .chart-ranges {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.5rem;
		padding-bottom: 0.5rem;
		margin-top: 1rem;
	  }

		.range-btn {
		flex: 1 1 22%;
		min-width: 65px;
		text-align: center;
		box-sizing: border-box;

		background: #ffe4e6;
		border: 2px solid #d6336c;
		padding: 0.4rem 0.8rem;
		border-radius: 8px;
		font-weight: bold;
		color: #d6336c; /*text*/
		cursor: pointer;
		transition: background 0.3s;
		}
	  
		.range-btn.active,
		.range-btn:hover {
		background: #d6336c;
		color: white;
		}
		
		.swipe-active {
		flex: 1 1 22%;
		min-width: 65px;
		text-align: center;
		box-sizing: border-box;

		background: #ffe4e6;
		border: 2px solid #d6336c;
		padding: 0.4rem 0.8rem;
		border-radius: 8px;
		font-weight: bold;
		color: #d6336c; /*text*/
		cursor: pointer;
		transition: background 0.3s;
		}

		footer,
		.rate-date {
		font-size: 0.9rem;
		text-align: center;
		}
	  
	  /* Middle table buttons where are results */
	  .currency-select-btn, .copy-btn, .chart-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background-color: #ffffff;
		color: #d6336c;
		font-size: 1rem;
		font-weight: bold;
		width: 2.0rem;
		height: 2.0rem;
		text-decoration: none;
		transition: background-color 0.3s, transform 0.2s;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
		cursor: pointer;
		padding: 0;
	  }

	  .currency-select-btn:hover, .currency-select-btn:active,
	  .copy-btn:hover, .copy-btn:active,
	  .chart-btn:hover, .chart-btn:active{
		background-color: transparent;
		color: inherit;
		transform: none;
	  }

	  /* .currency-select-btn, .copy-btn, .chart-btn svg { */
		/* width: 1.5em; */
		/* height: 1.5em; */
	  /* } */

	  button.currency-select-btn {
		border: none;
		background: transparent;
	  }

	  .button-group {
		/* padding: 1.0em; */
		gap: 1.0rem;
		padding: 0 
	  }

	  .input-wrapper {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 1rem;
		margin-bottom: 0.6rem;
		padding: 0;
		width: 100%;
	  }

		#calcPreview {
		display: none;
		/* position: absolute; */
		top: 12px;
		right: 16px;
		background: #fef1f4;
		/* padding: 3px; */
		font-size: 0.6rem;
		color: #333;
		border-radius: 6px;
		box-shadow: 0 2px 6px rgba(0,0,0,0.1);
		z-index: 999;
		font-family: monospace;
		opacity: 0.9;
		max-width:600px;
		text-align: right;
		}
}
		/* Hide AddToAny vertical share bar when screen is less than 981 pixels wide */
		@media screen and (max-width: 980px) {
			.a2a_floating_style.a2a_vertical_style { display: none; }
			.a2a-buttons { display: none; }
		}