/* =====================================================================
 * GoMining brand tokens — приложение HTML Dashboards Hub
 * Источник: Brand Guideline v2.0 (Oct 2023)
 *   - Primary: Dark Purple #7540EF (lead), Black #0E0F1F, Gray #3C3C50,
 *              Mid Gray #CECEE1, Light Gray #F2F2F9, White
 *   - Secondary (accents only): #2E95FE (blue), #AB5BFA (violet),
 *              #D94DF2 (pink), #FF2B5E (red), #FBA705 (yellow),
 *              #1CCC8D (green)
 *   - Type: Atyp Display / Atyp Text — web fallback Inter (per guideline)
 * ===================================================================== */

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

:root {
  /* Brand primary */
  --gm-black:        #0E0F1F;
  --gm-purple:       #7540EF;
  --gm-gray:         #3C3C50;
  --gm-mid-gray:     #CECEE1;
  --gm-light-gray:   #F2F2F9;
  --gm-white:        #FFFFFF;

  /* Brand secondary (accents only — NOT main color) */
  --gm-blue:         #2E95FE;
  --gm-violet:       #AB5BFA;
  --gm-pink:         #D94DF2;
  --gm-red:          #FF2B5E;
  --gm-yellow:       #FBA705;
  --gm-green:        #1CCC8D;

  /* Tuned surface tokens (derived) */
  --surface-0:       #0E0F1F;       /* page bg */
  --surface-1:       #15172A;       /* card bg */
  --surface-2:       #1F2138;       /* card bg lifted / hover */
  --surface-3:       #2A2D45;       /* darker chip / inset */
  --border-default:  #3C3C50;
  --border-subtle:   #25273D;

  /* Text */
  --text-strong:     #FFFFFF;
  --text-default:    #F2F2F9;
  --text-muted:      #CECEE1;
  --text-dim:        #8E8FA8;

  /* Semantic */
  --accent:          #7540EF;       /* primary action / brand */
  --accent-hover:    #8A5CFF;
  --accent-soft:     rgba(117, 64, 239, 0.16);
  --positive:        #1CCC8D;
  --negative:        #FF2B5E;
  --warning:         #FBA705;
  --info:            #2E95FE;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Базовая типографика — применяется и к iframe-host'у, и через cascade к дашбордам */
html, body {
  font-family: var(--font-sans);
}

/* Brand mark — официальный символ GoMining из /static/gomining-symbol.png. */
.gm-mark {
  display: inline-block;
  width: 26px;
  height: 26px;
  background: url('gomining-symbol.png') center/contain no-repeat;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 16px rgba(117, 64, 239, 0.35));
}

.gm-wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}
.gm-wordmark .name { font-weight: 600; }
.gm-wordmark .sep { color: var(--text-dim); margin: 0 8px; font-weight: 400; }
.gm-wordmark .product { color: var(--text-muted); font-weight: 500; }

/* Refresh-bar overrides — единый акцент для всех дашбордов */
.dh-refresh-bar { background: rgba(14, 15, 31, 0.92) !important; border-bottom: 1px solid var(--border-default) !important; }
.dh-refresh-bar button[data-dh-refresh] {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px !important;
  border-radius: var(--radius-md) !important;
  transition: background 120ms ease, transform 60ms ease;
}
.dh-refresh-bar button[data-dh-refresh]:hover:not(:disabled) {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}
.dh-refresh-bar button[data-dh-refresh]:active:not(:disabled) {
  transform: translateY(1px);
}
/* Disabled (idle/loading) — не серая, а просто чуть менее яркая, чтобы было видно что доступна */
.dh-refresh-bar button[data-dh-refresh]:disabled {
  opacity: 0.75 !important;
  cursor: progress;
}
/* Когда загрузка идёт — лёгкое мерцание чтобы было понятно что busy */
.dh-refresh-bar button[data-dh-refresh].dh-busy {
  opacity: 0.85 !important;
  cursor: progress;
}
.dh-refresh-bar button[data-dh-clear-cache] {
  background: var(--surface-2) !important;
  border-color: var(--border-default) !important;
  color: var(--text-default) !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  transition: background 120ms ease;
}
.dh-refresh-bar button[data-dh-clear-cache]:hover { background: var(--surface-3) !important; color: var(--text-strong) !important; border-color: var(--accent) !important; }
.dh-refresh-bar .status[data-dh-kind="ok"]      { color: var(--positive) !important; }
.dh-refresh-bar .status[data-dh-kind="error"]   { color: var(--negative) !important; }
.dh-refresh-bar .status[data-dh-kind="loading"] { color: var(--info) !important; }
