/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background: #0d0e12;
  color: #d4d8f0;
  padding: 40px 20px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 25% 0%,   rgba(98,126,234,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(148,88,255,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 50%,  rgba(30,20,60,0.6)    0%, transparent 70%);
}

/* ETH diamond mesh — subtle background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      120deg,
      transparent,
      transparent 44px,
      rgba(98,126,234,0.025) 44px,
      rgba(98,126,234,0.025) 45px
    ),
    repeating-linear-gradient(
      60deg,
      transparent,
      transparent 44px,
      rgba(98,126,234,0.025) 44px,
      rgba(98,126,234,0.025) 45px
    );
  pointer-events: none;
  z-index: 0;
}

main {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* Container */
.mix-container {
  width: 100%;
  max-width: 1000px;
  background: rgba(16, 14, 28, 0.92);
  border: 1px solid rgba(98,126,234,0.18);
  border-radius: 20px;
  padding: 48px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 24px 80px rgba(0,0,0,0.7),
    0 0 60px rgba(98,126,234,0.08);
  backdrop-filter: blur(12px);
}

/* ETH diamond glow — top centre */
.mix-container::before {
  content: '';
  position: absolute;
  top: -140px; left: 50%;
  transform: translateX(-50%);
  width: 560px; height: 280px;
  background: radial-gradient(ellipse,
    rgba(98,126,234,0.16) 0%,
    rgba(148,88,255,0.08) 40%,
    transparent 70%
  );
  pointer-events: none;
}

/* Bottom purple orb */
.mix-container::after {
  content: '';
  position: absolute;
  bottom: -120px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle,
    rgba(148,88,255,0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  border-radius: 50%;
}

/* Header */
.mix-header {
  text-align: center;
  margin-bottom: 44px;
  position: relative;
  z-index: 1;
}

.mix-logo {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 18px;
  filter:
    drop-shadow(0 0 12px rgba(98,126,234,0.7))
    drop-shadow(0 0 32px rgba(148,88,255,0.35));
}

.mix-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg,
    #ffffff 0%,
    #c8d0f8 40%,
    #9488ff 70%,
    #627eea 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Form */
.mix-form {
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Exchange Panel */
.exchange-panel {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 32px;
  position: relative;
}

/* Panel */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,126,234,0.18);
  border-radius: 16px;
  overflow: visible;
  transition: all 0.25s;
  position: relative;
}

/* Top gradient accent on panel */
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(98,126,234,0.5),
    transparent
  );
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.25s;
}

.panel:hover {
  border-color: rgba(98,126,234,0.4);
  box-shadow:
    0 0 24px rgba(98,126,234,0.1),
    0 0 0 1px rgba(98,126,234,0.08) inset;
}

.panel:hover::before { opacity: 1; }

/* Panel Label */
.panel-label {
  padding: 14px 20px 8px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(98,126,234,0.7);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(98,126,234,0.1);
}

/* Panel Header */
.panel-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* Amount Input */
.from-panel .panel-header input {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 38px;
  font-weight: 800;
  text-align: right;
  border: none;
  background: transparent;
  color: #627eea;
  outline: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: -2px;
  text-shadow: 0 0 20px rgba(98,126,234,0.4);
}

.from-panel .panel-header input::placeholder {
  color: rgba(98,126,234,0.18);
  text-shadow: none;
}

/* Receive Amount */
.to-panel .panel-header .receive-big {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 38px;
  font-weight: 800;
  text-align: right;
  color: #e8ecff;
  background: transparent;
  font-family: 'Inter', sans-serif;
  letter-spacing: -2px;
}

/* Select Area */
.panel-select {
  padding: 10px 16px 16px;
}

/* Custom Select */
.custom-select {
  position: relative;
  width: 100%;
  z-index: 100;
}

.select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(98,126,234,0.2);
  border-radius: 12px;
  background: rgba(98,126,234,0.05);
  cursor: pointer;
  color: #d4d8f0;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: rgba(98,126,234,0.5);
  background: rgba(98,126,234,0.1);
  box-shadow: 0 0 14px rgba(98,126,234,0.1);
}

.select-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(98,126,234,0.3);
}

.select-value {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e8ecff;
}

.arrow {
  font-size: 10px;
  color: #627eea;
  transition: transform 0.2s;
}

.custom-select.active .arrow {
  transform: rotate(180deg);
}

/* Options Dropdown */
.options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #12102a;
  padding: 0;
  border: 1px solid rgba(98,126,234,0.25);
  border-radius: 14px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10000 !important;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.8),
    0 0 30px rgba(98,126,234,0.1);
}

.options::-webkit-scrollbar { width: 5px; }
.options::-webkit-scrollbar-track { background: #12102a; }
.options::-webkit-scrollbar-thumb { background: rgba(98,126,234,0.35); border-radius: 4px; }
.options::-webkit-scrollbar-thumb:hover { background: #627eea; }

/* Search Input */
.search-input {
  position: sticky;
  top: 0;
  width: 100%;
  height: 46px;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(98,126,234,0.12);
  background: rgba(98,126,234,0.06);
  color: #d4d8f0;
  font-size: 13px;
  outline: none;
  border-radius: 14px 14px 0 0;
  z-index: 2;
  font-family: 'Inter', sans-serif;
}

.search-input::placeholder { color: rgba(98,126,234,0.25); }

/* Option Group */
.opt-group {
  padding: 9px 16px;
  font-size: 10px;
  font-weight: 700;
  color: #627eea;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: #12102a;
  position: sticky;
  top: 46px;
  z-index: 1;
}

/* Option Item */
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  color: #8890b8;
  transition: all 0.15s ease;
  border: none;
  box-shadow: inset 0 -1px 0 rgba(98,126,234,0.07);
}

.option:last-child { box-shadow: none; }

.option:hover {
  background: rgba(98,126,234,0.1);
  color: #e8ecff;
}

.option.selected {
  background: rgba(98,126,234,0.14);
  color: #8ba4ff;
  box-shadow: inset 3px 0 0 #627eea, inset 0 -1px 0 rgba(98,126,234,0.07);
}

.option img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.option span {
  white-space: nowrap;
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Swap Button */
.mix-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(98,126,234,0.12);
  border: 1px solid rgba(98,126,234,0.35);
  color: #8ba4ff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 20px rgba(98,126,234,0.15);
}

.mix-swap:hover {
  background: #627eea;
  border-color: #627eea;
  color: #ffffff;
  transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
  box-shadow:
    0 0 30px rgba(98,126,234,0.6),
    0 0 60px rgba(98,126,234,0.2);
}

/* Wallet Input */
.mix-form label {
  display: block;
  margin: 22px 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(98,126,234,0.6);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.mix-form input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(98,126,234,0.2);
  border-radius: 14px;
  background: rgba(98,126,234,0.05);
  color: #d4d8f0;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.mix-form input[type="text"]:focus {
  border-color: rgba(98,126,234,0.55);
  background: rgba(98,126,234,0.08);
  box-shadow:
    0 0 0 3px rgba(98,126,234,0.12),
    0 0 24px rgba(98,126,234,0.08);
}

.mix-form input[type="text"]::placeholder { color: rgba(98,126,234,0.22); }

/* Submit Button */
.mix-submit {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #627eea 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  padding: 18px 24px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 28px;
  transition: all 0.25s;
  box-shadow:
    0 4px 24px rgba(98,126,234,0.4),
    0 1px 0 rgba(255,255,255,0.12) inset;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

/* Diamond shimmer */
.mix-submit::before {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(105deg,
    transparent,
    rgba(255,255,255,0.15),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s;
}

.mix-submit:hover::before { left: 130%; }

.mix-submit:hover {
  background: linear-gradient(135deg, #7b96ff 0%, #a07aff 100%);
  transform: translateY(-2px);
  box-shadow:
    0 8px 36px rgba(98,126,234,0.55),
    0 0 60px rgba(98,126,234,0.15);
}

.mix-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(98,126,234,0.3);
}

/* SEO Section */
.seo-section {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 32px;
  background: rgba(16,14,28,0.85);
  border: 1px solid rgba(98,126,234,0.14);
  border-radius: 18px;
  color: #5a6488;
  backdrop-filter: blur(8px);
}

.seo-section h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 22px 0 12px;
  color: #b8c4f0;
  letter-spacing: -0.3px;
}

.seo-section h2:first-child { margin-top: 0; }
.seo-section p  { margin-bottom: 14px; line-height: 1.8; font-size: 14px; }
.seo-section ul { margin: 14px 0 14px 22px; }
.seo-section li { margin-bottom: 8px; font-size: 14px; line-height: 1.65; }

/* Info Block */
.info-block {
  max-width: 800px;
  margin: 16px auto 0;
  padding: 22px 32px;
  background: rgba(16,14,28,0.85);
  border: 1px solid rgba(98,126,234,0.14);
  border-radius: 18px;
  color: #d4d8f0;
  backdrop-filter: blur(8px);
}

.info-block .label {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 10px;
  color: rgba(98,126,234,0.55);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.info-block .value p { margin: 0; font-size: 14px; }

.info-block .value a {
  color: #8ba4ff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.info-block .value a:hover {
  color: #aabcff;
  text-shadow: 0 0 10px rgba(98,126,234,0.4);
}

/* Loader */
.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(98,126,234,0.15);
  border-top-color: #627eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  visibility: hidden;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 768px) {
  .mix-container { padding: 28px 20px; }
  .mix-title { font-size: 22px; }

  .exchange-panel { flex-direction: column; gap: 0; position: relative; }
  .panel { border-radius: 14px; width: 100%; }
  .from-panel { z-index: 10; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .to-panel   { z-index: 5;  border-top-left-radius: 0;    border-top-right-radius: 0;    margin-top: -1px; }

  .from-panel .panel-header input,
  .to-panel .panel-header .receive-big { font-size: 28px; max-width: 100%; text-align: center; letter-spacing: -1px; }

  .mix-swap {
    position: relative; left: auto; top: auto; transform: none;
    margin: -22px auto; z-index: 20; order: 1;
    width: 44px; height: 44px; border-radius: 50%;
  }

  .from-panel { order: 0; }
  .to-panel   { order: 2; }

  .mix-submit { padding: 15px 20px; font-size: 14px; margin-top: 24px; }
  .seo-section, .info-block { padding: 22px 18px; margin-top: 28px; border-radius: 16px; }
  .seo-section h2 { font-size: 16px; }
  .seo-section p, .seo-section li { font-size: 13px; }
}

@media (max-width: 480px) {
  body { padding: 20px 12px; }
  .mix-container { padding: 22px 16px; border-radius: 16px; }
  .mix-logo { width: 58px; height: 58px; margin-bottom: 14px; }
  .mix-title { font-size: 20px; }
  .panel-label { padding: 12px 16px 6px; font-size: 9px; }
  .panel-header { padding: 14px 14px; }
  .from-panel .panel-header input,
  .to-panel .panel-header .receive-big { font-size: 26px; }
  .panel-select { padding: 8px 14px 14px; }
  .select-trigger { padding: 10px 12px; }
  .mix-swap { width: 40px; height: 40px; margin: -20px auto; }
  .mix-form input[type="text"] { padding: 12px 14px; }
  .mix-submit { padding: 14px 18px; margin-top: 20px; }
}

/* Validation */
.wallet-error { color: #ff6080; font-size: 12px; margin-top: 5px; display: none; }
.wallet-input.error { border-color: #ff6080 !important; }
.wallet-validation-status { display: inline-block; margin-left: 8px; font-size: 14px; }
.wallet-validation-status.valid   { color: #4ade80; }
.wallet-validation-status.invalid { color: #ff6080; }
.amount-error { color: #ff6080; font-size: 12px; margin-top: 5px; }
#amount.error { color: #ff6080; }
