/* Indiagram Tools - shared shell wrapping every standalone tool page.
   Clean, responsive, accessible sidebar navigation with category dropdowns. */

:root {
  --ig-primary: #FF4D00;
  --ig-accent: #c82573;
  --ig-accent-light: #fff1f6;
  --ig-accent-dark: #a91f5f;
  --ig-border: #e4e4e7;
  --ig-bg: #fafafa;
  --ig-card: #ffffff;
  --ig-text: #18181b;
  --ig-text-muted: #71717a;
}

html.ig-dark, .dark {
  --ig-primary: #FF6B1A;
  --ig-accent: #FF4D00;
  --ig-accent-light: rgba(255, 77, 0, 0.12);
  --ig-accent-dark: #FF6B1A;
  --ig-border: rgba(255, 255, 255, 0.1);
  --ig-bg: #0a0a0a;
  --ig-card: #141416;
  --ig-text: #ffffff;
  --ig-text-muted: #9ca3af;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.ig-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  background: var(--ig-bg);
  color: var(--ig-text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ==================== Left Sidebar ==================== */
.ig-shell-sidebar {
  position: sticky;
  top: 0;
  flex-shrink: 0;
  width: 288px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--ig-border);
  padding: 1.25rem 1rem 1.5rem 1.25rem;
  background: var(--ig-card);
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: #d4d4d8 transparent;
}

.ig-shell-sidebar::-webkit-scrollbar {
  width: 5px;
}
.ig-shell-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.ig-shell-sidebar::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 4px;
}

.ig-sidebar-header {
  margin-bottom: 1rem;
}

.ig-sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 8px;
}

.ig-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.ig-sidebar-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.2);
  transition: transform 0.18s ease;
}

.ig-sidebar-brand:hover .ig-sidebar-logo-img {
  transform: scale(1.05);
}

.ig-sidebar-title-group {
  display: flex;
  flex-direction: column;
}

.ig-sidebar-brand-name {
  font-family: 'Space Grotesk', ui-sans-serif, sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ig-text);
  line-height: 1.15;
}

.ig-sidebar-brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--ig-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ig-sidebar-count-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--ig-accent-light);
  color: var(--ig-accent);
  border: 1px solid rgba(200, 37, 115, 0.2);
  white-space: nowrap;
}

.ig-sidebar-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ig-text-muted);
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.ig-sidebar-back-link:hover {
  color: var(--ig-accent);
  transform: translateX(-2px);
}

/* Quick Site Nav inside Sidebar */
.ig-sidebar-site-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 10px 0 12px;
  padding: 6px;
  border-radius: 12px;
  background: var(--ig-bg);
  border: 1px solid var(--ig-border);
}

.ig-quick-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 8px;
  color: var(--ig-text-muted);
  text-decoration: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.ig-quick-nav-item svg {
  width: 15px;
  height: 15px;
  transition: transform 0.15s ease;
}

.ig-quick-nav-item:hover {
  background: rgba(255, 77, 0, 0.09);
  color: var(--ig-primary);
  transform: translateY(-1px);
}

.ig-quick-nav-item:hover svg {
  transform: scale(1.12);
}

.ig-quick-nav-item.active {
  background: var(--ig-accent-light);
  color: var(--ig-accent);
  border: 1px solid rgba(200, 37, 115, 0.25);
}

/* Category Eyebrow & Toggle All */
.ig-sidebar-cat-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 6px;
  margin: 10px 0 4px;
  border-top: 1px solid var(--ig-border);
}

.ig-cat-eyebrow-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ig-text-muted);
  text-transform: uppercase;
}

.ig-toggle-all-cats {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ig-accent);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.ig-toggle-all-cats:hover {
  background: var(--ig-accent-light);
}

/* Pulse live dot */
.ig-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 5px;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: igPulse 2s infinite;
  vertical-align: middle;
}

@keyframes igPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Footer & Theme Toggle */
.ig-sidebar-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ig-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ig-sidebar-foot-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--ig-bg);
  border: 1px solid var(--ig-border);
  color: var(--ig-text);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.ig-sidebar-foot-btn svg {
  width: 15px;
  height: 15px;
  color: var(--ig-text-muted);
}

.ig-sidebar-foot-btn:hover {
  background: var(--ig-accent-light);
  border-color: var(--ig-accent);
  color: var(--ig-accent);
}

.ig-sidebar-foot-btn:hover svg {
  color: var(--ig-accent);
}

.ig-sidebar-ver-tag {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ig-text-muted);
  text-align: center;
  margin-top: 4px;
}

/* Search Box */
.ig-sidebar-search-box {
  position: relative;
  margin-bottom: 1rem;
}

.ig-sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ig-text-muted);
  pointer-events: none;
}

.ig-shell-search {
  width: 100%;
  box-sizing: border-box;
  border-radius: 9px;
  border: 1px solid var(--ig-border);
  background: var(--ig-bg);
  padding: 8px 30px 8px 32px;
  font-size: 12.5px;
  color: var(--ig-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ig-shell-search:focus {
  border-color: var(--ig-accent);
  background: var(--ig-card);
  box-shadow: 0 0 0 3px rgba(200, 37, 115, 0.12);
}

.ig-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #e4e4e7;
  color: #71717a;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.ig-search-clear:hover {
  background: #d4d4d8;
  color: #18181b;
}

.ig-search-result-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--ig-accent);
  margin-top: 4px;
  display: none;
  padding-left: 2px;
}

/* ==================== Category Dropdowns (Accordions) ==================== */
.ig-shell-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ig-shell-cat {
  border-radius: 9px;
  margin-bottom: 2px;
  transition: background 0.15s ease;
}

.ig-shell-cat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ig-text-muted);
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.ig-shell-cat-label:hover {
  background: rgba(0, 0, 0, 0.035);
  color: var(--ig-text);
}

.ig-shell-cat.is-current > .ig-shell-cat-label {
  color: var(--ig-accent);
}

.ig-cat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ig-cat-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: inherit;
}

.ig-cat-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ig-cat-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ig-text-muted);
}

.ig-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--ig-text-muted);
}

/* Accordion open / collapsed */
.ig-shell-cat.is-collapsed > .ig-shell-cat-label .ig-chevron {
  transform: rotate(-90deg);
}

.ig-shell-cat > .ig-shell-cat-label .ig-chevron {
  transform: rotate(0deg);
}

.ig-shell-cat.is-collapsed > .ig-shell-list {
  display: none !important;
}

.ig-shell-list {
  list-style: none;
  margin: 2px 0 6px 12px;
  padding: 2px 0 2px 8px;
  border-left: 1.5px solid var(--ig-border);
}

.ig-shell-list li {
  margin: 1px 0;
}

.ig-shell-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12.5px;
  color: #4b5563;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
  line-height: 1.35;
}

html.ig-dark .ig-shell-list a {
  color: #9ca3af;
}

.ig-shell-list a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ig-text);
  transform: translateX(2px);
}

.ig-shell-list a.active {
  background: var(--ig-accent-light);
  color: var(--ig-accent);
  font-weight: 700;
  border-left: 2px solid var(--ig-accent);
  padding-left: 6px;
}

.ig-shell-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f472a6;
  flex-shrink: 0;
}

.ig-shell-list a.active .ig-shell-dot {
  background: var(--ig-accent);
  box-shadow: 0 0 6px rgba(200, 37, 115, 0.5);
}

/* ==================== Main Content Layout ==================== */
.ig-shell-main {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--ig-bg);
}

.ig-shell-main > .tool-hero,
.ig-shell-main > main {
  width: 100%;
}

.ig-shell-main .container,
.ig-shell-main .container-wide {
  width: min(100% - 3rem, 1280px);
  max-width: none;
  margin-inline: auto;
}

.ig-shell-main .tool-card {
  width: 100%;
  max-width: none;
  padding: clamp(1.25rem, 2.5vw, 2.25rem);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.ig-shell-main img,
.ig-shell-main iframe,
.ig-shell-main canvas,
.ig-shell-main video {
  max-width: 100%;
}

.ig-shell-main input,
.ig-shell-main select,
.ig-shell-main textarea,
.ig-shell-main button {
  max-width: 100%;
}

/* ==================== Mobile Navigation ==================== */
.ig-mobile-topbar {
  display: none;
}

.ig-mobile-drawer-overlay {
  display: none;
}

@media (max-width: 900px) {
  .ig-shell {
    display: block;
  }
  
  .ig-shell-sidebar {
    display: none;
  }

  /* Mobile sticky top bar */
  .ig-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 45;
    background: var(--ig-card);
    border-bottom: 1px solid var(--ig-border);
    padding: 10px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .ig-mobile-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ig-text);
  }

  .ig-mobile-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: block;
  }

  .ig-mobile-page-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ig-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .ig-mobile-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ig-accent-light);
    color: var(--ig-accent);
    border: 1px solid rgba(200, 37, 115, 0.25);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  /* Mobile Slide-over Drawer */
  .ig-mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .ig-mobile-drawer-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
    display: block;
  }

  .ig-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    background: var(--ig-card);
    z-index: 101;
    overflow-y: auto;
    padding: 1.25rem 1rem 2rem 1.25rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .ig-mobile-drawer-overlay.is-active .ig-mobile-drawer {
    transform: translateX(0);
  }

  .ig-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ig-border);
  }

  .ig-mobile-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ig-border);
    background: var(--ig-bg);
    color: var(--ig-text);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
}

/* ==================== AdSense Placement Placeholder Slots ==================== */
.ig-ad-slot {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: #fbfbfd;
  border: 1.5px dashed rgba(200, 37, 115, 0.25);
  border-radius: 12px;
  margin: 18px auto;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

html.ig-dark .ig-ad-slot,
.dark .ig-ad-slot {
  background: #141416;
  border-color: rgba(255, 107, 26, 0.3);
}

.ig-ad-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

html.ig-dark .ig-ad-badge,
.dark .ig-ad-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #6b7280;
}

.ig-ad-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: inherit;
  padding: 16px 12px;
}

.ig-ad-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html.ig-dark .ig-ad-box,
.dark .ig-ad-box {
  color: #6b7280;
}

/* Slot Types */
.ig-ad-display {
  max-width: 970px;
  min-height: 90px;
}

.ig-ad-in-article {
  max-width: 780px;
  min-height: 120px;
}

.ig-ad-in-feed {
  min-height: 120px;
}

.ig-ad-multiplex {
  max-width: 970px;
  min-height: 160px;
}
