/* ============================================
   Root Theme Variables
============================================ */
:root {
  --primary-color: #00597a;
  --accent-color: #00d4ff;
  --background-color: #1e1e2f;
  --gradient-mid: #1e1e2f;
  --text-color: #e6f2ff;
  --heading-color: #f0f0f0;
  --label-color: #cddde8;
  --balance-color: #d0f0f9;
  --warning-color: #ff6666;
  --success-color: #66bb6a;
  --success-hover: #4da64d;
  --button-color: #007aaf;
  --button-hover: #009be3;
  --placeholder-color: #b0c4d1;
  --input-border: #88b8d9;
  --fee-color: #9ecae8;
  --wallet-bg: #003248;
  --score-border-color: #00bcd4;
  --error-border-color: #e74c3c;
}

/* ============================================
   Global Scroll Lock (for Modals)
============================================ */
body.no-scroll {
  overflow: hidden;
  height: 100vh;
  position: fixed;
  width: 100%;
}

/* ============================================
   Modal Overlay and Main Modal
============================================ */
.conversion-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(to bottom, var(--background-color), var(--primary-color), var(--gradient-mid));
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Close Button (shared) */
.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s;
  touch-action: manipulation;
}
.close-btn:hover {
  color: #fff;
}

/* ============================================
   Headings
============================================ */
h2 {
  margin: 0 auto;
  font-size: 24px;
  text-align: center;
  font-weight: 600;
  padding-bottom: 12px;
  width: 100%;
}

/* ============================================
   Asset List
============================================ */
#asset-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#asset-list::-webkit-scrollbar {
  width: 14px;
}
#asset-list::-webkit-scrollbar-track {
  background: var(--primary-color);
  border-radius: 6px;
}
#asset-list::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 6px;
}

.asset-item {
  display: flex;
  align-items: center;
  background-color: var(--wallet-bg);
  padding: 14px 18px;
  border-left: 0.6vw solid var(--score-border-color);
  border-right: 0.6vw solid var(--score-border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
  user-select: none;
}
.asset-item:hover {
  background: rgba(51, 51, 51, 0.9);
}

.asset-icon {
  width: 36px;
  height: 36px;
  margin-right: 14px;
  border-radius: 50%;
  object-fit: contain;
}

.asset-name {
  flex-grow: 1;
  font-weight: 700;
  font-size: 19px;
  color: var(--text-color);
}

.asset-balance {
  font-size: 15px;
  color: #aaa;
  min-width: 70px;
  text-align: right;
  font-family: monospace;
}

/* ============================================
   Available Balance
============================================ */
.available-balance {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--balance-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-right: 8px;
}

/* ============================================
   Forms and Inputs
============================================ */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 400px;
  width: 100%;
}

label {
  font-weight: 600;
  font-size: 15px;
  color: var(--label-color);
}

input[type="text"],
input[type="number"] {
  width: 90%;
  padding: 14px 16px;
  font-size: 17px;
  border: 1.5px solid var(--input-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-color);
  backdrop-filter: blur(3px);
  transition: border-color 0.3s ease;
}
input::placeholder {
  color: var(--placeholder-color);
}
input:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* ============================================
   Buttons (including MAX and Submit)
============================================ */
#withdrawForm button,
#maxwithdrawal {
  background: var(--button-color);
  color: #dff9ff;
  width: 90px;
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 10px 0;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}
#withdrawForm button:hover,
#maxwithdrawal:hover {
  background: var(--button-hover);
}

/* ============================================
   Fee Text
============================================ */
#withdrawFee {
  font-size: 14px;
  font-style: italic;
  color: var(--fee-color);
  margin-bottom: 18px;
}

/* ============================================
   Message Area
============================================ */
.message {
  margin-top: 10px;
  font-size: 15px;
  color: var(--warning-color);
  min-height: 20px;
  font-weight: 700;
}

/* ============================================
   Back Button
============================================ */
#backToAssets {
  position: fixed;
  background: transparent;
  color: var(--success-color);
  font-weight: 700;
  font-size: 15px;
  margin-left: -90px;
  top: -10px;
  align-self: flex-end;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}
#backToAssets:hover {
  color: var(--success-hover);
  text-decoration: underline;
}

/* ============================================
   Modals (Success / Error Messages)
============================================ */
.modal-box {
  background-color: var(--wallet-bg);
  padding: 12px 18px;
  border-radius: 12px;
  text-align: center;
  width: 80%;
  max-width: 380px;
  border-radius: 30px;
  border-left: 0.6vw solid var(--score-border-color);
  border-right: 0.6vw solid var(--score-border-color);
  color: #e0e7ff; /* light bluish text */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  animation: fadeIn 0.3s ease forwards;
  position: relative;
}

.modal-box h3 {
  margin-bottom: 15px;
  font-size: 22px;
  font-weight: 700;
  color: #f0f8ff; /* lighter accent */
}

.modal-box p {
  font-size: 16px;
  color: #cbd5e1; /* soft light text */
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Modal Overlay Background
============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

/* ============================================
   Responsive Styling
============================================ */
@media (max-width: 480px) {
  .conversion-form {
    padding: 18px 14px 30px;
  }
  h2 {
    font-size: 20px;
  }
  button,
  input[type="text"],
  input[type="number"] {
    font-size: 16px;
  }
  form {
    max-width: 100%;
  }
  .available-balance {
    font-size: 14px;
    padding-right: 4px;
  }
  #maxwithdrawal {
    width: 80px;
    font-size: 14px;
  }
  #backToAssets {
    font-size: 14px;
    margin-top: 24px;
  }
  .asset-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
  }
  .asset-name {
    font-size: 16px;
  }
  .asset-balance {
    font-size: 13px;
    min-width: 55px;
  }
}