/* ============================================
   ---
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #000000;
  color: #ffffff;
  line-height: 1.5;
  padding: 40px 20px;
  min-height: 100vh;
}

/* Container - точно по центру */
.mix-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

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

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

.mix-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

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

/* Exchange panel - главный контейнер */
.exchange-panel {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

/* Panel - общие стили */
.panel {
  flex: 1;
  background: #2a2b2f;
  border: 1px solid #3a3b3f;
  border-radius: 12px;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

/* Panel label - SEND / RECEIVE */
.panel-label {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #3a3b3f;
  background: #2a2b2f;
}

/* Panel header - поле ввода */
.panel-header {
  padding: 20px 16px;
  background: #2a2b2f;
  min-height: 80px;
  display: flex;
  align-items: center;
}

/* Input поле слева */
.from-panel .panel-header input {
  width: 100%;
  padding: 0;
  font-size: 32px;
  font-weight: 600;
  text-align: left;
  border: none;
  background: transparent;
  color: #ffffff;
  outline: none;
  font-family: inherit;
}

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

/* Receive справа */
.to-panel .panel-header .receive-big {
  font-size: 32px;
  font-weight: 600;
  color: #ffffff;
  width: 100%;
  display: block;
}

/* Select area */
.panel-select {
  padding: 12px 16px 16px;
  background: #2a2b2f;
  border-top: 1px solid #3a3b3f;
}

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

.select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #1a1b1f;
  border: 1px solid #404040;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.select-trigger:hover {
  border-color: #ff8c00;
}

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

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

.arrow {
  color: #888888;
  font-size: 12px;
  margin-left: auto;
  transition: transform 0.2s;
}

/* Options dropdown - ИСПРАВЛЕНО */
.options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1a1b1f;
  border: 1px solid #404040;
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  display: none; /* По умолчанию скрыт */
}

/* Когда открыт через JS */
.custom-select.active .options {
  display: block;
}

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

/* Search input внутри dropdown */
.search-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #404040;
  background: #2a2b2f;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

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

/* Group label */
.opt-group {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #1a1b1f;
  position: sticky;
  top: 0;
}

/* Option items */
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #2a2b2f;
}

.option:last-child {
  border-bottom: none;
}

.option:hover {
  background: #2a2b2f;
}

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

.option span {
  font-size: 14px;
  color: #ffffff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Swap button - точно по центру */
.mix-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: #ff8c00;
  border: 4px solid #000000;
  border-radius: 50%;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  padding: 0;
}

.mix-swap:hover {
  background: #e07a00;
  transform: translate(-50%, -50%) rotate(180deg);
}

/* Wallet section */
.mix-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #aaaaaa;
}

.mix-form input[type="text"] {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  border: 1px solid #3a3b3f;
  border-radius: 8px;
  background: #2a2b2f;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.mix-form input[type="text"]:focus {
  border-color: #ff8c00;
}

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

/* Submit button */
.mix-submit {
  width: 100%;
  padding: 18px;
  margin-top: 16px;
  background: #ff8c00;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.mix-submit:hover {
  background: #e07a00;
}

/* SEO Section */
.seo-section {
  margin-top: 48px;
  padding: 24px;
  background: #1a1b1f;
  border: 1px solid #333333;
  border-radius: 12px;
}

.seo-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #ffffff;
  line-height: 1.4;
}

.seo-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: #ffffff;
}

.seo-section p {
  margin-bottom: 16px;
  line-height: 1.7;
  color: #aaaaaa;
  font-size: 15px;
}

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

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

/* Contact block */
.info-block {
  margin-top: 24px;
  padding: 20px 24px;
  background: #1a1b1f;
  border: 1px solid #333333;
  border-radius: 12px;
  text-align: center;
}

.info-block .label {
  font-size: 14px;
  font-weight: 600;
  color: #888888;
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: normal;
  border: none;
  padding: 0;
  background: transparent;
}

.info-block .value p {
  margin: 0;
}

.info-block .value a {
  color: #ff8c00;
  text-decoration: none;
  font-weight: 500;
}

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

/* Loader */
.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #404040;
  border-top-color: #ff8c00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbar для dropdown */
.options::-webkit-scrollbar {
  width: 8px;
}

.options::-webkit-scrollbar-track {
  background: #1a1b1f;
  border-radius: 0 8px 8px 0;
}

.options::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 4px;
}

.options::-webkit-scrollbar-thumb:hover {
  background: #505050;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 20px 16px;
  }
  
  .mix-logo {
    width: 200px;
  }
  
  .mix-title {
    font-size: 22px;
  }
  
  .exchange-panel {
    flex-direction: column;
    gap: 12px;
  }
  
  .mix-swap {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 8px auto;
    order: 2;
    width: 44px;
    height: 44px;
    font-size: 18px;
    border-width: 3px;
  }
  
  .mix-swap:hover {
    transform: rotate(180deg);
  }
  
  .panel {
    order: 1;
  }
  
  .panel:last-child {
    order: 3;
  }
  
  .panel-header {
    min-height: 60px;
    padding: 16px;
  }
  
  .from-panel .panel-header input,
  .to-panel .panel-header .receive-big {
    font-size: 24px;
  }
  
  .seo-section {
    margin-top: 32px;
    padding: 16px;
  }
  
  .seo-section h2 {
    font-size: 18px;
  }
  
  .seo-section h3 {
    font-size: 16px;
  }
}