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

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(ellipse at 65% 0%, #3d1a6e 0%, #1a0a2e 40%, #0d0818 100%);
  color: #ffffff;
  padding: 40px 20px;
  min-height: 100vh;
}

main {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Container */
.mix-container {
  width: 100%;
  max-width: 1000px;
  background: rgba(28, 14, 52, 0.9);
  border: 1px solid rgba(160, 80, 255, 0.2);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 48px rgba(120, 0, 200, 0.3);
  backdrop-filter: blur(12px);
}

/* Header */
.mix-header {
  text-align: center;
  margin-bottom: 40px;
}

.mix-logo {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto 20px;
}

.mix-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.4;
  color: #ffffff;
}

/* Form */
.mix-form {
  width: 100%;
}

/* 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(15, 8, 30, 0.85);
  border: 1px solid rgba(140, 60, 255, 0.2);
  border-radius: 16px;
  overflow: visible;
}

/* Panel Label */
.panel-label {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #9966cc;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(140, 60, 255, 0.12);
}

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

/* Amount Input */
.from-panel .panel-header input {
  width: 100%;
  max-width: 280px;
  padding: 12px 16px;
  font-size: 32px;
  font-weight: 700;
  text-align: right;
  border: none;
  background: transparent;
  color: #ffffff;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.from-panel .panel-header input::placeholder {
  color: #3d2860;
}

/* Receive Amount */
.to-panel .panel-header .receive-big {
  width: 100%;
  max-width: 280px;
  padding: 12px 16px;
  font-size: 32px;
  font-weight: 700;
  text-align: right;
  color: #ffffff;
  background: transparent;
  font-family: 'Inter', sans-serif;
}

/* Select Area */
.panel-select {
  padding: 12px 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(180, 80, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: rgba(220, 80, 255, 0.55);
  background: rgba(180, 80, 255, 0.1);
}

.select-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

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

.arrow {
  font-size: 12px;
  color: #bb66ff;
  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: #180c30;
  padding: 0;
  border: 1px solid rgba(180, 80, 255, 0.3);
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10000 !important;
  box-shadow: 0 16px 48px rgba(100, 0, 180, 0.55);
}

.options::-webkit-scrollbar { width: 6px; }
.options::-webkit-scrollbar-track { background: #180c30; }
.options::-webkit-scrollbar-thumb { background: rgba(180,80,255,0.35); border-radius: 4px; }
.options::-webkit-scrollbar-thumb:hover { background: rgba(220,80,255,0.55); }

/* Search Input */
.search-input {
  position: sticky;
  top: 0;
  width: 100%;
  height: 48px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid rgba(140,60,255,0.15);
  background: rgba(255,255,255,0.04);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  border-radius: 12px 12px 0 0;
  z-index: 2;
}

.search-input::placeholder { color: #5533aa; }

/* Option Group */
.opt-group {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #bb66ff;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #180c30;
  position: sticky;
  top: 48px;
  z-index: 1;
}

/* Option Item */
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  color: #ddccff;
  transition: background 0.15s ease;
  border: none;
  box-shadow: inset 0 -1px 0 rgba(140,60,255,0.08);
}

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

.option:hover {
  background: rgba(180,80,255,0.12);
  color: #ffffff;
}

.option.selected {
  background: rgba(160,60,255,0.14);
  box-shadow: inset 3px 0 0 #cc44ff, inset 0 -1px 0 rgba(140,60,255,0.08);
}

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

.option span {
  white-space: nowrap;
  flex: 1;
  font-size: 14px;
  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: linear-gradient(135deg, #cc44ff, #ff44aa);
  border: 2px solid rgba(255,255,255,0.12);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(200,60,255,0.5);
}

.mix-swap:hover {
  background: linear-gradient(135deg, #ff44aa, #cc44ff);
  transform: translate(-50%, -50%) rotate(180deg);
  box-shadow: 0 6px 28px rgba(255,60,200,0.7);
}

/* Wallet Input */
.mix-form label {
  display: block;
  margin: 24px 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #9966cc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mix-form input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(180,80,255,0.22);
  border-radius: 12px;
  background: rgba(15,8,30,0.85);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.mix-form input[type="text"]:focus {
  border-color: rgba(220,80,255,0.55);
  box-shadow: 0 0 0 3px rgba(200,60,255,0.14);
}

.mix-form input[type="text"]::placeholder { color: #3d2860; }

/* Submit Button */
.mix-submit {
  display: block;
  width: 100%;
  background: linear-gradient(90deg, #ff44cc, #cc44ff, #9933ff);
  color: #ffffff;
  border: none;
  padding: 16px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 32px;
  transition: all 0.2s;
  box-shadow: 0 6px 28px rgba(200,60,255,0.45);
}

.mix-submit:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(220,60,255,0.6);
}

.mix-submit:active { transform: translateY(0); }

/* SEO Section */
.seo-section {
  max-width: 800px;
  margin: 48px auto 0;
  padding: 32px;
  background: rgba(28,14,52,0.85);
  border: 1px solid rgba(140,60,255,0.18);
  border-radius: 16px;
  color: #bbaadd;
}

.seo-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 24px 0 16px;
  color: #ffffff;
}

.seo-section h2:first-child { margin-top: 0; }

.seo-section p {
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: 14px;
}

.seo-section ul { margin: 16px 0 16px 24px; }

.seo-section li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}

/* Info Block */
.info-block {
  max-width: 800px;
  margin: 24px auto 0;
  padding: 24px 32px;
  background: rgba(28,14,52,0.85);
  border: 1px solid rgba(140,60,255,0.18);
  border-radius: 16px;
  color: #ffffff;
}

.info-block .label {
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 11px;
  color: #9966cc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.info-block .value a {
  color: #cc66ff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.info-block .value a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Loader */
.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(180,80,255,0.2);
  border-top-color: #cc44ff;
  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;
    max-width: 100%;
  }

  .mix-title { font-size: 24px; }

  .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;
  }

  .mix-swap {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: -22px auto;
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 1;
  }

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

  .mix-submit {
    padding: 14px 20px;
    font-size: 15px;
    margin-top: 28px;
  }

  .seo-section,
  .info-block {
    padding: 24px 20px;
    margin-top: 40px;
  }

  .seo-section h2 { font-size: 18px; }
  .seo-section p, .seo-section li { font-size: 13px; }
}

@media (max-width: 480px) {
  body { padding: 20px 12px; }

  .mix-container {
    padding: 24px 16px;
    border-radius: 16px;
  }

  .mix-logo { width: 64px; height: 64px; margin-bottom: 16px; }
  .mix-title { font-size: 20px; }

  .panel-label { padding: 10px 14px; font-size: 11px; }
  .panel-header { padding: 16px 14px; }

  .from-panel .panel-header input,
  .to-panel .panel-header .receive-big { font-size: 24px; }

  .panel-select { padding: 10px 14px 14px; }
  .select-trigger { padding: 10px 12px; }

  .mix-swap { width: 40px; height: 40px; margin: -20px auto; }

  .mix-form input[type="text"] { padding: 12px 14px; font-size: 14px; }
  .mix-submit { padding: 14px 18px; margin-top: 24px; }
}

/* Validation */
.wallet-error {
  color: #ff6688;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.wallet-input.error { border-color: #ff4466 !important; }

.wallet-validation-status {
  display: inline-block;
  margin-left: 8px;
  font-size: 14px;
}

.wallet-validation-status.valid  { color: #44ffaa; }
.wallet-validation-status.invalid { color: #ff6688; }

.amount-error {
  color: #ff6688;
  font-size: 12px;
  margin-top: 5px;
}

#amount.error { color: #ff6688; }
