/* Currency Converter
Developed by Muhammad Awais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #38bdf8;
  --success: #16a34a;
  --danger: #ef4444;
  --white: #ffffff;
  --black: #111827;
  --gray: #64748b;
  --border: #dbe4f0;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  --card-bg: rgba(255, 255, 255, 0.95);
  --body-bg: linear-gradient(135deg, #2563eb, #3b82f6, #38bdf8);
}
/* Dark Theme */
body.dark {
  --white: #0f172a;
  --black: #ffffff;
  --gray: #cbd5e1;
  --border: #334155;
  --card-bg: #172554;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --body-bg: linear-gradient(135deg, #020617, #0f172a, #1e293b);
}
/* Body */
body {
  font-family: "Poppins", sans-serif;
  background: var(--body-bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  overflow-x: hidden;
  transition: 0.4s;
}
/* Main Container */
.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 25px;
  padding: 30px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s;
}
/* Header */
.header {
  margin-bottom: 30px;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo i {
  font-size: 1.5rem;
}
.theme-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: 0.35s;
}
.theme-btn:hover {
  transform: rotate(180deg);
  background: var(--primary-dark);
}
.header h1 {
  color: var(--black);
  font-size: 2rem;
  margin-bottom: 10px;
}
.subtitle {
  color: var(--gray);
  line-height: 1.7;
  font-size: 0.95rem;
}
/* Form */
#currencyForm {
  margin-top: 30px;
}
.input-group {
  margin-bottom: 25px;
}
.input-group label {
  display: block;
  margin-bottom: 10px;
  color: var(--black);
  font-weight: 600;
}
.input-group input {
  width: 100%;
  height: 58px;
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 0 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: 0.3s;
  background: transparent;
  color: var(--black);
}
.input-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
/* Currency Area */
.currency-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 15px;
  margin-bottom: 30px;
}
.currency-box {
  flex: 1;
}
.currency-box label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--black);
}
.select-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 10px 12px;
  transition: 0.3s;
}
.select-box:hover {
  border-color: var(--primary);
}
.select-box img {
  width: 42px;
  border-radius: 5px;
  object-fit: cover;
}
.select-box select {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  color: var(--black);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
/* Swap Button */
.swap-btn {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: 0.35s;
  flex-shrink: 0;
}
.swap-btn:hover {
  transform: rotate(180deg);
  background: var(--primary-dark);
}
/* Convert Button */
.convert-btn {
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}
.convert-btn i {
  margin-right: 10px;
}
.convert-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.3);
}
.convert-btn:active {
  transform: scale(0.98);
}
/* Result Card */
.loading {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 25px 0;
  color: var(--primary);
  font-weight: 600;
}
.loading.show {
  display: flex;
}
.loading i {
  font-size: 1.2rem;
}
.result-card {
  margin-top: 30px;
  padding: 22px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  transition: 0.3s;
}
body.dark .result-card {
  background: rgba(255, 255, 255, 0.04);
}
.rate-box {
  text-align: center;
  margin-bottom: 25px;
}
.rate-box h3 {
  color: var(--gray);
  margin-bottom: 8px;
  font-size: 1rem;
}
#exchangeRate {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
}
.result-box {
  text-align: center;
  margin-bottom: 25px;
}
.result-box h3 {
  color: var(--gray);
  margin-bottom: 10px;
}
#result {
  color: var(--success);
  font-size: 2rem;
  font-weight: 700;
  word-break: break-word;
  animation: pulse 2s ease-in-out infinite;
}
.update-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  margin-bottom: 25px;
  font-size: 0.92rem;
}
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.action-buttons button {
  height: 52px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: 0.3s;
  font-family: inherit;
}
/* Copy Button */
#copyBtn {
  background: var(--success);
  color: #fff;
}
#copyBtn:hover {
  background: #15803d;
  transform: translateY(-2px);
}
/* Reset Button */
#resetBtn {
  background: #f59e0b;
  color: #fff;
}
#resetBtn:hover {
  background: #d97706;
  transform: translateY(-2px);
}
.action-buttons button i {
  margin-right: 8px;
}
/* footer */
footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
footer p {
  color: var(--gray);
  font-size: 0.9rem;
  margin: 4px 0;
}
footer strong {
  color: var(--primary);
}
/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 20px;
}
::-webkit-scrollbar-track {
  background: #e5e7eb;
}
/* Toast Notification */
.toast {
  position: fixed;
  top: 25px;
  right: 25px;
  min-width: 300px;
  max-width: 380px;
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transform: translateX(420px);
  opacity: 0;
  transition: 0.35s ease;
  z-index: 9999;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
/* Success */
.toast.success {
  background: #16a34a;
}
/* Error */
.toast.error {
  background: #dc2626;
}
/* Warning */
.toast.warning {
  background: #d97706;
}
/* Info */
.toast.info {
  background: #2563eb;
}
.toast i {
  font-size: 1.3rem;
}
/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
/* Responsive */
@media (max-width: 500px) {
  body {
    padding: 15px;
  }
  .container {
    width: 100%;
    max-width: 100%;
    padding: 22px;
    margin: 0 auto;
  }
  .header h1 {
    font-size: 1.7rem;
  }
  .currency-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .swap-btn {
    align-self: center;
    transform: rotate(90deg);
  }
  .swap-btn:hover {
    transform: rotate(270deg);
  }
  .action-buttons {
    grid-template-columns: 1fr;
  }
  #result {
    font-size: 1.6rem;
  }
  .toast {
    position: fixed;
    top: 15px;
    left: 15px;
    right: 15px;
    min-width: auto;
    max-width: calc(100% - 30px);
    padding: 14px 16px;
    font-size: 0.9rem;
  }
  .currency-box {
    width: 100%;
  }
  .select-box {
    width: 100%;
  }
}
@media (max-width: 380px) {
  .header h1 {
    font-size: 1.45rem;
  }
  .logo {
    font-size: 1rem;
  }
  .theme-btn {
    width: 45px;
    height: 45px;
  }
  .convert-btn {
    font-size: 0.92rem;
  }
}
/* End */
