
#date {
  font-size: 1.2em;
  color: #f0dde2;
  text-shadow: 0 1 10px #685b5b;
  margin-bottom: 10px;
}
.header {
  display: flex;
  justify-content: space-between; /* h2 left, controls right */
  align-items: center;
  margin-bottom: 20px;
}

.right-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #00ffff;
  font-size: 1.5em;
}

/* Toggle Switch Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 25px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 19px;
  width: 19px;
  left: 3px;
  bottom: 3px;
  background-color: rgb(205, 249, 255);
  border-radius: 50%;
  transition: 0.4s;
}

/* When checked */
.switch input:checked + .slider {
  background-color: #00ff88;
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}


@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #e4b7cd;
  --ink-deep: #643f51;
  --panel: #39518b;
  --panel-light: #1b253d;
  --panel-border: #263453;

  --amber: #ffb020;
  --amber-dim: #7a5a1c;
  --teal: #2dd4bf;
  --teal-dim: #145f57;

  --paper: #f1ede4;
  --muted: #7c88a6;
  --muted-dim: #4b5675;

  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  box-sizing: border-box;
}

body{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background:
    radial-gradient(circle at top left,#7f5af0 0%,transparent 35%),
    radial-gradient(circle at bottom right,#00d4ff 0%,transparent 35%),
    linear-gradient(135deg,#0f172a,#111827,#1e293b);
    overflow:hidden;
    position:relative;
}

/* Animated background blobs */

body::before,
body::after{
    content:"";
    position:absolute;
    width:450px;
    height:450px;
    border-radius:50%;
    filter:blur(120px);
    opacity:.35;
    animation:float 12s ease-in-out infinite;
}

body::before{
    background:#8b5cf6;
    top:-180px;
    left:-120px;
}

body::after{
    background:#06b6d4;
    bottom:-180px;
    right:-120px;
    animation-delay:4s;
}

@keyframes float{

0%,100%{
transform:translateY(0px) translateX(0px);
}

50%{
transform:translateY(40px) translateX(25px);
}

}
/* ---------- Card ---------- */

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--ink-deep) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 34px 30px 30px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: rise 0.7s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.container h2 {
  margin: 0 0 26px;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 10px;
}

.container h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px 2px rgba(45, 212, 191, 0.7);
  animation: blink 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- Amount inputs row ---------- */

.inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.amount p,
.value p {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.amount input,
.value input {
  width: 100%;
  padding: 14px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--paper);
  background: var(--panel-light);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  outline: none;
  position: relative;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.amount input::placeholder,
.value input::placeholder {
  color: var(--muted-dim);
}

.amount input:hover {
  border-color: var(--teal-dim);
}

.amount input:focus {
  border-color: var(--teal);
  background: #202c48;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

/* converted amount reads like an LED exchange-board readout */
.value input {
  color: var(--amber);
  background: #1a1408;
  border-color: var(--amber-dim);
  text-shadow: 0 0 12px rgba(255, 176, 32, 0.55);
  letter-spacing: 0.03em;
  cursor: default;
}

/* ---------- From / To dropdown row ---------- */

.dropdown {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
}

.from p,
.to p {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1; 
  min-width: 0; /* Prevents flex items from pushing beyond parent boundaries */
}

.select-container {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--panel-light);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  transition: border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.select-container select {
  width: 100%;
  font-size: 0.85rem; /* Reduced font size slightly so full text fits better */
  padding: 4px 6px;   /* Compact padding */
  outline: none;
  border: none;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Truncates text with '...' if it ever overflows */
  cursor: pointer;
}
.select-container:hover {
  border-color: var(--teal-dim);
  transform: translateY(-1px);
}

.select-container img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--ink-deep), 0 0 0 3px var(--panel-border);
  flex-shrink: 0;
}

.select-container select {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--paper);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.select-container select option {
  background: var(--panel);
  color: var(--paper);
}

/* swap icon — flips like a departure-board flap when hovered */
.swap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel-light);
  border: 1px solid var(--panel-border);
  color: var(--teal);
  margin-bottom: 2px;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.swap-icon i {
  transition: transform 0.5s var(--ease);
}

.swap-icon:hover {
  border-color: var(--teal);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.35);
}

.swap-icon:hover i {
  transform: rotate(180deg);
}

.swap-icon:active i {
  transform: rotate(360deg);
}

/* ---------- Rate message ---------- */

.msg {
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--amber);
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 176, 32, 0.08);
  border: 1px dashed var(--amber-dim);
  text-shadow: 0 0 10px rgba(255, 176, 32, 0.4);
  animation: flicker-in 0.9s ease-out 0.3s both;
}

@keyframes flicker-in {
  0% { opacity: 0; }
  8% { opacity: 0.6; }
  12% { opacity: 0.1; }
  20% { opacity: 0.8; }
  28% { opacity: 0.2; }
  40% { opacity: 1; }
  100% { opacity: 1; }
}

/* ---------- Submit button ---------- */

button[type="submit"] {
  position: relative;
  overflow: hidden;
  padding: 15px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--teal) 0%, #22b8a3 100%);
  color: var(--ink-deep);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

button[type="submit"]::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(45, 212, 191, 0.55);
}

button[type="submit"]:hover::after {
  left: 130%;
}

button[type="submit"]:active {
  transform: translateY(0);
}

button[type="submit"]:focus-visible,
.amount input:focus-visible,
.select-container select:focus-visible,
.swap-icon:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */

@media (max-width: 420px) {
  .container {
    padding: 26px 20px 22px;
  }

  .inputs-row {
    grid-template-columns: 1fr;
  }

  .dropdown {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .swap-icon {
    justify-self: center;
    transform: rotate(90deg);
    margin: 4px 0;
  }

  .swap-icon:hover i {
    transform: rotate(90deg);
  }
}