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

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #1e293b;
  --accent-soft: #334155;
  --accent-2: #3b82f6;
  --binance: #fcd535;
  --binance-text: #1e2329;
  --ok-bg: #f0fdf4;
  --ok-text: #166534;
  --err-bg: #fef2f2;
  --err-text: #991b1b;
  --status-bg: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background: 
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    #f8fafc;
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
}

.card {
  background: var(--card);
  border-radius: 32px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-2), #60a5fa);
}

.page-title {
  text-align: center;
  margin-bottom: 8px;
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.meta-inline {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 24px;
  font-size: 1.05rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.meta-inline span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-row {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.btn-row-copy {
  grid-template-columns: repeat(3, 1fr);
}

.btn-row-actions {
  grid-template-columns: repeat(3, 1fr);
}

button {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  background: var(--accent);
  color: white;
  min-height: 48px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -5px rgba(15, 23, 42, 0.2);
  filter: brightness(1.1);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary {
  background: var(--accent-soft);
}

.primary-action {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.binance-btn {
  background: linear-gradient(135deg, #ffefad 0%, var(--binance) 100%);
  color: var(--binance-text);
  border: 1px solid #f0ca28;
}

.note-box {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: 20px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  position: relative;
}

.note-title {
  font-weight: 800;
  color: #0369a1;
  margin-bottom: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-text {
  color: #334155;
  font-size: 1rem;
  line-height: 1.8;
}

.status-box {
  margin-top: 32px;
}

.status-title {
  font-weight: 800;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

#statusLog {
  font-family: 'Share Tech Mono', 'Cairo', monospace;
  font-size: 1rem;
  background: #ffffff;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: #1e293b;
  max-height: 250px;
  min-height: 100px;
  overflow-y: auto;
  line-height: 1.6;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

#statusLog br {
  margin-bottom: 8px;
  display: block;
  content: "";
}

.summary {
  margin-top: 24px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  display: none;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary.ok {
  display: block;
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: #bbf7d0;
}

.summary.err {
  display: block;
  background: var(--err-bg);
  color: var(--err-text);
  border-color: #fecaca;
}

code.inline {
  background: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9em;
}

.progress-wrap {
  margin-top: 28px;
  display: none;
}

.progress-text {
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.progress-bar-bg {
  background: #f1f5f9;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  height: 100%;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 900px) {
  .btn-row-copy, .btn-row-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .binance-btn {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .wrap { padding: 20px 16px; }
  .card { padding: 30px 20px; border-radius: 24px; }
  .btn-row-copy, .btn-row-actions { grid-template-columns: 1fr; }
  .binance-btn { grid-column: auto; }
  .page-title { font-size: 2rem; }
}
