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

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

body {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  padding: 40px 20px;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(247,147,26,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(247,147,26,0.04) 0%, transparent 50%);
}

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

/* Container */
.mix-container {
  width: 100%;
  max-width: 1000px;
  background: #111111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 40px;
  box-shadow:
    0 0 0 1px rgba(247,147,26,0.08),
    0 24px 64px rgba(0,0,0,0.8),
    0 0 80px rgba(247,147,26,0.04);
  position: relative;
  overflow: hidden;
}

.mix-container::before {
  content: '₿';
  position: absolute;
  top: -30px;
  right: -20px;
  font-size: 220px;
  font-weight: 900;
  color: rgba(247,147,26,0.04);
  pointer-events: none;
  line-height: 1;
  user-select: none;
}

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

.mix-logo {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 16px rgba(247,147,26,0.5));
}

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

/* 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: #0d0d0d;
  border: 1px solid #222222;
  border-radius: 12px;
  overflow: visible;
  transition: border-color 0.2s;
}

.panel:hover {
  border-color: rgba(247,147,26,0.3);
}

/* Panel Label */
.panel-label {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid #1a1a1a;
}

/* 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: 36px;
  font-weight: 800;
  text-align: right;
  border: none;
  background: transparent;
  color: #f7931a;
  outline: none;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -1px;
}

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

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

/* 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 #222222;
  border-radius: 8px;
  background: #161616;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: #f7931a;
  background: rgba(247,147,26,0.06);
}

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

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

.arrow {
  font-size: 12px;
  color: #f7931a;
  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: #111111;
  padding: 0;
  border: 1px solid #f7931a;
  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.8), 0 0 24px rgba(247,147,26,0.15);
}

.options::-webkit-scrollbar { width: 6px; }
.options::-webkit-scrollbar-track { background: #111111; }
.options::-webkit-scrollbar-thumb { background: #f7931a; border-radius: 4px; }
.options::-webkit-scrollbar-thumb:hover { background: #e8820a; }

/* Search Input */
.search-input {
  position: sticky;
  top: 0;
  width: 100%;
  height: 48px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid #1e1e1e;
  background: #161616;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  border-radius: 10px 10px 0 0;
  z-index: 2;
  font-family: 'Space Grotesk', sans-serif;
}

.search-input::placeholder { color: #444444; }

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

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

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

.option:hover {
  background: rgba(247,147,26,0.08);
  color: #ffffff;
}

.option.selected {
  background: rgba(247,147,26,0.1);
  color: #f7931a;
  box-shadow: inset 3px 0 0 #f7931a, inset 0 -1px 0 #1a1a1a;
}

.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: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f7931a;
  border: 3px solid #0a0a0a;
  color: #000000;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.25s;
  box-shadow: 0 0 20px rgba(247,147,26,0.5);
  font-weight: 900;
}

.mix-swap:hover {
  background: #ffaa33;
  transform: translate(-50%, -50%) rotate(180deg);
  box-shadow: 0 0 32px rgba(247,147,26,0.8);
}

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

.mix-form input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #222222;
  border-radius: 10px;
  background: #0d0d0d;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: 'Space Grotesk', monospace;
}

.mix-form input[type="text"]:focus {
  border-color: #f7931a;
  box-shadow: 0 0 0 3px rgba(247,147,26,0.12);
}

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

/* Submit Button */
.mix-submit {
  display: block;
  width: 100%;
  background: #f7931a;
  color: #000000;
  border: none;
  padding: 18px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 32px;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(247,147,26,0.4);
  font-family: 'Space Grotesk', sans-serif;
  position: relative;
  overflow: hidden;
}

.mix-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.mix-submit:hover {
  background: #ffaa33;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(247,147,26,0.6);
}

.mix-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(247,147,26,0.4);
}

/* SEO Section */
.seo-section {
  max-width: 800px;
  margin: 48px auto 0;
  padding: 32px;
  background: #111111;
  border: 1px solid #222222;
  border-radius: 14px;
  color: #888888;
}

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

.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: #111111;
  border: 1px solid #222222;
  border-radius: 14px;
  color: #ffffff;
}

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

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

.info-block .value a {
  color: #f7931a;
  text-decoration: none;
  font-weight: 600;
  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 #222222;
  border-top-color: #f7931a;
  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-container::before { font-size: 140px; top: -10px; right: -10px; }
  .mix-title { font-size: 22px; }

  .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: 28px; max-width: 100%; text-align: center; }

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

  .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: 14px; }
  .mix-logo { width: 64px; height: 64px; margin-bottom: 16px; }
  .mix-title { font-size: 20px; }
  .panel-label { padding: 10px 14px; font-size: 10px; }
  .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: 42px; height: 42px; margin: -21px auto; }
  .mix-form input[type="text"] { padding: 12px 14px; font-size: 14px; }
  .mix-submit { padding: 14px 18px; margin-top: 24px; }
}

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