/* ==========================================================================
   ReweCoin Wallet — Design System
   Aligned with explorer.rewecoin.com: teal/turquoise primary, gold secondary
   ========================================================================== */

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

:root {
  /* --- Brand palette (mirrors explorer mainnet theme) --- */
  --bg:            #0B1518;
  --card:          #18252B;
  --card-raised:   #21323A;
  --border:        rgba(46, 211, 183, 0.15);
  --border-soft:   rgba(46, 211, 183, 0.08);
  --green:         #39FF14;
  --green-dim:     #1E7A45;
  --gold:          #2ED3B7;
  --gold-soft:     #6EE7D0;
  --coral:         #D2A94B;
  --coral-soft:    #E3C278;
  --text:          #F2F5F7;
  --text-secondary:#B6C0C8;
  --text-faint:    #7C8F97;
  --red:           #E05555;

  /* --- Derived glass / glow tokens --- */
  --glass-bg:      rgba(24, 37, 43, 0.72);
  --glass-border:  rgba(46, 211, 183, 0.20);
  --green-glow:    rgba(57, 255, 20, 0.30);
  --green-glow-soft: rgba(57, 255, 20, 0.12);
  --gold-glow:     rgba(46, 211, 183, 0.25);
  --coral-glow:    rgba(210, 169, 75, 0.30);
  --coral-glow-soft: rgba(210, 169, 75, 0.12);
  --shadow-deep:   0 20px 60px -20px rgba(0, 0, 0, 0.85);
  --shadow-card:   0 0 32px rgba(46, 211, 183, 0.20), 0 10px 34px -10px rgba(0, 0, 0, 0.6);

  /* --- Type --- */
  --font-display: 'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* --- Layout --- */
  --sidebar-w:    248px;
  --topnav-h:     72px;
  --radius-lg:    16px;
  --radius-md:    12px;
  --radius-sm:    8px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1100px 600px at 20% -10%, rgba(46,211,183,0.20), transparent 60%) fixed,
    radial-gradient(ellipse 700px 500px at 90% 30%, rgba(46,211,183,0.10), transparent 65%) fixed,
    radial-gradient(ellipse 700px 500px at 50% 100%, rgba(210,169,75,0.07), transparent 60%) fixed,
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 600;
}

p { color: var(--text-secondary); line-height: 1.6; margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--gold-glow); color: var(--text); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Glass card
   ========================================================================== */

.glass {
  background: linear-gradient(180deg, rgba(15,42,40,0.85), rgba(9,22,24,0.65));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card--hover:hover {
  border-color: var(--gold-soft);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--gold-glow), 0 0 30px -4px var(--gold-glow);
  transform: translateY(-2px);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 12px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
  color: #04211D;
  box-shadow: 0 0 0 1px rgba(30,215,190,0.4), 0 8px 24px -8px var(--gold-glow);
}
.btn--primary:hover {
  box-shadow: 0 0 0 1px var(--gold), 0 0 30px -4px var(--gold-glow);
  transform: translateY(-1px);
}

.btn--gold {
  background: linear-gradient(135deg, var(--coral-soft) 0%, var(--coral) 100%);
  color: #241900;
  box-shadow: 0 0 0 1px rgba(200,150,12,0.4), 0 8px 24px -8px var(--coral-glow);
}
.btn--gold:hover { box-shadow: 0 0 0 1px var(--coral), 0 0 30px -4px var(--coral-glow); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 13px; }

/* ==========================================================================
   Form controls
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}
.field input {
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  outline: none;
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.field-hint { font-size: 12px; color: var(--text-faint); }
.field-error { font-size: 12px; color: var(--red); }

.input-wrap { position: relative; }
.input-wrap .toggle-visibility {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.input-wrap .toggle-visibility:hover { color: var(--gold-soft); }

/* ==========================================================================
   Utilities
   ========================================================================== */

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-green { color: var(--green); }
.text-gold { color: var(--gold-soft); }
.text-secondary { color: var(--text-secondary); }
.text-faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.see-all { font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--gold-soft); }
.see-all:hover { text-decoration: underline; }

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge--up { background: var(--green-glow-soft); color: var(--green); }
.badge--pending { background: rgba(200, 150, 12, 0.14); color: var(--coral-soft); }
.badge--down { background: rgba(224, 85, 85, 0.12); color: #FF8794; }

/* ==========================================================================
   Chart
   ========================================================================== */

.chart-wrap { margin-top: 16px; }
.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
}
.chart-tab {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chart-tab:hover { color: var(--text); border-color: var(--text-faint); }
.chart-tab.active { color: var(--gold-soft); border-color: var(--gold-soft); background: var(--gold-glow); }

/* ==========================================================================
   Transactions table
   ========================================================================== */

.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.tx-table td {
  padding: 14px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.tx-table tbody tr:last-child td { border-bottom: none; }
.tx-name { font-weight: 600; color: var(--text); }
.tx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  margin-right: 12px;
  font-size: 15px;
  vertical-align: middle;
}
.tx-sub { font-size: 11px; font-weight: 400; color: var(--text-faint); margin-left: 44px; }

/* ==========================================================================
   Wallet panel
   ========================================================================== */

.wallet-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.wallet-addr-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.wallet-addr-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.copy-btn {
  background: var(--gold-glow);
  color: var(--gold-soft);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.copy-btn:hover { border-color: var(--gold-soft); }

/* ==========================================================================
   Quick actions
   ========================================================================== */

.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.qa-btn:hover { border-color: var(--gold-soft); transform: translateY(-2px); }
.qa-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ==========================================================================
   Mining card
   ========================================================================== */

.mining-card { padding: 24px; }
.mining-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.mining-stat b { display: block; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 16px; margin-bottom: 4px; font-weight: 600; }
.mining-stat span { font-size: 11px; color: var(--text-faint); }
.mining-progress { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.mining-progress__fill {
  height: 100%;
  width: 62%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 6px;
}

/* ==========================================================================
   App layout
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.main { min-width: 0; display: flex; flex-direction: column; }
.main__content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }

.grid { display: grid; gap: 20px; }
.grid--summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.gap-12 { gap: 12px; }

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background: rgba(17, 27, 32, 0.95);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
}
.mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #04211D;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 0 20px -4px var(--gold-glow);
}
.sidebar__brand .name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: var(--text); background: rgba(30, 215, 190, 0.06); }
.nav-link.active {
  color: var(--gold-soft);
  background: var(--gold-glow);
  border-color: rgba(30, 215, 190, 0.30);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-faint);
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
  margin-right: 8px;
}

/* ==========================================================================
   Top navigation
   ========================================================================== */

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: rgba(11, 21, 24, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 380px;
  height: 40px;
  padding: 0 14px;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  transition: border-color 0.2s ease;
}
.search-box:focus-within { border-color: var(--gold-soft); }
.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}
.topnav__right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.user-chip__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-soft), var(--coral-soft));
  color: #1A1300;
  font-size: 12px;
  font-weight: 700;
}
.user-chip__name { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip__role { display: block; font-size: 11px; color: var(--text-faint); }

/* ==========================================================================
   Hero, summary and chart cards
   ========================================================================== */

.hero-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}
.hero-eye {
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.2s ease;
}
.hero-eye:hover { color: var(--gold-soft); }
.price-now { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }

.summary-card { padding: 20px; }
.summary-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.summary-card__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-glow);
  color: var(--gold-soft);
  font-size: 16px;
}
.summary-card__label { font-size: 12px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.03em; }
.summary-card__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }

.chart-card { padding: 24px; }
.chart-tabs { display: flex; gap: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .grid--main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topnav { padding: 0 20px; }
  .main__content { padding: 20px 20px 40px; }
  .grid--summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid--summary { grid-template-columns: minmax(0, 1fr); }
  .search-box, .user-chip__name, .user-chip__role { display: none; }
  .tx-table th:nth-child(2), .tx-table td:nth-child(2) { display: none; }
}

/* Fixes: icon sizing, brand accent, notification dot */
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-box svg { width: 16px; height: 16px; flex-shrink: 0; }
.icon-btn { position: relative; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; margin: 0; }
.sidebar__brand .name span { color: var(--gold-soft); }
.sidebar__footer { display: flex; flex-direction: column; gap: 4px; }
.user-chip__avatar svg { width: 16px; height: 16px; }

/* Card ambient glow (Explorer-style hot spot) */
.card, .glass {
  position: relative;
  isolation: isolate;
}
.card::before, .glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(46,211,183,0.14), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* Coin mark (metallic medallion) */
.mark--coin {
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 0 8px rgba(46,211,183,0.45));
}

/* Network stats bar in topnav */
.net-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  margin: 0 8px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 40px;
}
.net-stat { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.net-stat__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.net-stat__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-soft);
}
@media (max-width: 1200px) {
  .net-stats { display: none; }
}

/* Summary cards — individual depth (Explorer-style) */
.summary-card {
  background:
    radial-gradient(circle at 85% 0%, rgba(46,211,183,0.10), transparent 65%),
    var(--glass-bg);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.summary-card:hover {
  transform: translateY(-3px);
  border-color: rgba(46,211,183,0.4);
  box-shadow: 0 0 30px rgba(46,211,183,0.22), 0 10px 30px -12px rgba(0,0,0,0.6);
}
.summary-card__icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-glow);
  color: var(--gold-soft);
  font-size: 15px;
  box-shadow: 0 0 14px rgba(46,211,183,0.25);
}
.summary-card__value {
  font-size: 24px;
  margin-top: 6px;
}

/* Receive button — premium gradient, not a flat block */
.btn--gold {
  background: linear-gradient(135deg, var(--coral-soft) 0%, var(--coral) 55%, #B08A38 100%);
  border: 1px solid rgba(210,169,75,0.5);
  box-shadow: 0 0 0 1px rgba(210,169,75,0.15), 0 10px 26px -10px rgba(210,169,75,0.45);
  color: #241a04;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.btn--gold:hover {
  box-shadow: 0 0 0 1px rgba(210,169,75,0.6), 0 0 34px -6px rgba(210,169,75,0.55);
  transform: translateY(-1px);
}

/* Quick action buttons — stronger hover glow */
.qa-btn {
  background: linear-gradient(180deg, rgba(33,50,58,0.7), rgba(24,37,43,0.5));
}
.qa-btn:hover {
  border-color: rgba(46,211,183,0.45);
  box-shadow: 0 0 22px rgba(46,211,183,0.18);
}
.qa-icon {
  box-shadow: 0 0 12px rgba(46,211,183,0.15);
}

/* Mining card accent */
.mining-card .mining-stat b.text-gold { text-shadow: 0 0 16px rgba(46,211,183,0.35); }
