/* css/sidebar.css — GradeKit Sidebar + Tool Page Layout */

/* ═══════════════════════════════════════
   TOOL PAGE LAYOUT (Sidebar + Content + Ads)
═══════════════════════════════════════ */
.tool-page-wrap {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 0;
  min-height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
  align-items: start;
}

/* Tablet: hide right ad zone */
@media (max-width: 1100px) {
  .tool-page-wrap {
    grid-template-columns: 240px 1fr;
  }
  .right-ad-zone { display: none; }
}

/* Mobile: hide sidebar, full width content */
@media (max-width: 768px) {
  .tool-page-wrap {
    grid-template-columns: 1fr;
  }
  .tool-sidebar { display: none; }
  .mobile-tool-tabs { display: flex !important; }
}

/* ═══════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════ */
.breadcrumb-bar {
  background: rgba(8, 11, 15, 0.6);
  border-bottom: 1px solid var(--border);
  padding: 10px var(--sp8);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.breadcrumb-bar a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.breadcrumb-bar a:hover { color: var(--bright); }
.breadcrumb-bar .bc-sep { opacity: 0.3; margin: 0 2px; }
.breadcrumb-bar .bc-active { color: var(--acid); }

/* ═══════════════════════════════════════
   LEFT SIDEBAR
═══════════════════════════════════════ */
.tool-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--sp4) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tool-sidebar::-webkit-scrollbar { width: 4px; }
.tool-sidebar::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 4px; }

/* Sidebar Groups */
.sb-group {
  margin-bottom: var(--sp5);
}

.sb-group-label {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  padding: var(--sp2) var(--sp5);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: var(--sp1);
}
.sb-group-label .sb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sidebar Items */
.sb-item {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: 9px var(--sp5);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 160ms, background 160ms, padding-left 160ms;
  position: relative;
  border-right: 2px solid transparent;
  line-height: 1.3;
}
.sb-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
}
.sb-item.active {
  color: var(--acid);
  background: var(--acid-halo);
  border-right-color: var(--acid);
  padding-left: calc(var(--sp5) + 4px);
}
.sb-item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-glow);
  flex-shrink: 0;
  transition: background 160ms;
}
.sb-item.active .sb-item-dot { background: var(--acid); }

.sb-badge-new {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  background: rgba(245,166,35,0.1);
  color: var(--gold);
  border: 1px solid rgba(245,166,35,0.25);
  padding: 1px 5px;
  border-radius: 100px;
}

.sb-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp3) var(--sp5);
}

/* Sidebar Ad Zone */
.sb-ad-zone {
  margin: var(--sp4) var(--sp4) 0;
  background: var(--raised);
  border: 1.5px dashed var(--border-glow);
  border-radius: var(--r2);
  padding: var(--sp4);
  text-align: center;
}
.sb-ad-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--sp3);
  opacity: 0.6;
}
.sb-ad-block {
  background: var(--deep);
  border-radius: var(--r1);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  opacity: 0.5;
}

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════ */
.tool-main {
  min-width: 0; /* Prevent overflow */
}

/* Tool Header Bar */
.tool-header-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp5) var(--sp8);
  display: flex;
  align-items: center;
  gap: var(--sp4);
}
.tool-hb-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r3);
  background: var(--raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tool-hb-info { flex: 1; min-width: 0; }
.tool-hb-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  margin: 0;
}
.tool-hb-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.tool-hb-right {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  flex-shrink: 0;
}

/* Settings Strip */
.tool-settings-strip {
  background: var(--raised);
  border-bottom: 1px solid var(--border);
  padding: var(--sp3) var(--sp8);
  display: flex;
  align-items: center;
  gap: var(--sp5);
  font-size: 12px;
  flex-wrap: wrap;
}
.ts-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ts-select {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238892A0' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--t-mid);
}
.ts-select:focus { border-color: var(--acid); }
.ts-badge { margin-left: auto; }

/* Ad zones */
.below-tool-ad {
  margin: var(--sp6) var(--sp8);
  background: var(--raised);
  border: 1.5px dashed var(--border-glow);
  border-radius: var(--r2);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  opacity: 0.5;
}

/* Right Ad Zone */
.right-ad-zone {
  position: sticky;
  top: 64px;
  padding: var(--sp6) var(--sp4);
  display: flex;
  flex-direction: column;
  gap: var(--sp4);
  border-left: 1px solid var(--border);
}
.right-ad-block {
  background: var(--raised);
  border: 1.5px dashed var(--border-glow);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp2);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  opacity: 0.5;
}
.right-ad-block:first-child { height: 250px; }
.right-ad-block:last-child  { height: 300px; }

/* ═══════════════════════════════════════
   MOBILE TAB STRIP (replaces sidebar on mobile)
═══════════════════════════════════════ */
.mobile-tool-tabs {
  display: none;
  overflow-x: auto;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  z-index: 1;
}
.mobile-tool-tabs::-webkit-scrollbar { display: none; }
.mobile-tab {
  padding: var(--sp3) var(--sp4);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  flex-shrink: 0;
}
.mobile-tab:hover { color: var(--text); text-decoration: none; }
.mobile-tab.active {
  color: var(--acid);
  border-bottom-color: var(--acid);
}

/* ═══════════════════════════════════════
   TOOL CONTENT PADDING
═══════════════════════════════════════ */
.tool-content-body {
  padding: var(--sp6) var(--sp8);
}

/* Related Tools Section */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp4);
  margin-top: var(--sp4);
}
@media (max-width: 600px) {
  .related-tools-grid { grid-template-columns: 1fr; }
  .tool-content-body { padding: var(--sp5) var(--sp4); }
  .tool-header-bar { padding: var(--sp4); }
  .tool-settings-strip { padding: var(--sp3) var(--sp4); }
}
