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

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

body {
  font-family: 'Inter', sans-serif;
  background: #0d1117;
  color: #e0e6f0;
  padding: 40px 20px;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 50% 100%, rgba(0,180,130,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%,  rgba(0,180,130,0.05) 0%, transparent 40%);
  position: relative;
  overflow-x: hidden;
}

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

/* Container */
.mix-container {
  width: 100%;
  max-width: 1000px;
  background: #141c27;
  border: 1px solid #1e2a38;
  border-radius: 16px;
  padding: 32px;
  box-shadow:
    0 0 0 1px rgba(0,200,150,0.04),
    0 8px 40px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

/* Teal glow bottom */
.mix-container::after {
  content: '';
  position: absolute;
  bottom: -100px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 200px;
  background: radial-gradient(ellipse, rgba(0,200,150,0.07) 0%, transparent 70%);
  pointer-events: none;
}

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

.mix-logo {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 0 12px rgba(0,200,150,0.4));
}

.mix-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.3;
  color: #ffffff;
  letter-spacing: -0.5px;
}

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

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

/* Panel */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0f1922;
  border: 1px solid #1e2a38;
  border-radius: 12px;
  overflow: visible;
  transition: border-color 0.2s;
}

.panel:hover {
  border-color: rgba(0,200,150,0.25);
}

/* Panel Label */
.panel-label {
  padding: 14px 20px 8px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  border-bottom: none;
}

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

/* Amount Input */
.from-panel .panel-header input {
  flex: 1;
  padding: 8px 0;
  font-size: 28px;
  font-weight: 700;
  text-align: left;
  border: none;
  background: transparent;
  color: #ffffff;
  outline: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.5px;
  min-width: 0;
}

.from-panel .panel-header input::placeholder {
  color: #2a3a4a;
}

/* Receive Amount */
.to-panel .panel-header .receive-big {
  flex: 1;
  padding: 8px 0;
  font-size: 28px;
  font-weight: 700;
  text-align: left;
  color: #ffffff;
  background: transparent;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.5px;
  min-width: 0;
}

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

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

.select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #1e2a38;
  border-radius: 10px;
  background: #162030;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: rgba(0,200,150,0.35);
  background: rgba(0,200,150,0.06);
}

.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;
  color: #ffffff;
}

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

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

/* Options Dropdown */
.options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0f1922;
  padding: 0;
  border: 1px solid rgba(0,200,150,0.2);
  border-radius: 10px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10000 !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 20px rgba(0,200,150,0.06);
}

.options::-webkit-scrollbar { width: 6px; }
.options::-webkit-scrollbar-track { background: #0f1922; }
.options::-webkit-scrollbar-thumb { background: rgba(0,200,150,0.3); border-radius: 4px; }
.options::-webkit-scrollbar-thumb:hover { background: #00c896; }

/* Search Input */
.search-input {
  position: sticky;
  top: 0;
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid #1e2a38;
  background: #162030;
  color: #e0e6f0;
  font-size: 13px;
  outline: none;
  border-radius: 10px 10px 0 0;
  z-index: 2;
  font-family: 'Inter', sans-serif;
}

.search-input::placeholder { color: #2a3a4a; }

/* Option Group */
.opt-group {
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 700;
  color: #00c896;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: #0f1922;
  position: sticky;
  top: 44px;
  z-index: 1;
}

/* Option Item */
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #8a9ab8;
  transition: all 0.15s ease;
  border: none;
  box-shadow: inset 0 -1px 0 #131d28;
}

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

.option:hover {
  background: rgba(0,200,150,0.07);
  color: #ffffff;
}

.option.selected {
  background: rgba(0,200,150,0.1);
  color: #00c896;
  box-shadow: inset 3px 0 0 #00c896, inset 0 -1px 0 #131d28;
}

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

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

/* Swap Button */
.mix-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #162030;
  border: 1px solid rgba(0,200,150,0.3);
  color: #00c896;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  box-shadow: 0 0 12px rgba(0,200,150,0.1);
}

.mix-swap:hover {
  background: #00c896;
  border-color: #00c896;
  color: #0d1117;
  transform: translate(-50%, -50%) rotate(180deg);
  box-shadow: 0 0 20px rgba(0,200,150,0.4);
}

/* Wallet Input */
.mix-form label {
  display: block;
  margin: 20px 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #4a6a7a;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.mix-form input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #1e2a38;
  border-radius: 10px;
  background: #0f1922;
  color: #e0e6f0;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.mix-form input[type="text"]:focus {
  border-color: rgba(0,200,150,0.4);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.08);
}

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

/* Submit Button */
.mix-submit {
  display: block;
  width: 100%;
  background: #00c896;
  color: #ffffff;
  border: none;
  padding: 16px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 24px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(0,200,150,0.3);
  font-family: 'Inter', sans-serif;
}

.mix-submit:hover {
  background: #00daa8;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0,200,150,0.45);
}

.mix-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0,200,150,0.25);
}

/* SEO Section */
.seo-section {
  max-width: 800px;
  margin: 24px auto 0;
  padding: 28px;
  background: #141c27;
  border: 1px solid #1e2a38;
  border-radius: 12px;
  color: #4a6a7a;
}

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

.seo-section h2:first-child { margin-top: 0; }
.seo-section p  { margin-bottom: 12px; line-height: 1.75; font-size: 14px; }
.seo-section ul { margin: 12px 0 12px 20px; }
.seo-section li { margin-bottom: 8px; font-size: 14px; line-height: 1.6; }

/* Info Block */
.info-block {
  max-width: 800px;
  margin: 12px auto 0;
  padding: 20px 28px;
  background: #141c27;
  border: 1px solid #1e2a38;
  border-radius: 12px;
  color: #e0e6f0;
}

.info-block .label {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 11px;
  color: #4a6a7a;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

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

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

.info-block .value a:hover {
  color: #00daa8;
  text-decoration: underline;
}

/* Loader */
.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #1e2a38;
  border-top-color: #00c896;
  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: 24px 16px; border-radius: 14px; }
  .mix-title { font-size: 20px; }

  .exchange-panel { flex-direction: column; gap: 0; position: relative; }
  .panel { border-radius: 12px; 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: 24px; }

  .mix-swap {
    position: relative; left: auto; top: auto; transform: none;
    margin: -18px auto; z-index: 20; order: 1;
    width: 36px; height: 36px; border-radius: 8px;
  }

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

  .mix-submit { padding: 14px 20px; font-size: 14px; margin-top: 20px; }
  .seo-section, .info-block { padding: 20px 16px; margin-top: 16px; }
  .seo-section h2 { font-size: 16px; }
  .seo-section p, .seo-section li { font-size: 13px; }
}

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

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