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

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: #0f0f0f;
  color: #e8e0cc;
  padding: 40px 20px;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 10% 90%, rgba(244,183,40,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(244,183,40,0.04) 0%, transparent 50%);
  position: relative;
  overflow-x: hidden;
}

/* Hex grid texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      60deg,
      transparent,
      transparent 30px,
      rgba(244,183,40,0.015) 30px,
      rgba(244,183,40,0.015) 31px
    ),
    repeating-linear-gradient(
      -60deg,
      transparent,
      transparent 30px,
      rgba(244,183,40,0.015) 30px,
      rgba(244,183,40,0.015) 31px
    );
  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: #161616;
  border: 1px solid #2a2620;
  border-radius: 4px;
  padding: 48px;
  box-shadow:
    0 0 0 1px rgba(244,183,40,0.06),
    0 24px 80px rgba(0,0,0,0.7),
    0 0 40px rgba(244,183,40,0.04);
  position: relative;
  overflow: hidden;
}

/* Gold corner accent — top left */
.mix-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 200px; height: 3px;
  background: linear-gradient(90deg, #f4b728, transparent);
}

/* Gold corner accent — left side */
.mix-container::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 120px;
  background: linear-gradient(180deg, #f4b728, transparent);
}

/* 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 16px rgba(244,183,40,0.5));
}

.mix-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: #f4b728;
  letter-spacing: -0.3px;
}

/* 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: #111111;
  border: 1px solid #252218;
  border-radius: 4px;
  overflow: visible;
  transition: border-color 0.2s;
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(244,183,40,0.4), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.panel:hover {
  border-color: rgba(244,183,40,0.3);
}

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

/* Panel Label */
.panel-label {
  padding: 11px 18px;
  font-size: 10px;
  font-weight: 600;
  color: #5a5040;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  border-bottom: 1px solid #1e1c14;
  font-family: 'IBM Plex Mono', monospace;
}

/* 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: 8px 12px;
  font-size: 38px;
  font-weight: 600;
  text-align: right;
  border: none;
  background: transparent;
  color: #f4b728;
  outline: none;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -1px;
}

.from-panel .panel-header input::placeholder {
  color: rgba(244,183,40,0.15);
}

/* Receive Amount */
.to-panel .panel-header .receive-big {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 38px;
  font-weight: 600;
  text-align: right;
  color: #e8e0cc;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -1px;
}

/* 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 #252218;
  border-radius: 3px;
  background: #0d0d0d;
  cursor: pointer;
  color: #e8e0cc;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: rgba(244,183,40,0.4);
  background: rgba(244,183,40,0.04);
}

.select-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(244,183,40,0.25);
}

.select-value {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e8e0cc;
  font-family: 'IBM Plex Sans', sans-serif;
}

.arrow {
  font-size: 11px;
  color: #f4b728;
  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: #111111;
  padding: 0;
  border: 1px solid rgba(244,183,40,0.25);
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10000 !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.8), 0 0 24px rgba(244,183,40,0.08);
}

.options::-webkit-scrollbar { width: 6px; }
.options::-webkit-scrollbar-track { background: #111111; }
.options::-webkit-scrollbar-thumb { background: rgba(244,183,40,0.3); border-radius: 2px; }
.options::-webkit-scrollbar-thumb:hover { background: #f4b728; }

/* Search Input */
.search-input {
  position: sticky;
  top: 0;
  width: 100%;
  height: 46px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid #1e1c14;
  background: #0d0d0d;
  color: #e8e0cc;
  font-size: 13px;
  outline: none;
  border-radius: 4px 4px 0 0;
  z-index: 2;
  font-family: 'IBM Plex Mono', monospace;
}

.search-input::placeholder { color: #3a3020; }

/* Option Group */
.opt-group {
  padding: 9px 14px;
  font-size: 9px;
  font-weight: 600;
  color: #f4b728;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  background: #111111;
  position: sticky;
  top: 46px;
  z-index: 1;
  font-family: 'IBM Plex Mono', monospace;
}

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

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

.option:hover {
  background: rgba(244,183,40,0.06);
  color: #e8e0cc;
}

.option.selected {
  background: rgba(244,183,40,0.08);
  color: #f4b728;
  box-shadow: inset 3px 0 0 #f4b728, inset 0 -1px 0 #181510;
}

.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;
  font-family: 'IBM Plex Sans', sans-serif;
}

/* Swap Button */
.mix-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 2px;
  background: #161616;
  border: 1px solid rgba(244,183,40,0.3);
  color: #f4b728;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(244,183,40,0.12);
}

.mix-swap:hover {
  background: #f4b728;
  border-color: #f4b728;
  color: #0f0f0f;
  transform: translate(-50%, -50%) rotate(180deg);
  box-shadow: 0 0 28px rgba(244,183,40,0.5);
}

/* Wallet Input */
.mix-form label {
  display: block;
  margin: 22px 0 8px;
  font-size: 10px;
  font-weight: 600;
  color: #5a5040;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-family: 'IBM Plex Mono', monospace;
}

.mix-form input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #252218;
  border-radius: 3px;
  background: #111111;
  color: #e8e0cc;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.3px;
}

.mix-form input[type="text"]:focus {
  border-color: rgba(244,183,40,0.5);
  box-shadow: 0 0 0 3px rgba(244,183,40,0.08), 0 0 20px rgba(244,183,40,0.06);
}

.mix-form input[type="text"]::placeholder {
  color: #2e2818;
  font-family: 'IBM Plex Mono', monospace;
}

/* Submit Button */
.mix-submit {
  display: block;
  width: 100%;
  background: #f4b728;
  color: #0f0f0f;
  border: none;
  padding: 18px 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 28px;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(244,183,40,0.3);
  font-family: 'IBM Plex Sans', sans-serif;
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
.mix-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
}

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

.mix-submit:hover {
  background: #ffc93a;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(244,183,40,0.45);
  letter-spacing: 4px;
}

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

/* SEO Section */
.seo-section {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 32px;
  background: #161616;
  border: 1px solid #252218;
  border-radius: 4px;
  color: #5a5040;
  box-shadow: 0 0 0 1px rgba(244,183,40,0.04);
}

.seo-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 14px;
  color: #c8a830;
  letter-spacing: -0.2px;
}

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

/* Info Block */
.info-block {
  max-width: 800px;
  margin: 20px auto 0;
  padding: 22px 32px;
  background: #161616;
  border: 1px solid #252218;
  border-radius: 4px;
  color: #e8e0cc;
}

.info-block .label {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 10px;
  color: #5a5040;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-family: 'IBM Plex Mono', monospace;
}

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

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

.info-block .value a:hover {
  color: #ffc93a;
  text-shadow: 0 0 12px rgba(244,183,40,0.4);
}

/* Loader */
.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #252218;
  border-top-color: #f4b728;
  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: 4px; 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: -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: 13px; margin-top: 24px; letter-spacing: 2px; }
  .seo-section, .info-block { padding: 22px 18px; margin-top: 32px; }
  .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: 4px; }
  .mix-logo { width: 60px; height: 60px; margin-bottom: 14px; }
  .mix-title { font-size: 20px; }
  .panel-label { padding: 10px 14px; }
  .panel-header { padding: 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: 36px; height: 36px; margin: -18px auto; }
  .mix-form input[type="text"] { padding: 12px 14px; }
  .mix-submit { padding: 14px 18px; margin-top: 22px; }
}

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