/*
* Temperature Unit Converter
* Converts between Celsius and Fahrenheit with a sleek glassmorphism design.
* Author: Aditya Chauhan
* Website: https://cloudxtech.io/
*/



/* ===== Page layout & animated background ===== */
:root {
  --card-bg: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: #dbe7ff;
  --field-bg: rgba(255, 255, 255, 0.14);
  --field-border: rgba(255, 255, 255, 0.28);
  --focus: #a7f3d0;
}
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0ea5e9, #a78bfa, #f472b6, #22c55e, #0ea5e9);
  background-size: 400% 400%;
  animation: bgShift 20s ease-in-out infinite;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Inter,
    Arial,
    sans-serif;
  color: var(--text);
}
@keyframes bgShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== Card ===== */
.card {
  width: min(92vw, 680px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px) saturate(140%);
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.45);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.title {
  font-weight: 900;
  letter-spacing: 0.4px;
  font-size: clamp(18px, 3vw, 28px);
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  opacity: 0.95;
}

/* ===== Fields ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr 54px 1fr;
  gap: 12px;
  align-items: center;
}

.field {
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 16px;
  padding: 14px 16px;
}
.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  font-size: 12px;
}

.input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: 0.5px;
}
.input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
.input:focus {
  outline: none;
}

/* Swap button */
.swap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.swap button {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  transition:
    transform 0.12s ease,
    filter 0.25s ease,
    background 0.25s ease;
}
.swap button:hover {
  filter: brightness(1.1);
}
.swap button:active {
  transform: rotate(180deg);
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 10px;
}
