/* ================================================================
   tools-hub.css  —  JH Gamer Tools Hub
   Dark/Light theme, responsive, animated
================================================================ */

/* ── Google Font already loaded via HTML ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables (Dark theme default) ── */
:root {
  --bg:        #050d1a;
  --bg2:       #0b1628;
  --bg3:       #0f1e35;
  --surface:   rgba(15, 30, 60, 0.75);
  --border:    rgba(100, 160, 255, 0.15);
  --text:      #d0e0ff;
  --text-dim:  #7090c0;
  --accent:    #4fa3ff;
  --accent2:   #7b5fff;
  --success:   #3ddc84;
  --warning:   #ffb347;
  --danger:    #ff5c5c;
  --radius:    14px;
  --shadow:    0 8px 32px rgba(0,0,20,0.5);
  --transition: 0.3s ease;
}

[data-theme="light"] {
  --bg:        #f0f4ff;
  --bg2:       #e4ecff;
  --bg3:       #dbe5ff;
  --surface:   rgba(255,255,255,0.8);
  --border:    rgba(80,120,220,0.2);
  --text:      #1a2a50;
  --text-dim:  #5a6a90;
  --accent:    #2563eb;
  --accent2:   #6d28d9;
  --shadow:    0 8px 32px rgba(80,100,200,0.15);
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Default OS cursor is used — no custom cursor override */

/* ================================================================
   PARTICLE CANVAS
================================================================ */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

[data-theme="light"] #particle-canvas { opacity: 0.3; }

/* ================================================================
   HEADER
================================================================ */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 13, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

[data-theme="light"] .hub-header {
  background: rgba(240, 244, 255, 0.9);
}

.hub-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 62px;
}

.hub-logo {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.hub-logo span { color: var(--accent); }

.hub-nav {
  display: flex;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.hub-nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
}
.hub-nav-link:hover {
  color: var(--accent);
  background: rgba(79, 163, 255, 0.1);
}

/* ── Theme Toggle Button ── */
.theme-btn {
  width: 48px; height: 26px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--accent); }

.theme-icon {
  position: absolute;
  font-size: 0.9rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.theme-icon-light { opacity: 0; transform: translateY(20px); }
.theme-icon-dark  { opacity: 1; transform: translateY(0); }

[data-theme="light"] .theme-icon-light { opacity: 1; transform: translateY(0); }
[data-theme="light"] .theme-icon-dark  { opacity: 0; transform: translateY(-20px); }

/* ================================================================
   HERO
================================================================ */
.hub-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5rem 1rem 3rem;
}

.hub-hero-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  animation: fadeUp 0.7s ease both;
}
.hub-hero-title span { color: var(--accent); }

.hub-hero-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-top: 0.75rem;
  animation: fadeUp 0.7s 0.15s ease both;
}

/* ================================================================
   MAIN LAYOUT
================================================================ */
.hub-main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ================================================================
   SECTION HEADINGS
================================================================ */
.tool-section { margin-bottom: 4rem; }

.section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-tag {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.section-tag.security    { background: linear-gradient(135deg, #ff5c5c, #c0392b); }
.section-tag.productivity{ background: linear-gradient(135deg, #3ddc84, #2196f3); }

/* ================================================================
   TOOL CARDS GRID
================================================================ */
.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: fadeUp 0.5s ease both;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(79,163,255,0.18);
}

.tc-icon { font-size: 2rem; }

.tc-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.tc-body p {
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.tc-launch {
  margin-top: auto;
  align-self: flex-start;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.tc-launch:hover { opacity: 0.88; transform: scale(1.04); }

/* ================================================================
   TOOL PANELS
================================================================ */
.tool-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease both;
}
.tool-panel.open { display: block; }

.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tp-header h3 { font-size: 1.1rem; font-weight: 600; }

.tp-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.tp-close:hover { border-color: var(--danger); color: var(--danger); }

.tp-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}
.tp-textarea:focus { border-color: var(--accent); }

.tp-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}
.tp-input:focus { border-color: var(--accent); }

.tp-action-btn {
  display: inline-block;
  margin-top: 0.85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  padding: 0.65rem 1.75rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.tp-action-btn:hover { opacity: 0.88; transform: scale(1.02); }

.tp-output {
  margin-top: 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  line-height: 1.7;
  min-height: 60px;
}

.tp-stats {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.tp-sub-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 1.25rem 0 0.6rem;
}

.tp-intro {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ── Passive Voice highlight ── */
mark.passive {
  background: rgba(255, 180, 60, 0.35);
  border-radius: 3px;
  padding: 0 2px;
  color: var(--text);
}

/* ── Word Counter Stats Grid ── */
.wc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.wc-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  text-align: center;
}
.wc-stat span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.wc-stat label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ── Keyword density bars ── */
.wc-density { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }

.kw-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; }
.kw-word { min-width: 90px; color: var(--text); }
.kw-bar-wrap { flex: 1; height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.kw-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.6s ease; }
.kw-pct { min-width: 36px; text-align: right; color: var(--text-dim); }

/* ── Tone Output ── */
.tone-output {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tone-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.tone-label { min-width: 110px; }
.tone-bar-bg { flex: 1; height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.tone-bar-fill { height: 100%; border-radius: 99px; transition: width 0.7s ease; }
.tone-pct { min-width: 38px; text-align: right; color: var(--text-dim); font-size: 0.8rem; }
.tone-emoji { font-size: 1.3rem; }
.tone-summary {
  margin-top: 0.75rem;
  background: var(--bg2);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* ── Password Strength ── */
.pw-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.pw-eye {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 42px; height: 42px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.pw-eye:hover { border-color: var(--accent); }

.pw-meter-wrap {
  height: 6px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 1rem;
}
.pw-meter-bar {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--danger);
  transition: width 0.4s ease, background 0.4s ease;
}

.pw-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--text-dim);
}

.pw-tips {
  margin-top: 1rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pw-tips li { color: var(--text-dim); }
.pw-tips li.ok { color: var(--success); }

/* ── Age Calculator ── */
.age-form { display: flex; flex-direction: column; gap: 0.5rem; }
.age-form label { font-size: 0.82rem; color: var(--text-dim); }

.age-result {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}
.age-box {
  flex: 1;
  min-width: 90px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.age-box-val {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}
.age-box-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Life Progress Bar ── */
.life-result { margin-top: 1.5rem; }
.life-pct-num {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  text-align: center;
}
.life-bar-wrap {
  height: 18px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
  margin: 1rem 0;
}
.life-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(.22,1,.36,1);
}
.life-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.life-days-left {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

/* ── Decision Matrix ── */
.dm-setup { display: flex; flex-direction: column; gap: 0.5rem; }
.dm-setup label { font-size: 0.82rem; color: var(--text-dim); }

.dm-matrix { overflow-x: auto; margin-top: 1.5rem; }
.dm-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dm-matrix th, .dm-matrix td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  text-align: center;
}
.dm-matrix th {
  background: var(--bg2);
  color: var(--accent);
  font-weight: 600;
}
.dm-matrix input[type="number"] {
  width: 54px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.25rem 0.4rem;
  text-align: center;
  font-size: 0.82rem;
  outline: none;
}

.dm-result {
  margin-top: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text);
}

/* ── Dopamine Menu ── */
.dopa-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dopa-category h4 {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.dopa-activity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dopa-chip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.dopa-chip.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
}

.dopa-result {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dopa-slot {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  animation: fadeUp 0.4s ease both;
}
.dopa-slot-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 70px;
}

/* ================================================================
   FOOTER
================================================================ */
.hub-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ================================================================
   ANIMATIONS
================================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
  .hub-nav { gap: 0.5rem; }
  .hub-nav-link { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
}

@media (max-width: 640px) {
  .hub-nav { display: none; }
  .hub-header-inner { justify-content: space-between; }
  .hub-hero { padding: 3rem 1rem 2rem; }
  .tool-cards-grid { grid-template-columns: 1fr; }
  .wc-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tp-header { flex-direction: column; align-items: flex-start; }
  .tool-panel { padding: 1.25rem; }
  .hub-header { padding: 0 1rem; }
  .hub-main { padding: 0 1rem 3rem; }
}

@media (max-width: 480px) {
  .age-result { flex-direction: column; }
  .wc-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
