/* ══════════════════════════════════════════════
   hacks.css — chromebook hacks page styles
══════════════════════════════════════════════ */

/* ── variables ── */
:root {
  --bg:          #090909;
  --surface:     #101010;
  --border:      #1d1d1d;
  --border-mid:  #282828;
  --text:        #999;
  --text-dim:    #333;
  --text-bright: #ddd;
  --accent:      #d4a017;
  --accent-pale: rgba(212,160,23,0.08);
  --blue:        #7eb8f7;
  --yellow:      #f7c948;
  --green:       #4caf72;
  --purple:      #c47ef7;
  --red:         #cf5050;
  --font:        'IBM Plex Mono', monospace;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(212, 160, 23, 0.2);
  color: var(--text-bright);
}

/* ── custom scrollbars ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ═══════════════════════════════════
   LOCK SCREEN
═══════════════════════════════════ */
#lockScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.lk-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lk-title {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-bright);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.lk-cursor {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: var(--accent);
  margin-left: 3px;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.lk-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 44px;
  letter-spacing: 0.03em;
}

.lk-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
}

.lk-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 24px;
  padding: 13px;
  text-align: center;
  letter-spacing: 0.25em;
  outline: none;
  transition: border-color 0.12s;
  caret-color: var(--accent);
}

.lk-input:focus { border-color: var(--border-mid); }
.lk-input::placeholder { color: var(--text-dim); letter-spacing: 0.15em; }

.lk-input.err {
  border-color: var(--red);
  animation: shake 0.32s var(--ease);
  color: var(--red);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-8px); }
  40%,80%  { transform: translateX(8px); }
}

.lk-btn {
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  letter-spacing: 0.08em;
}

.lk-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

.lk-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.lk-back {
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.12s;
}

.lk-back:hover { color: var(--text); }

/* ═══════════════════════════════════
   HACKS PAGE
═══════════════════════════════════ */
#hacksPage {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── sticky header ── */
.hk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hk-title {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-bright);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.hk-sub-title {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 300;
  margin-left: 8px;
}

.hk-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

/* category dot legend */
.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  color: var(--text-dim);
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.leg-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.leg-dot.keyboard { background: var(--blue); }
.leg-dot.js       { background: var(--yellow); }
.leg-dot.flag     { background: var(--green); }
.leg-dot.url      { background: var(--purple); }

.hk-back {
  padding: 5px 13px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hk-back:hover { border-color: var(--border-mid); color: var(--text); }

/* ── sticky toolbar ── */
.hk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 11px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 57px;
  z-index: 29;
}

.hk-search {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.12s;
  caret-color: var(--accent);
}

.hk-search:focus { border-color: var(--border-mid); }
.hk-search::placeholder { color: var(--text-dim); }

.hk-sort {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  padding: 7px 11px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.hk-sort:focus { border-color: var(--border-mid); color: var(--text); }

.hk-sort option { background: var(--surface); color: var(--text); }

/* category filter buttons */
.cat-filters { display: flex; gap: 5px; flex-wrap: wrap; }

.cat-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cat-btn:hover { border-color: var(--border-mid); color: var(--text); }

.cat-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

.hk-count {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
}

/* ═══════════════════════════════════
   HACK LIST ITEMS
═══════════════════════════════════ */
.hk-list { flex: 1; }

.hk-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.hk-item:last-child { border-bottom: none; }
.hk-item:hover { background: var(--surface); }

/* colored category dot */
.hk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hk-dot.keyboard { background: var(--blue); }
.hk-dot.js       { background: var(--yellow); }
.hk-dot.flag     { background: var(--green); }
.hk-dot.url      { background: var(--purple); }

/* text info */
.hk-info { flex: 1; min-width: 0; }

.hk-name {
  font-size: 12px;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-desc {
  font-size: 10.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

/* category badge */
.hk-badge {
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 1px 7px;
  border: 1px solid;
  flex-shrink: 0;
}

.hk-badge.keyboard { color: var(--blue);   border-color: rgba(126,184,247,0.3); }
.hk-badge.js       { color: var(--yellow); border-color: rgba(247,201,72,0.3);  }
.hk-badge.flag     { color: var(--green);  border-color: rgba(76,175,114,0.3);  }
.hk-badge.url      { color: var(--purple); border-color: rgba(196,126,247,0.3); }

/* ── run button ── */
.hk-run {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.hk-run:hover { border-color: var(--border-mid); color: var(--text); }

/* runnable = actually executes something */
.hk-run.runnable {
  border-color: rgba(76, 175, 114, 0.35);
  color: var(--green);
}

.hk-run.runnable:hover {
  border-color: var(--green);
  background: rgba(76, 175, 114, 0.07);
}

/* show-only = just shows key combo */
.hk-run.show-only {
  border-color: var(--border);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.hk-run.show-only:hover { border-color: var(--border-mid); color: var(--text); }

/* empty state */
.hk-none {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 2;
}

/* ═══════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 11.5px;
  padding: 9px 20px;
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════
   KEY COMBO MODAL
═══════════════════════════════════ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 9, 0.92);
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.overlay.open { display: flex; }

.key-box {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  padding: 36px 28px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  animation: modal-in 0.16s var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.key-title {
  font-size: 14px;
  color: var(--text-bright);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.key-combo {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.key-cap {
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-bottom: 3px solid var(--border-mid);
  padding: 7px 13px;
  font-size: 12px;
  color: var(--text-bright);
  border-radius: 3px;
  font-family: var(--font);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.key-plus {
  font-size: 11px;
  color: var(--text-dim);
}

.key-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.key-note {
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.55;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.key-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  padding: 7px 24px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  letter-spacing: 0.04em;
}

.key-close:hover { border-color: var(--border-mid); color: var(--text); }

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 700px) {
  /* hide legend, keep category buttons */
  .legend { display: none; }

  .hk-header { padding: 14px 16px; }
  .hk-toolbar { padding: 10px 16px; }
  .hk-item { padding: 10px 16px; gap: 10px; }
}

@media (max-width: 560px) {
  /* hide badges on small screens to save space */
  .hk-badge { display: none; }
  .hk-count { display: none; }

  .hk-toolbar { gap: 6px; }
  .cat-btn { padding: 3px 9px; font-size: 9.5px; }

  .hk-run { padding: 5px 10px; font-size: 10.5px; }

  .key-box { padding: 28px 18px; }
  .key-cap { padding: 5px 10px; font-size: 11px; }
}

@media (max-width: 420px) {
  .lk-form { width: 200px; }
  .lk-input { font-size: 20px; padding: 11px; }

  .hk-title { font-size: 16px; }
  .hk-sub-title { display: none; }

  .hk-search { min-width: 120px; }
  .hk-sort { display: none; }

  .hk-desc { display: none; }
  .hk-name { font-size: 11.5px; }
}
