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

:root {
  --bg: #090b13;
  --surface: #0e1120;
  --surface2: #141729;
  --surface3: #1b2035;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --accent: #7c6dfa;
  --accent2: #a78bfa;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #4a5568;
  --success: #34d399;
  --warning: #fbbf24;
  --sidebar-w: 230px;
  --radius: 14px;
  --radius-sm: 8px;
  --hdr: 72px;
}

html, body { height: 100%; font-family: 'Inter', 'Noto Sans SC', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
body { display: flex; }

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: relative;
}

/* subtle gradient glow at top */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,109,250,0.15), transparent 70%);
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--surface2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border2);
  flex-shrink: 0;
}

.brand-text { line-height: 1; }
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.brand-sub {
  font-size: 11px;
  color: var(--accent2);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 20px 10px;
}

.nav-group { padding: 0 10px; flex: 1; }

.nav-tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 4px;
  position: relative;
}

.nav-tab:hover { background: var(--surface2); color: var(--text); }

.nav-tab.active {
  background: rgba(124,109,250,0.15);
  color: var(--text);
}

.nav-tab.active .nav-icon { color: var(--accent); }

.nav-tab.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; }
.nav-label { flex: 1; text-align: left; }
.nav-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface3);
  color: var(--text3);
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.nav-tab.active .nav-count {
  background: rgba(124,109,250,0.25);
  color: var(--accent2);
}

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer-info {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text3);
}

.footer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.footer-version { font-size: 11px; color: var(--text3); }

/* ─── Main ─── */
.main {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 70% -10%, rgba(124,109,250,0.08), transparent),
    radial-gradient(ellipse 40% 30% at 100% 60%, rgba(96,165,250,0.05), transparent);
}

/* ─── Header ─── */
.main-header {
  height: var(--hdr);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(14,17,32,0.8);
  backdrop-filter: blur(12px);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-desc {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 9px 16px;
  width: 240px;
  transition: border-color 0.2s;
}

.search-box:focus-within { border-color: var(--accent); }
.search-box svg { color: var(--text3); flex-shrink: 0; }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.search-box input::placeholder { color: var(--text3); }

/* ─── Tab Panels ─── */
.tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}

.tab-panels::-webkit-scrollbar { width: 6px; }
.tab-panels::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Tool Grid ─── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ─── Tool Card ─── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
}

.tool-card:not(.coming-soon):hover {
  border-color: rgba(124,109,250,0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(124,109,250,0.1);
}

.tool-card.coming-soon {
  opacity: 0.65;
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.tool-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 20%, transparent), color-mix(in srgb, var(--c2) 10%, transparent));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  color: var(--c);
  flex-shrink: 0;
}

.tool-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.tool-badge.new {
  background: rgba(124,109,250,0.2);
  color: var(--accent2);
  border: 1px solid rgba(124,109,250,0.3);
}

.tool-badge.soon {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
}

.tool-badge:not(.new):not(.soon) {
  background: rgba(52,211,153,0.15);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.25);
}

.tool-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.tool-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
  flex: 1;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.tool-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
}

.tool-status.available { color: var(--success); }
.tool-status.soon-status { color: var(--warning); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.tool-status.available .status-dot {
  box-shadow: 0 0 6px currentColor;
  animation: pulse 2s ease-in-out infinite;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tool-btn:hover:not(.disabled) {
  background: var(--accent2);
  transform: translateX(2px);
}

.tool-btn.disabled {
  background: var(--surface3);
  color: var(--text3);
  cursor: default;
}

/* ─── Hidden cards during search ─── */
.tool-card.hidden { display: none; }
