:root {
  --background: #1b1b1b;
  --surface: #282c37;
  --surface-hover: #323741;
  --primary: #4f85ff;
  --on-surface: #e0e0e0;
  --on-surface-secondary: #a0a0a0;
  --shadow: rgba(0, 0, 0, 0.2);
  --border-color: #444;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  width: 100%;
  height: 100vh;
  background-color: var(--background);
  color: var(--on-surface);
  font-family: 'Poppins', sans-serif;
}

main {
  height: 100%;
  display: flex;
  gap: 30px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.1);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.1);
}

.header {
  display: flex;
  gap: 10px;
  font-weight: 600;
}

.converter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
  max-width: 600px;
}

.inputs {
  display: flex;
  gap: 15px;
  align-items: center;
  width: 100%;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid transparent;
  overflow: hidden;
  transition: all 0.3s ease;
  flex-grow: 1;
}

.input-group:hover {
  border-color: var(--border-color);
}

.input-group:focus-within {
  background: var(--surface-hover);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 133, 255, 0.2);
}

.reverse {
  padding: 10px;
  border-radius: 50%;
  border: none;
  background-color: var(--surface);
  color: var(--on-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.reverse:hover {
  background-color: var(--surface-hover);
  transform: rotate(180deg);
}

.search-label {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  padding: 12px;
  cursor: text;
  flex-grow: 1;
}

.search-label input {
  outline: none;
  width: 100%;
  border: none;
  background: none;
  color: var(--on-surface);
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
}

.search-label input::placeholder {
  color: var(--on-surface-secondary);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper::after {
  content: '';
  font-size: 12px;
  color: var(--on-surface-secondary);
  position: absolute;
  right: 15px;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
  border: none;
  background-color: transparent;
  border-left: 1px solid var(--border-color);
  padding: 12px 15px 12px 15px;
  color: var(--on-surface);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  min-width: 100px;
}
.select:focus + .select-wrapper::after {
  transform: rotate(180deg);
}

/* Opt-in to the new customizable select rendering */
.select,
::picker(select) {
  appearance: base-select;
}

option {
  display: flex;
  gap: 10px; 
  padding: 10px 15px;
  transition: 0.2s;
  background-color: var(--surface);
}

option:hover,
option:focus {
  background-color: var(--primary);
}

/* Style for the main currency code (e.g., USD) */
.option-label {
  font-weight: 500;
  color: var(--on-surface);
}

/* Style for the full currency name */
.option-text {
  font-size: 0.8rem;
  color: var(--on-surface-secondary);
}

/* When an option is selected and displayed in the button, hide the full name */
selectedcontent .option-text {
  display: none;
}
.button {
  position: relative;
  transition: all 0.3s ease-in-out;
  box-shadow: 0px 10px 20px var(--shadow);
  padding-block: 0.75rem;
  padding-inline: 1.5rem;
  background-color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffff;
  gap: 10px;
  font-weight: 500;
  border: none;
  outline: none;
  overflow: hidden;
  font-size: 16px;
  width: 100%;
  font-family: 'Poppins', sans-serif;
}

.icon {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease-in-out;
}

.button:hover {
  transform: scale(1.02);
  box-shadow: 0px 12px 25px var(--shadow);
}

.button:hover .icon {
  transform: translate(4px);
}

.button:hover::before {
  animation: shine 1.5s ease-out infinite;
}

.button::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 100%;
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0) 70%
  );
  top: 0;
  left: -100px;
  opacity: 0.6;
}

@keyframes shine {
  0% {
    left: -100px;
  }
  60% {
    left: 100%;
  }
  to {
    left: 100%;
  }
}

@media (max-width: 640px) {
  .inputs {
    flex-direction: column;
  }
  .reverse {
    transform: rotate(90deg);
  }
  .reverse:hover {
    transform: rotate(270deg);
  }
}