/* ─────────────────────────────────────────
   GrillzKonection · Telegram Mini-App
   Gold / Dark · 2026
───────────────────────────────────────── */

:root {
  --gold:    #E8A020;
  --gold-lo: rgba(232,160,32,.12);
  --gold-glow: rgba(232,160,32,.25);
  --bg:      #050508;
  --surface: rgba(255,255,255,.03);
  --border:  rgba(255,255,255,.08);
  --text:    #e8e8f0;
  --muted:   rgba(255,255,255,.35);
  --green:   #34d399;
  --blue:    #60a5fa;
  --purple:  #a78bfa;
  --red:     #f87171;
  --radius:  16px;
  --radius-sm: 10px;
}

/* ─── RESET ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { cursor: pointer; font: inherit; border: none; background: none; }
input, select, textarea { font: inherit; color: inherit; }
code { font-family: "SF Mono", "Fira Code", monospace; }

/* ─── LAYOUT ─────────────────────────────── */
.gk-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  background: rgba(5,5,8,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.gk-header__brand { display: flex; flex-direction: column; gap: 2px; }
.gk-header__label {
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  font-style: italic;
}
.gk-header__title { font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.gk-header__sub   { color: var(--muted); font-weight: 300; }
.gk-header__status {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #4b4b5a;
  transition: background .4s;
  box-shadow: 0 0 0 2px var(--border);
}
.gk-header__status.ok    { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,.5); }
.gk-header__status.error { background: var(--red);   box-shadow: 0 0 8px rgba(248,113,113,.5); }

/* ─── TABS ─────────────────────────────── */
.gk-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,8,.9);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 57px;
  z-index: 40;
}
.gk-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: color .2s;
  border-bottom: 2px solid transparent;
  position: relative;
}
.gk-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.gk-tab__icon { font-size: 18px; line-height: 1; }

/* ─── MAIN ─────────────────────────────── */
.gk-main { padding: 16px; padding-bottom: 32px; }
.gk-panel { display: none; flex-direction: column; gap: 14px; }
.gk-panel.active { display: flex; }

/* ─── STAT GRID ─────────────────────────── */
.gk-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gk-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gk-stat-card__label {
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.gk-stat-card__value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: "SF Mono", monospace;
  font-weight: 700;
}
.gk-stat-card__icon { font-size: 14px; }
.gk-green { color: var(--green); }
.gk-blue  { color: var(--blue);  }
.gk-purple{ color: var(--purple);}

/* ─── CARD ─────────────────────────────── */
.gk-card {
  background: rgba(0,0,0,.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.gk-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--gold-glow), transparent 50%);
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.gk-card:hover::before { opacity: .4; }
.gk-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gk-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--gold-lo);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.gk-icon-wrap.gk-blue   { background: rgba(96,165,250,.12); }
.gk-icon-wrap.gk-gold   { background: var(--gold-lo); }
.gk-card__title { font-size: 14px; font-weight: 700; }
.gk-card__sub   { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ─── MISSION ─────────────────────────── */
.gk-input-row { display: flex; gap: 8px; }
.gk-input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
}
.gk-input:focus { border-color: rgba(232,160,32,.4); }
.gk-textarea { resize: vertical; min-height: 80px; }
.gk-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}

.gk-btn-gold {
  width: 46px; height: 46px;
  min-width: 46px;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: #000;
  font-size: 22px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.gk-btn-gold:hover { box-shadow: 0 0 16px var(--gold-glow); }
.gk-btn-gold:active { transform: scale(.93); }
.gk-btn-gold:disabled { opacity: .4; pointer-events: none; }

.gk-btn-full {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color .2s, background .2s;
}
.gk-btn-full:hover { border-color: var(--gold); background: var(--gold-lo); }
.gk-btn-full.gk-btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

/* ─── QUICK ACTIONS ─────────────────────── */
.gk-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gk-quick-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: border-color .2s, color .2s;
}
.gk-quick-btn span:first-child { font-size: 22px; }
.gk-quick-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ─── ACTIVITY FEED ─────────────────────── */
.gk-section-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted);
  font-weight: 700;
  padding: 4px 0;
}
.gk-activity-list { display: flex; flex-direction: column; gap: 8px; }
.gk-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.015);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: var(--radius-sm);
}
.gk-activity-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.gk-activity-info { flex: 1; min-width: 0; }
.gk-activity-label { font-size: 12px; font-weight: 700; }
.gk-activity-time  { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.gk-activity-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.gk-activity-badge.gk-green { color: var(--green); }
.gk-activity-badge.gk-blue  { color: var(--blue);  }

/* ─── RESULT BOX ─────────────────────────── */
.gk-result {
  margin-top: 4px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.gk-result.error { border-color: rgba(248,113,113,.3); color: var(--red); }
.gk-result.success { border-color: rgba(52,211,153,.3); color: var(--green); }
.gk-result.hidden { display: none; }

.gk-img-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  max-height: 280px;
  object-fit: contain;
}

/* ─── CHAT ─────────────────────────────── */
.gk-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  gap: 0;
}
.gk-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.gk-chat-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.gk-chat-ai {
  align-self: flex-start;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.gk-chat-user {
  align-self: flex-end;
  background: var(--gold-lo);
  border: 1px solid rgba(232,160,32,.25);
  border-bottom-right-radius: 4px;
  color: #fff;
}
.gk-chat-controls {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gk-chat-modes { display: flex; gap: 6px; }
.gk-mode-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .2s;
}
.gk-mode-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}
.gk-chat-input-row { display: flex; gap: 8px; }

/* ─── PROFILE ─────────────────────────── */
.gk-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.gk-profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--gold-lo);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.gk-profile-name { font-size: 18px; font-weight: 800; }
.gk-profile-role { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .15em; }

.gk-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 12px;
}
.gk-info-row:last-child { border-bottom: none; }
.gk-info-key { color: var(--muted); }
.gk-info-val { font-weight: 600; font-family: "SF Mono", monospace; font-size: 11px; }

.gk-cmd-list { display: flex; flex-direction: column; gap: 8px; }
.gk-cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.gk-cmd-item code {
  background: var(--gold-lo);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
}

/* ─── LOADING SPINNER ─────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.gk-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ─── SCROLLBAR ─────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
