/* MiaoMi — tools.css | Terminal Academy | Sesi 13 */

/* ── Header ────────────────────────────────────────────────── */
.tools-header {
  padding: calc(var(--navbar-height) + var(--space-xl)) 0 0;
  background: var(--bg-void); position: relative; overflow: hidden;
}
.tools-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 70% at 20% 50%, rgba(76,175,80,0.04) 0%, transparent 55%);
  pointer-events: none;
}
.tools-header-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-lg); margin-bottom: var(--space-xl);
}
.tools-badge {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  color: #A5D6A7; text-transform: uppercase; margin-bottom: var(--space-sm);
}
.tools-headline    { font-size: clamp(1.8rem,4vw,3rem); font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); line-height: 1.1; }
.tools-subheadline { font-size: 0.9rem; color: var(--text-secondary); margin-top: var(--space-xs); max-width: 440px; }

.tools-search-wrap { position: relative; flex-shrink: 0; }
.tools-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.tools-search {
  width: 260px; padding: 10px 16px 10px 38px;
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font-ui); font-size: 0.875rem; outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tools-search:focus { border-color: #A5D6A7; box-shadow: 0 0 0 3px rgba(76,175,80,0.12); }
.tools-search::placeholder { color: var(--text-muted); }

.tools-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 1px; border-bottom: 1px solid var(--border-hairline);
}
.tools-tabs::-webkit-scrollbar { display: none; }
.tools-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px; background: transparent; border: none;
  border-bottom: 2px solid transparent; color: var(--text-muted);
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0; margin-bottom: -1px;
}
.tools-tab:hover { color: var(--text-primary); }
.tools-tab.active { color: #A5D6A7; border-bottom-color: #A5D6A7; font-weight: 700; }

/* ── Terminal Window ───────────────────────────────────────── */
.terminal-section { padding: var(--space-xl) 0; background: var(--bg-void); }

.terminal-window {
  background: #0a0c10; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  font-family: var(--font-mono);
}

.term-titlebar {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 10px var(--space-lg);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-hairline);
}
.term-dots { display: flex; gap: 6px; }
.term-dot  { width: 12px; height: 12px; border-radius: 50%; }
.term-dot-red    { background: #ff5f57; }
.term-dot-yellow { background: #ffbd2e; }
.term-dot-green  { background: #28c840; }

.term-title { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.04em; flex: 1; text-align: center; }

.term-clear-btn {
  background: transparent; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 0.65rem; padding: 2px 8px;
  cursor: pointer; transition: all var(--transition-fast);
}
.term-clear-btn:hover { color: var(--text-primary); border-color: var(--border-active); }

.term-output {
  min-height: 200px; max-height: 320px; overflow-y: auto;
  padding: var(--space-lg); display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: var(--border-subtle) transparent;
}

.term-line { font-size: 0.82rem; line-height: 1.6; }
.term-line.cmd    { color: #A5D6A7; }
.term-line.output { color: #90CAF9; }
.term-line.error  { color: #EF9A9A; }
.term-line.info   { color: var(--text-muted); }
.term-line.success{ color: #A5D6A7; }
.term-line .term-ps  { color: var(--orange-fire); margin-right: 6px; }

.term-input-row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-hairline);
  background: rgba(255,255,255,0.02);
}
.term-prompt { color: #A5D6A7; font-size: 0.85rem; flex-shrink: 0; }
.term-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #A5D6A7; font-family: var(--font-mono); font-size: 0.82rem;
  caret-color: #A5D6A7;
}
.term-input::placeholder { color: var(--text-muted); }

/* ── Tools Grid ────────────────────────────────────────────── */
.tools-section { padding: var(--space-xl) 0 var(--space-2xl); background: var(--bg-void); }
.tools-grid-header { display: flex; align-items: center; margin-bottom: var(--space-lg); }
.tools-count { font-size: 0.82rem; color: var(--text-secondary); }
.tools-count strong { color: var(--text-primary); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: var(--space-lg); }

.tool-card {
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  cursor: pointer; transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex; flex-direction: column; gap: var(--space-md);
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 0 1px rgba(76,175,80,0.2);
  border-color: rgba(76,175,80,0.3);
}
.tool-card:focus-visible { outline: 2px solid #A5D6A7; outline-offset: 3px; }
.tool-card.hidden { display: none; }

.tool-card-top { display: flex; align-items: flex-start; gap: var(--space-md); }
.tool-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
  background: rgba(76,175,80,0.12); border: 1px solid rgba(76,175,80,0.2);
}

.tool-cat-badge {
  display: inline-flex; padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.cat-adb      { background: rgba(76,175,80,0.14); color:#A5D6A7; border:1px solid rgba(76,175,80,0.25); }
.cat-utility  { background: var(--orange-glow); color: var(--orange-fire); border:1px solid rgba(255,85,0,0.25); }
.cat-tutorial { background: rgba(33,150,243,0.14); color:#90CAF9; border:1px solid rgba(33,150,243,0.25); }

.tool-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.tool-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6; }

.tool-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-tag {
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 0.62rem; font-family: var(--font-mono);
  background: var(--bg-surface-2); color: var(--text-muted);
  border: 1px solid var(--border-hairline);
}

.tool-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-sm); border-top: 1px solid var(--border-hairline);
}
.tool-meta { font-size: 0.68rem; color: var(--text-muted); font-family: var(--font-mono); }

.btn-tool-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--radius-md);
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition-fast); border: none;
}
.btn-tool-run {
  background: rgba(76,175,80,0.14); color: #A5D6A7;
  border: 1px solid rgba(76,175,80,0.3);
}
.btn-tool-run:hover { background: rgba(76,175,80,0.28); transform: scale(1.04); }
.btn-tool-dl {
  background: var(--orange-glow); color: var(--orange-fire);
  border: 1px solid rgba(255,85,0,0.3);
}
.btn-tool-dl:hover { background: var(--orange-fire); color: #fff; }

@media (max-width: 768px) {
  .tools-header-inner { flex-direction: column; align-items: flex-start; }
  .tools-search { width: 100%; }
  .tools-grid { grid-template-columns: 1fr; }
  .term-output { max-height: 200px; }
}
