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

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Share+Tech+Mono&display=swap');

body {
  font-family: 'Orbitron', sans-serif;
  background: #050508;
  color: #c0c8d8;
  padding: 40px 20px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Cyberpunk grid floor */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,0,19,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,0,19,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Red horizon glow */
body::after {
  content: '';
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 300px;
  background: linear-gradient(to top, rgba(255,0,19,0.07) 0%, transparent 100%);
  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(8, 6, 14, 0.95);
  border: 1px solid rgba(255,0,19,0.25);
  border-radius: 4px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,0,19,0.08),
    0 0 40px rgba(255,0,19,0.08),
    0 24px 80px rgba(0,0,0,0.8),
    inset 0 0 80px rgba(255,0,19,0.02);
}

/* Corner cuts — TRON style */
.mix-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    #ff0013 0%,
    #ff0013 30px,
    transparent 30px,
    transparent calc(100% - 30px),
    #ff0013 calc(100% - 30px),
    #ff0013 100%
  );
}

.mix-container::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,0,19,0.3) 30%,
    rgba(255,0,19,0.6) 50%,
    rgba(255,0,19,0.3) 70%,
    transparent 100%
  );
}

/* Vertical side lines */
.mix-container .mix-form::before {
  content: '';
  position: absolute;
  top: 0; left: -1px;
  width: 1px; height: 100%;
  background: linear-gradient(180deg,
    #ff0013 0%,
    #ff0013 60px,
    transparent 60px,
    transparent calc(100% - 60px),
    #ff0013 calc(100% - 60px),
    #ff0013 100%
  );
  pointer-events: none;
}

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

.mix-logo {
  width: 68px;
  height: 68px;
  display: block;
  margin: 0 auto 16px;
  filter:
    drop-shadow(0 0 8px rgba(255,0,19,0.8))
    drop-shadow(0 0 24px rgba(255,0,19,0.4));
}

.mix-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 24px;
  line-height: 1.3;
  color: #ffffff;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(255,0,19,0.8),
    0 0 30px rgba(255,0,19,0.4),
    0 0 60px rgba(255,0,19,0.2);
}

/* 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,0,19,0.03);
  border: 1px solid rgba(255,0,19,0.2);
  border-radius: 2px;
  overflow: visible;
  transition: all 0.2s;
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 16px; height: 2px;
  background: #ff0013;
}

.panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 16px;
  background: #ff0013;
}

.panel:hover {
  border-color: rgba(255,0,19,0.5);
  box-shadow:
    0 0 20px rgba(255,0,19,0.1),
    inset 0 0 20px rgba(255,0,19,0.03);
}

/* Panel Label */
.panel-label {
  padding: 14px 20px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #ff0013;
  text-transform: uppercase;
  letter-spacing: 3px;
  border-bottom: 1px solid rgba(255,0,19,0.1);
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 8px rgba(255,0,19,0.5);
}

/* Panel Header */
.panel-header {
  padding: 16px 20px;
  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: 36px;
  font-weight: 700;
  text-align: right;
  border: none;
  background: transparent;
  color: #ff0013;
  outline: none;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: -1px;
  text-shadow: 0 0 12px rgba(255,0,19,0.6);
}

.from-panel .panel-header input::placeholder {
  color: rgba(255,0,19,0.15);
  text-shadow: none;
}

/* Receive Amount */
.to-panel .panel-header .receive-big {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 36px;
  font-weight: 700;
  text-align: right;
  color: #ffffff;
  background: transparent;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: -1px;
  text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

/* 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: 11px 14px;
  border: 1px solid rgba(255,0,19,0.2);
  border-radius: 2px;
  background: rgba(255,0,19,0.04);
  cursor: pointer;
  color: #c0c8d8;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: rgba(255,0,19,0.5);
  background: rgba(255,0,19,0.08);
  box-shadow: 0 0 12px rgba(255,0,19,0.12);
}

.select-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255,0,19,0.3);
}

.select-value {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e0e8f0;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}

.arrow {
  font-size: 10px;
  color: #ff0013;
  transition: transform 0.2s;
  text-shadow: 0 0 6px rgba(255,0,19,0.6);
}

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

/* Options Dropdown */
.options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #08060e;
  padding: 0;
  border: 1px solid rgba(255,0,19,0.3);
  border-radius: 2px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10000 !important;
  box-shadow:
    0 16px 48px rgba(0,0,0,0.9),
    0 0 24px rgba(255,0,19,0.12);
}

.options::-webkit-scrollbar { width: 4px; }
.options::-webkit-scrollbar-track { background: #08060e; }
.options::-webkit-scrollbar-thumb { background: rgba(255,0,19,0.4); border-radius: 2px; }
.options::-webkit-scrollbar-thumb:hover { background: #ff0013; }

/* Search Input */
.search-input {
  position: sticky;
  top: 0;
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(255,0,19,0.15);
  background: rgba(255,0,19,0.05);
  color: #e0e8f0;
  font-size: 12px;
  outline: none;
  border-radius: 2px 2px 0 0;
  z-index: 2;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
}

.search-input::placeholder { color: rgba(255,0,19,0.2); }

/* Option Group */
.opt-group {
  padding: 8px 14px;
  font-size: 9px;
  font-weight: 700;
  color: #ff0013;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: #08060e;
  position: sticky;
  top: 44px;
  z-index: 1;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 6px rgba(255,0,19,0.5);
}

/* Option Item */
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #7a8898;
  transition: all 0.15s ease;
  border: none;
  box-shadow: inset 0 -1px 0 rgba(255,0,19,0.06);
}

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

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

.option.selected {
  background: rgba(255,0,19,0.1);
  color: #ff0013;
  box-shadow: inset 3px 0 0 #ff0013, inset 0 -1px 0 rgba(255,0,19,0.06);
  text-shadow: 0 0 8px rgba(255,0,19,0.4);
}

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

.option span {
  white-space: nowrap;
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.5px;
}

/* Swap Button */
.mix-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 2px;
  background: #08060e;
  border: 1px solid rgba(255,0,19,0.4);
  color: #ff0013;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  box-shadow:
    0 0 12px rgba(255,0,19,0.2),
    inset 0 0 8px rgba(255,0,19,0.05);
  text-shadow: 0 0 8px rgba(255,0,19,0.8);
}

.mix-swap:hover {
  background: #ff0013;
  border-color: #ff0013;
  color: #ffffff;
  transform: translate(-50%, -50%) rotate(180deg);
  box-shadow: 0 0 30px rgba(255,0,19,0.7), 0 0 60px rgba(255,0,19,0.3);
  text-shadow: none;
}

/* Wallet Input */
.mix-form label {
  display: block;
  margin: 22px 0 8px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,0,19,0.6);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: 'Orbitron', sans-serif;
}

.mix-form input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,0,19,0.2);
  border-radius: 2px;
  background: rgba(255,0,19,0.03);
  color: #e0e8f0;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.5px;
}

.mix-form input[type="text"]:focus {
  border-color: rgba(255,0,19,0.6);
  box-shadow:
    0 0 0 2px rgba(255,0,19,0.08),
    0 0 20px rgba(255,0,19,0.08);
}

.mix-form input[type="text"]::placeholder {
  color: rgba(255,0,19,0.15);
  font-family: 'Share Tech Mono', monospace;
}

/* Submit Button */
.mix-submit {
  display: block;
  width: 100%;
  background: transparent;
  color: #ff0013;
  border: 1px solid #ff0013;
  padding: 18px 24px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 5px;
  margin-top: 28px;
  transition: all 0.25s;
  box-shadow:
    0 0 16px rgba(255,0,19,0.2),
    inset 0 0 16px rgba(255,0,19,0.04);
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 8px rgba(255,0,19,0.6);
  position: relative;
  overflow: hidden;
}

/* Sweep scan line */
.mix-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,0,19,0.15),
    transparent
  );
  transition: left 0.5s;
}

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

.mix-submit:hover {
  background: #ff0013;
  color: #ffffff;
  text-shadow: none;
  transform: translateY(-1px);
  box-shadow:
    0 0 30px rgba(255,0,19,0.6),
    0 0 60px rgba(255,0,19,0.2),
    0 6px 20px rgba(0,0,0,0.5);
  letter-spacing: 6px;
}

.mix-submit:active {
  transform: translateY(0);
  box-shadow: 0 0 16px rgba(255,0,19,0.4);
}

/* SEO Section */
.seo-section {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 28px;
  background: rgba(8,6,14,0.95);
  border: 1px solid rgba(255,0,19,0.15);
  border-radius: 2px;
  color: #5a6878;
}

.seo-section h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 22px 0 12px;
  color: rgba(255,0,19,0.8);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 6px rgba(255,0,19,0.3);
}

.seo-section h2:first-child { margin-top: 0; }
.seo-section p  { margin-bottom: 12px; line-height: 1.8; font-size: 13px; font-family: 'Share Tech Mono', monospace; }
.seo-section ul { margin: 12px 0 12px 20px; }
.seo-section li { margin-bottom: 8px; font-size: 13px; line-height: 1.6; font-family: 'Share Tech Mono', monospace; }

/* Info Block */
.info-block {
  max-width: 800px;
  margin: 16px auto 0;
  padding: 20px 28px;
  background: rgba(8,6,14,0.95);
  border: 1px solid rgba(255,0,19,0.15);
  border-radius: 2px;
  color: #c0c8d8;
}

.info-block .label {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 9px;
  color: rgba(255,0,19,0.5);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: 'Orbitron', sans-serif;
}

.info-block .value p { margin: 0; font-size: 13px; font-family: 'Share Tech Mono', monospace; }

.info-block .value a {
  color: #ff0013;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  text-shadow: 0 0 6px rgba(255,0,19,0.3);
}

.info-block .value a:hover {
  color: #ff4433;
  text-shadow: 0 0 12px rgba(255,0,19,0.6);
}

/* Loader */
.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,0,19,0.15);
  border-top-color: #ff0013;
  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; }
  .mix-title { font-size: 16px; letter-spacing: 2px; }

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

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

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

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

  .mix-submit { padding: 14px 20px; font-size: 11px; margin-top: 24px; letter-spacing: 3px; }
  .seo-section, .info-block { padding: 20px 16px; margin-top: 24px; }
  .seo-section h2 { font-size: 12px; }
  .seo-section p, .seo-section li { font-size: 12px; }
}

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

/* Validation */
.wallet-error { color: #ff4433; font-size: 11px; margin-top: 5px; display: none; font-family: 'Share Tech Mono', monospace; }
.wallet-input.error { border-color: #ff4433 !important; }
.wallet-validation-status { display: inline-block; margin-left: 8px; font-size: 13px; }
.wallet-validation-status.valid   { color: #00ff88; text-shadow: 0 0 8px rgba(0,255,136,0.4); }
.wallet-validation-status.invalid { color: #ff4433; text-shadow: 0 0 8px rgba(255,68,51,0.4); }
.amount-error { color: #ff4433; font-size: 11px; margin-top: 5px; font-family: 'Share Tech Mono', monospace; }
#amount.error { color: #ff4433; text-shadow: 0 0 6px rgba(255,68,51,0.4); }
