:root {
  --primary-color: #6366f1;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --bg-color: #0f0f23;
  --light-bg-color: #1a1a2e;
  --card-bg: rgba(26, 26, 46, 0.8);
  --text-color: #ffffff;
  --light-text-color: #a0a0b3;
  --primary-text-color: #fff;
  --shadow-color: rgba(99, 102, 241, 0.3);
  --glow-color: rgba(99, 102, 241, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  background: var(--bg-color);
  background-image:
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.3) 0%, transparent 50%);
  position: relative;
  overflow-x: hidden;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {

  0%,
  100% {
    filter: hue-rotate(0deg);
  }

  50% {
    filter: hue-rotate(30deg);
  }
}

body.light {
  --bg-color: #f8fafc;
  --light-bg-color: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.9);
  --text-color: #1e293b;
  --light-text-color: #64748b;
  --shadow-color: rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-gradient);
}

.floating-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: float 15s infinite linear;
  opacity: 0.6;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

.container {
  position: relative;
  width: 1200px;
  max-width: 95%;
  padding: 0 20px;
  display: flex;
  gap: 20px;
  animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container .card {
  flex: 1;
  padding: 40px;
  border-radius: 24px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 0 60px var(--shadow-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.container .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s;
}

.container .card:hover::before {
  left: 100%;
}

.container .card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.15),
    0 0 80px var(--glow-color);
}

.container .card .from,
.container .card .to {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.container .card .heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--light-text-color);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dropdown-container {
  position: relative;
  margin-bottom: 15px;
  width: 100%;
}

.dropdown-container .dropdown-toggle {
  display: flex;
  align-items: center;
  padding: 18px 24px;
  border-radius: 16px;
  background: var(--light-bg-color);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.dropdown-container .dropdown-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dropdown-container .dropdown-toggle:hover::before {
  opacity: 0.1;
}

.dropdown-container .dropdown-toggle span {
  flex: 1;
  margin-left: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.dropdown-container .dropdown-toggle ion-icon {
  font-size: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.dropdown-container.active .dropdown-toggle {
  border-radius: 16px 16px 0 0;
  background: var(--primary-gradient);
  color: var(--primary-text-color);
  transform: scale(1.02);
}

.dropdown-container.active .dropdown-toggle ion-icon:last-child {
  transform: rotate(180deg);
}

.dropdown-container .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  padding: 12px;
  z-index: 10;
  list-style: none;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: dropdownSlide 0.3s ease-out;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-container .dropdown-menu::-webkit-scrollbar {
  width: 4px;
}

.dropdown-container.active .dropdown-menu {
  display: block;
}

.dropdown-container .dropdown-menu li {
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.dropdown-container .dropdown-menu li:hover {
  background: var(--primary-gradient);
  color: var(--primary-text-color);
  transform: translateX(4px);
}

.dropdown-container .dropdown-menu li.active {
  background: var(--accent-gradient);
  color: var(--primary-text-color);
}

.container .text-area {
  position: relative;
  margin: 20px 0;
}

.container textarea {
  width: 100%;
  padding: 24px;
  background: var(--light-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  resize: none;
  outline: none;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.container textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px var(--shadow-color);
  transform: scale(1.01);
}

.container .text-area .chars {
  position: absolute;
  bottom: 8px;
  right: 16px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--light-text-color);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.card-bottom {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 20px;
}

.card-bottom p {
  font-size: 14px;
  color: var(--light-text-color);
  margin-bottom: 10px;
}

.card-bottom label,
.card-bottom button {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  cursor: pointer;
  border-radius: 16px;
  background: var(--light-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.card-bottom label::before,
.card-bottom button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: left 0.4s ease;
}

.card-bottom label:hover::before,
.card-bottom button:hover::before {
  left: 0;
}

.card-bottom label:hover,
.card-bottom button:hover {
  color: var(--primary-text-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px var(--shadow-color);
}

.card-bottom span,
.card-bottom ion-icon {
  position: relative;
  z-index: 1;
}

.card-bottom button {
  color: var(--text-color);
  outline: none;
}

.container .center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swap-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg-color);
  background: var(--primary-gradient);
  color: var(--primary-text-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px var(--shadow-color);
  position: relative;
  z-index: 5;
}

.swap-position::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--accent-gradient);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.swap-position:hover::before {
  opacity: 1;
}

.swap-position ion-icon {
  font-size: 28px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.swap-position:hover {
  transform: scale(1.1) rotate(180deg);
  box-shadow: 0 12px 35px var(--glow-color);
}

.mode {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
}

.toggle {
  position: relative;
  cursor: pointer;
}

.toggle-track {
  width: 50px;
  height: 80px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 8px 0;
  justify-content: space-between;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox {
  display: none;
}

.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 40px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px var(--shadow-color);
}

.toggle input:checked~.toggle-thumb {
  transform: translateY(40px);
  background: var(--secondary-gradient);
}

.toggle img {
  width: 24px;
  height: 24px;
  filter: brightness(1.2);
  transition: transform 0.3s ease;
}

.toggle:hover img {
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 800px) {
  .container {
    width: 100%;
    margin-top: 20px;
    flex-direction: column;
    gap: 30px;
  }

  .container .card {
    width: 100%;
    padding: 30px 20px;
  }

  .container .card .from,
  .container .card .to {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .swap-position {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .swap-position:hover {
    transform: translate(-50%, -50%) scale(1.1) rotate(90deg);
  }

  .swap-position ion-icon {
    transform: rotate(90deg);
  }

  .mode {
    bottom: 20px;
    right: 20px;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--light-text-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* Pulse Animation for Active Elements */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--glow-color);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}
