/* ===== Layout wiring to template hooks ===== */
    :root { --sidebar-w: 260px; --header-h: 64px; }
    html, body { overflow-x: hidden; width: 100%; position: relative; }
    :root {
      --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
      --glass-bg: rgba(255, 255, 255, 0.1);
      --glass-border: rgba(255, 255, 255, 0.2);
      --shadow-light: 0 8px 32px rgba(31, 38, 135, 0.37);
      --shadow-medium: 0 15px 35px rgba(31, 38, 135, 0.2);
      --shadow-heavy: 0 25px 50px rgba(31, 38, 135, 0.3);
    }

    body { background: var(--bg, #fff); color: var(--fg, #111); }

    /* Fixed sidebar (full height, scrollable) */
    .ai-sidebar {
      position: fixed;
      top: 0; left: 0;
      width: var(--sidebar-w);
      height: 100vh;
      overflow-y: auto;
      overflow-x: hidden;
      border-right: 1px solid #e9ecef;
      background: var(--bg, #fff);
      z-index: 1000;
      padding: 16px 12px;
    }
    .ai-sidebar .brand {
      display:flex; align-items:center; gap:8px;
      text-decoration:none; font-weight:600; margin-bottom: 16px;
    }
    .ai-sidebar .brand img { width: 36px; height: 36px; object-fit: contain; }
    .ai-sidebar .menu-title { font-weight: 600; margin-bottom: 4px; }
    .ai-sidebar .menu-sub { color:#6b7280; font-size: 0.875rem; }

    .ai-sidebar .cat-link {
      display:block; padding:.5rem .75rem; border-radius: .65rem;
      text-decoration:none;
    }
    .ai-sidebar .cat-link:hover { background: #f4f6f9; }

    /* Main column (header + content + footer) */
    .ai-main {
      margin-left: var(--sidebar-w);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* Sticky header inside main column */
    .ai-header {
      position: sticky; top: 0; z-index: 1020;
      background: var(--bg, #fff);
      border-bottom: 1px solid #e9ecef;
      min-height: var(--header-h);
    }

    /* Search pill look */
    .ai-search {
      max-width: 680px; width:100%;
      display:flex; gap:8px; align-items: center;
    }
    .ai-search input {
      border-radius: 9999px; padding: .65rem 1rem;
      flex: 1 1 auto; min-width: 0; /* Important for preventing overflow in flexbox */
    }
    .ai-search .btn {
      border-radius: 9999px; padding: .55rem 1rem;
      flex: 0 0 auto;
    }

    /* Header actions */
    .ai-actions .btn {
      border:1px solid #e5e7eb; background: transparent;
      padding:.5rem .65rem; border-radius: .65rem;
    }
    .ai-actions .btn:hover { background: #f6f7f9; }

    /* Footer styling */
    .site-footer .container { max-width: 1200px; }
    .site-footer h6 { font-weight: 600; }
    .site-footer .text-muted { color:#6b7280 !important; }
    .footer-links li + li { margin-top: .25rem; }
    .footer-links a { text-decoration: none; }
    .footer-links a:hover { text-decoration: underline; }
    .social .social-btn {
      width:36px;height:36px;border-radius:9999px;
      display:inline-flex;align-items:center;justify-content:center;
      border:1px solid #e5e7eb;text-decoration:none;font-size:1.05rem;
    }
    .social .social-btn:hover { background:#f3f4f6; }

    /* Dark theme */
    :root[data-theme="dark"] { --bg:#0f1115; --fg:#e5e7eb; --border:#232838; }
    :root[data-theme="dark"] .ai-sidebar { border-right-color:#232838; }
    :root[data-theme="dark"] .ai-sidebar .cat-link:hover { background:#1b2233; }
    :root[data-theme="dark"] .ai-header { background:#0f1115; border-bottom-color:#232838; }
    :root[data-theme="dark"] .ai-actions .btn { border-color: var(--border); color: var(--fg); }
    :root[data-theme="dark"] .social .social-btn { border-color:#232838; }
    :root[data-theme="dark"] .social .social-btn:hover { background:#1b2233; }

    /* Mobile: optional drawer behavior */
    @media (max-width: 991.98px){
      .ai-sidebar { transform: translateX(-100%); transition: transform .3s ease; }
      .ai-sidebar.show { transform: translateX(0); }
      .ai-main { margin-left: 0; }
    }


/* Sidebar: pin head & foot, scroll only the list */
.ai-sidebar{
  display:flex;
  flex-direction:column;
  overflow:hidden; /* prevent whole sidebar from scrolling */
}

.ai-sidebar-head{
  padding: 0 0 8px 0;
  background: var(--bg, #fff); /* ensures clean top when list scrolls under */
  z-index: 1;
}

.ai-sidebar-list{
  flex: 1 1 auto;
  min-height: 0;          /* important so child can actually scroll */
  overflow-y: auto;       /* only this section scrolls */
  overscroll-behavior: contain;
}

.ai-sidebar-foot{
  background: var(--bg, #fff);
  padding-top: 8px;
  z-index: 1;
}

/* Dark theme borders stay consistent */
:root[data-theme="dark"] .ai-sidebar-foot{ border-top-color:#232838; }


.fatools-search-btn {
      position: absolute;
      right: 4px;
      top: 50%;
      transform: translateY(-50%);
      border-radius: 50px;
      padding: 0.5rem 1.5rem;
      background: var(--primary-gradient);
      border: none;
      font-weight: 600;
      font-size: 0.9rem;
      transition: all 0.3s ease;
      box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    }

  .fatools-search-btn:hover {
      transform: translateY(-50%) translateY(-1px);
      box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    
    
    /* Breadcrumb Styling */
/* --- Breadcrumb (destination look) --- */
.breadcrumb-clean .breadcrumb-item + .breadcrumb-item::before {
  /* bootstrap-icons chevron-right (optional) */
  content: '\F285';
  font-family: 'bootstrap-icons';
  color: #9ca3af; /* gray-400 */
  font-size: 0.85rem;
}
.breadcrumb-clean .breadcrumb-link {
  color: #6b7280; /* gray-500 */
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}
.breadcrumb-clean .breadcrumb-link:hover {
  color: #111827; /* gray-900 */
}
.breadcrumb-clean .breadcrumb-item.active {
  color: #374151; /* gray-700 */
  font-weight: 500;
}

/* --- Tool icon (64x64 square with rounded corners, border, shadow) --- */
.tool-icon {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.75rem; /* ~ rounded-xl */
  background: #e5e7eb; /* gray-200 fallback */
  border: 2px solid #fff;
  box-shadow: 0 0.25rem 0.9rem rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 1;
}

/* Subtle glow layer behind icon (like your screenshot) */
.tool-icon-glow {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  border-radius: 0.75rem;
  background: rgba(59, 130, 246, 0.18); /* blue-ish */
  filter: blur(10px);
  opacity: 0.35;
  transform: translate(-2px, -2px);
  z-index: 0;
  pointer-events: none;
}


/* toggle sidebar code 2-10-25 */
/* Smooth transitions (safe everywhere) */
.ai-sidebar,
.ai-main {
  transition: all 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .ai-sidebar,
  .ai-main {
    transition: none;
  }
}

/* Default positions */
.ai-sidebar {
  transform: translateX(0);
}

/* --- DESKTOP-ONLY COLLAPSE --- */
#sidebarCollapseBtn {
  display: none;
}
@media (min-width: 768px) {
  /* Show button only on desktop */
  #sidebarCollapseBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  /* Only on desktop, the collapsed class hides sidebar & frees width */
  body.sidebar-collapsed .ai-sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .ai-main {
    margin-left: 0;
  }
}

/* Optional (unchanged): full-height tool viewport */
.tool-viewport,
.tool-viewport iframe {
  width: 100%;
  border: 0;
}
.tool-viewport {
  min-height: calc(100vh - var(--header-h));
}

/* Smooth transitions are fine globally */
.ai-sidebar,
.ai-main {
  transition: all 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .ai-sidebar,
  .ai-main {
    transition: none;
  }
}

/* Desktop collapse stays as you had it (only on ≥768px) */
#sidebarCollapseBtn {
  display: none;
}
@media (min-width: 768px) {
  #sidebarCollapseBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  body.sidebar-collapsed .ai-sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .ai-main {
    margin-left: 0;
  }
}

/* ---- MOBILE: default closed, slide in when "sidebar-open" on <body> ---- */
@media (max-width: 767.98px) {
  /* Main content should not reserve sidebar space on mobile */
  .ai-main {
    margin-left: 0;
  }

  /* Sidebar off-canvas by default */
  .ai-sidebar {
    transform: translateX(-100%);
    z-index: 1050; /* above overlay */
    background: var(--bg, #fff);
    box-shadow: none;
  }

  /* When open: slide in + lock body scroll */
  body.sidebar-open .ai-sidebar {
    transform: translateX(0);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  }
  body.sidebar-open {
    overflow: hidden;
  }

  /* Overlay */
  #aiOverlay[hidden] {
    display: none !important;
  }
  body.sidebar-open #aiOverlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040; /* just under the sidebar */
  }
}

/* (Optional) tool viewport helper */
.tool-viewport,
.tool-viewport iframe {
  width: 100%;
  border: 0;
}
.tool-viewport {
  min-height: calc(100vh - var(--header-h));
}


/* SHARE SECTION WRAPPER */
.share-group {
  background: linear-gradient(135deg, #fdfbfb, #ebedee); /* subtle glossy gradient */
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Add slight glow on hover of the entire box */
.share-group:hover {
  background: linear-gradient(135deg, #ffffff, #f1f3f6);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Button circle styling */
.share-group .btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  color: #444;
}

/* Lift effect */
.share-group .btn:hover {
  transform: translateY(-2px) scale(1.05);
  color: #fff !important;
}

/* Native share (gray tone) */
.share-group #btnNativeShare {
  background: #f8f9fa;
}
.share-group #btnNativeShare:hover {
  background: #6c757d;
  border-color: #6c757d;
}

/* Social brand colors */
.share-group a[href*="twitter.com"]:hover {
  background: #000;
  border-color: #000;
}
.share-group a[href*="facebook.com"]:hover {
  background: #1877F2;
  border-color: #1877F2;
}
.share-group a[href*="linkedin.com"]:hover {
  background: #0A66C2;
  border-color: #0A66C2;
}
.share-group a[href*="whatsapp.com"]:hover {
  background: #25D366;
  border-color: #25D366;
}

/* Add soft pulsing glow animation */
.share-group .btn:hover {
  animation: sharePulse 0.7s ease-out;
}

@keyframes sharePulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

/* Share count style */
.share-group span.text-muted {
  font-weight: 600;
  color: #555 !important;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.share-group {
  background: linear-gradient(135deg, #e3f2fd, #ffffff); /* bluish tone */
}

/* ===== Gradient Try Tool Button ===== */
/* Base gradient button */
.btn-gradient {
  background: var(--primary-gradient);
  color: #fff !important;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  padding: 0.45rem 1.25rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

/* Hover → full green gradient */
.btn-gradient:hover {
  background: linear-gradient(90deg, #16a34a, #22c55e); /* emerald → lime green */
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45); /* soft green glow */
}

/* Active click effect */
.btn-gradient:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* Dark theme hover glow */
:root[data-theme='dark'] .btn-gradient:hover {
  box-shadow: 0 6px 22px rgba(34, 197, 94, 0.55);
}



/* ==== Sidebar Category Styling ==== */

/* Default link look */
.ai-sidebar .cat-link {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--fg, #111);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient backgrounds (random hue) */
.ai-sidebar .cat-link:nth-child(6n+1) {
  background: linear-gradient(135deg, #e0e7ff, #f0f4ff);
}
.ai-sidebar .cat-link:nth-child(6n+2) {
  background: linear-gradient(135deg, #e6fffa, #f0fffe);
}
.ai-sidebar .cat-link:nth-child(6n+3) {
  background: linear-gradient(135deg, #fff3bf, #fff9db);
}
.ai-sidebar .cat-link:nth-child(6n+4) {
  background: linear-gradient(135deg, #ffe3e3, #fff0f0);
}
.ai-sidebar .cat-link:nth-child(6n+5) {
  background: linear-gradient(135deg, #f3d9fa, #f8edff);
}
.ai-sidebar .cat-link:nth-child(6n+6) {
  background: linear-gradient(135deg, #e6fcf5, #f1fff8);
}

/* Hover animation */
.ai-sidebar .cat-link:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Active state (current category) */
.ai-sidebar .cat-link.active {
  background: var(--primary-gradient);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

/* Small animated shimmer (optional subtle glow) */
.ai-sidebar .cat-link::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(255, 255, 255, 0.25);
  transition: opacity 0.3s ease;
}
.ai-sidebar .cat-link:hover::after {
  opacity: 1;
}

/* ==== Dark Theme ==== */
:root[data-theme='dark'] .ai-sidebar .cat-link {
  color: #e5e7eb;
  background: linear-gradient(135deg, #1a1d27, #202637);
  border: 1px solid #232838;
}
:root[data-theme='dark'] .ai-sidebar .cat-link.active {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 0 15px rgba(118, 75, 162, 0.6);
}
:root[data-theme='dark'] .ai-sidebar .cat-link:hover {
  background: linear-gradient(135deg, #23283a, #2a3044);
  transform: translateX(4px);
}


/* ==== Animated aurora border for sidebar logo (Gemini effect) ==== */
/* ==== Animated gradient text (Gemini-style brand name) ==== */
.brand-name-aurora {
  background: linear-gradient(90deg,
    #7c3aed,
    #4f46e5,
    #06b6d4,
    #22c55e,
    #f59e0b,
    #ef4444,
    #7c3aed
  );
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  animation: auroraGradientText 6s linear infinite;
  letter-spacing: 0.2px;
}

/* Dark theme contrast: brighter colors */
:root[data-theme="dark"] .brand-name-aurora {
  background: linear-gradient(90deg,
    #a78bfa,
    #60a5fa,
    #34d399,
    #fbbf24,
    #f87171,
    #c084fc,
    #a78bfa
  );
}

/* Animation */
@keyframes auroraGradientText {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ==== Mobile Brand (smaller gradient text) ==== */
.brand-name-mobile {
  font-size: 0.9rem;
  background: linear-gradient(90deg,
    #7c3aed,
    #4f46e5,
    #06b6d4,
    #22c55e,
    #f59e0b,
    #ef4444,
    #7c3aed
  );
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: auroraGradientText 6s linear infinite;
}

/* Dark mode for mobile brand */
:root[data-theme="dark"] .brand-name-mobile {
  background: linear-gradient(90deg,
    #a78bfa,
    #60a5fa,
    #34d399,
    #fbbf24,
    #f87171,
    #c084fc,
    #a78bfa
  );
}


/* ===== Responsive pager ===== */
.pager-scroll {
  width: 100%;
  overflow-x: auto;                 /* allow horizontal scroll on small screens */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;              /* keep shadow/rounded from being clipped */
}

/* Make the pagination line up horizontally without wrapping off-screen */
.pager-scroll .pagination {
  display: inline-flex;             /* keep it one line */
  flex-wrap: nowrap;                /* no wrap */
  white-space: nowrap;              /* prevent numbers from wrapping */
  margin-bottom: 0;
}

/* Tap-friendly targets on small screens */
.pager-scroll .page-link {
  min-width: 40px;
  text-align: center;
}

/* Tighten spacing on very small screens */
@media (max-width: 576px) {
  .pager-scroll .page-link {
    padding: 0.45rem 0.6rem;
  }
}


/* Responsive strip */
.pager-scroll{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  padding-bottom:4px;
}
.pager-scroll .pagination{
  display:inline-flex;
  flex-wrap:nowrap;
  white-space:nowrap;
  margin-bottom:0;
}
.pager-scroll .page-link{
  min-width:40px;
  text-align:center;
}

/* Gemini-style active pill (full green gradient) */
.pager-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
  text-align: center;
}

.pagination {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.pagination .page-link {
  min-width: 40px;
  text-align: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

.pagination .page-item.disabled .page-link {
  background: transparent;
  color: #aaa;
  border: none;
}

@media (max-width: 576px) {
  .pagination .page-link {
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
  }
}

/* --- OVAL PAGER --- */
.pager-scroll .pagination-oval {
  display: inline-flex;
  align-items: center;
  gap: 0;                 /* items touch each other */
  background: var(--bg, #fff);
  border-radius: 9999px;  /* outer oval */
  padding: 4px;           /* inner breathing space */
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* reset circle pills → make them a continuous strip */
.pager-scroll .pagination-oval .page-link {
  border-radius: 0 !important;         /* no radius in the middle */
  border: 1px solid rgba(0,0,0,.08);
  border-left: 0;                       /* seams disappear inside the strip */
  background: transparent;
  color: var(--fg, #111);
  min-width: 2.25rem;
  padding: .45rem .75rem;
  line-height: 1;
  transition: all .2s ease;
}

/* first & last = rounded ends (d … D) */
.pager-scroll .pagination-oval .page-item:first-child .page-link {
  border-left: 1px solid rgba(0,0,0,.08);
  border-top-left-radius: 9999px !important;
  border-bottom-left-radius: 9999px !important;
  padding-left: 0.9rem;
}
.pager-scroll .pagination-oval .page-item:last-child .page-link {
  border-top-right-radius: 9999px !important;
  border-bottom-right-radius: 9999px !important;
  padding-right: 0.9rem;
}

/* ellipsis: keep in flow but unclickable */
.pager-scroll .pagination-oval .page-item.disabled .page-link {
  background: transparent;
  color: #9aa0a6;
  border-color: rgba(0,0,0,.08);
  cursor: default;
}

/* hover */
.pager-scroll .pagination-oval .page-link:hover {
  background: rgba(0,0,0,.04);
}

/* active = full green gradient pill */
.pager-scroll .pagination-oval .page-item.active .page-link {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(34,197,94,.35);
}

/* arrows look like normal items */
.pager-scroll .pagination-oval .page-link[aria-label="Previous"],
.pager-scroll .pagination-oval .page-link[aria-label="Next"] {
  font-weight: 600;
}

/* dark theme tweaks */
:root[data-theme="dark"] .pagination-oval {
  background: #0f1115;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
:root[data-theme="dark"] .pagination-oval .page-link {
  color: #e5e7eb;
  border-color: #232838;
}
:root[data-theme="dark"] .pagination-oval .page-link:hover {
  background: #1b2233;
}



/* Base */
.btn-gradient{
  background: var(--primary-gradient);
  color:#fff !important;
  border:0;
  border-radius:9999px;
  padding:.45rem 1.1rem;
  transition:all .25s ease;
  box-shadow:0 4px 14px rgba(102,126,234,.35);
}

/* Force green hover */
.btn.btn-gradient:hover{
  background: linear-gradient(90deg, #16a34a, #22c55e) !important;
  box-shadow: 0 6px 20px rgba(34,197,94,.45);
  transform: translateY(-1px);
}


/* Ensure card/section establishes a stacking context */
.fatools-card .card-body { position: relative; }

/* Bootstrap's stretched-link uses ::after – keep it below the button */
.fatools-card .stretched-link::after { z-index: 1; }

/* Lift the button above the stretched-link overlay */
.fatools-card .btn-gradient { position: relative; z-index: 2; }

/* --- SIDEBAR STABILITY PATCH --- */
/* 1) Sidebar never scrolls — only the list scrolls */
.ai-sidebar {
  overflow: hidden !important;      /* override earlier overflow-y:auto */
}

/* 2) Scroll only the list; keep dimensions stable */
.ai-sidebar-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;

  /* Reserve scrollbar gutter so width/height never changes */
  scrollbar-gutter: stable both-edges;  /* modern browsers */
  padding-right: 4px;                   /* avoid text hugging scrollbar */
}

/* 3) Footer stays pinned and won’t get pulled into the scroll area */
.ai-sidebar-foot {
  flex-shrink: 0;
  position: sticky;   /* keeps it visually steady even during tiny reflows */
  bottom: 0;
  background: var(--bg, #fff);
  border-top: 1px solid var(--border, #e9ecef);
  z-index: 1;
}

/* 4) Smooth, non-janky scrollbar feedback (no layout shift) */
.ai-sidebar-list::-webkit-scrollbar { width: 8px; }
.ai-sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.2);
  border-radius: 4px;
}
.ai-sidebar-list:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.35);
}

/* 5) Dark theme parity */
:root[data-theme="dark"] .ai-sidebar-foot {
  background: var(--bg, #0f1115);
  border-top-color: #232838;
}
:root[data-theme="dark"] .ai-sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
}
:root[data-theme="dark"] .ai-sidebar-list:hover::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.32);
}

/* Related tools "Open" button hover effect (match Try Tool green glow) */
/* Ensure the card creates a stacking context */
.related-tools .card,
.related-tools .card-body { position: relative; }

/* Push the stretched-link overlay *behind* interactive elements */
.related-tools .card .stretched-link::after {
  z-index: 0;             /* default Bootstrap often sets it higher */
}

/* Bring the button above the overlay so it can receive :hover */
.related-tools .card .card-body .btn {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Your green hover override */
.related-tools .card .card-body a.btn.btn-gradient.btn-sm:hover,
.related-tools .card .card-body button.btn.btn-gradient.btn-sm:hover,
.related-tools .card .card-body a.btn.btn-gradient.btn-sm:focus,
.related-tools .card .card-body button.btn.btn-gradient.btn-sm:focus {
  background-image: linear-gradient(135deg, #28a745, #34d058) !important;
  background-color: transparent !important;
  border-color: #28a745 !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(40, 167, 69, 0.5) !important;
  transition: all .2s ease-in-out;
}

/* Unified Tool Header Alignment */
/* Single-line tool header: icon + title */
.tool-hero .tool-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 56px;
}

/* White background for the icon */
.tool-hero .tool-icon-wrap {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  background: #fff;                 /* <- white background */
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;                      /* keeps any colored icon from touching edges */
}

.tool-hero .tool-icon {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Title stays on the same line; ellipsis on mobile if too long */
.tool-hero .tool-h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slightly smaller on very small screens */
@media (max-width: 575px) {
  .tool-hero .tool-icon-wrap { width: 48px; height: 48px; padding: 6px; }
  .tool-hero .tool-h1 { font-size: 1.1rem; }
}


/* Unified gradient header: icon + title in one line */
.tool-hero .tool-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.3;
  background: linear-gradient(135deg, #6a5ae0, #764ba2);
  border-radius: 10px;
  padding: 10px 18px;
  box-shadow: 0 4px 10px rgba(118, 75, 162, 0.25);
  margin: 0;
}

/* Icon inside white background */
.tool-hero .tool-header .tool-icon-wrap {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-hero .tool-header .tool-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 2px;
}

/* Responsive adjustment */
@media (max-width: 575px) {
  .tool-hero .tool-header {
    font-size: 1.05rem;
    padding: 8px 14px;
    gap: 8px;
  }
  .tool-hero .tool-header .tool-icon-wrap {
    width: 40px;
    height: 40px;
  }
  .tool-hero .tool-header .tool-icon {
    width: 28px;
    height: 28px;
  }
}

/* Footer skin to match theme */
.ai-footer{
  position: relative;
  background: var(--bg,#fff);
  border-top: 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,.04) inset;
}
.ai-footer::before{
  content:"";
  position:absolute; left:0; right:0; top:0; height:4px;
  background: var(--primary-gradient);
  opacity:.9;
}

/* Section titles with subtle gradient text */
.ai-footer .footer-title{
  font-weight: 700;
  background: linear-gradient(90deg,#7c3aed,#4f46e5,#06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Links */
.ai-footer .footer-links li + li{ margin-top:.25rem; }
.ai-footer .footer-link{
  display:inline-block;
  text-decoration:none;
  color: var(--fg,#111);
  padding:.25rem .4rem;
  border-radius:.5rem;
  transition: all .2s ease;
}
.ai-footer .footer-link:hover{
  background: rgba(99,102,241,.08);
  text-decoration: none;
  transform: translateX(2px);
}

/* Social “gradient ring” */
.social-ring{
  display:inline-flex;
  align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:9999px;
  background: linear-gradient(135deg,#667eea,#764ba2,#06b6d4);
  padding:2px; text-decoration:none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.social-ring .ring-inner{
  width:100%; height:100%; border-radius:inherit;
  background: var(--bg,#fff);
  display:flex; align-items:center; justify-content:center;
  color: var(--fg,#111); font-size:1.05rem;
}
.social-ring:hover{ transform: translateY(-2px); box-shadow:0 8px 24px rgba(102,126,234,.25); }
.social-ring:hover .ring-inner{ background: linear-gradient(135deg,#16a34a,#22c55e); color:#fff; }

/* Bottom chips */
.footer-chip{
  display:inline-block;
  padding:.3rem .7rem;
  border-radius:9999px;
  background: rgba(99,102,241,.08);
  color: var(--fg,#111);
  text-decoration:none;
  transition: all .2s ease;
}
.footer-chip:hover{
  background: linear-gradient(90deg,#16a34a,#22c55e);
  color:#fff;
  transform: translateY(-1px);
}

/* Dark mode */
:root[data-theme="dark"] .ai-footer{
  box-shadow: 0 -8px 24px rgba(255,255,255,.04) inset;
}
:root[data-theme="dark"] .ai-footer .footer-link:hover{
  background: rgba(148,163,184,.12);
}
:root[data-theme="dark"] .social-ring .ring-inner{
  background:#0f1115; color:#e5e7eb;
}
:root[data-theme="dark"] .footer-chip{
  background: rgba(148,163,184,.12); color:#e5e7eb;
}


/* --- Tool header with visible rainbow halo --- */
.tool-hero .tool-header {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff; /* keep title visible */
  font-size: 1.2rem;
  line-height: 1.3;
  background: linear-gradient(135deg, #6a5ae0, #764ba2);
  border-radius: 12px;
  padding: 10px 18px;
  box-shadow: 0 4px 10px rgba(118, 75, 162, 0.25);
  margin: 0;
  z-index: 0; /* create stacking context */
}

/* Rainbow glow BEHIND the header (no cover) */
.tool-hero .tool-header::before {
  content: "";
  position: absolute;
  inset: -2px;                 /* halo thickness */
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #ff005e, #ff9900, #ffee00, #00ff6a, #00c8ff, #8b00ff, #ff005e
  );
  background-size: 400%;
  animation: rainbowGlow 6s linear infinite;
  z-index: -1;                 /* sits behind content */
  pointer-events: none;        /* never intercepts clicks/hover */
}

/* Remove the old ::after layer entirely if present */
.tool-hero .tool-header::after { content: none !important; }

/* Keep icon visible above background */
.tool-hero .tool-header .tool-icon-wrap,
.tool-hero .tool-header h1 { position: relative; z-index: 1; }

@keyframes rainbowGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ================================
   Rainbow Glow Effect (Reusable)
   ================================ */
/* ================================
   Rainbow Glow Effect (Effect Only)
   ================================ */
.rainbow-header {
  position: relative;
  z-index: 0; /* keeps the glow behind the element */
}

/* Animated rainbow halo */
.rainbow-header::before {
  content: "";
  position: absolute;
  inset: -2px; /* glow thickness */
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #ff005e, #ff9900, #ffee00,
    #00ff6a, #00c8ff, #8b00ff, #ff005e
  );
  background-size: 400%;
  animation: rainbowGlow 6s linear infinite;
  z-index: -1;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.9;
}


/* ===============================
   Homepage Banner Styles
   =============================== */

/* Wrapper spacing and responsiveness */
/* ===============================
   Homepage Banners (Top & Mid)
   =============================== */
.home-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto 2rem;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.home-banner img {
  width: 100%;
  max-width: 1600px;     /* prevents over-stretch on huge screens */
  height: auto;          /* preserve aspect ratio */
  display: block;
  object-fit: cover;     /* crop edges slightly instead of squashing */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Slightly smaller radius/gap on phones */
@media (max-width: 768px) {
  .home-banner {
    margin-bottom: 1.25rem;
    border-radius: 10px;
  }
}





/* ===== Mobile Usability & Overflow Fixes ===== */
/* Safety for AdSense overflow to prevent GSC 'Mobile Usability' errors */
.adsbygoogle, ins.adsbygoogle {
  max-width: 100% !important;
  display: block;
  overflow: hidden !important;
}

/* Fix header crowding on extremely narrow screens (e.g. 320px) */
@media (max-width: 380px) {
  .ai-header .container-fluid { padding-left: 6px; padding-right: 6px; }
  .brand-name-mobile { font-size: 0.8rem !important; letter-spacing: -0.2px; }
  #sidebarToggle, #bookmarkBtn { padding: 0.35rem 0.5rem; }
  .ai-header { min-height: 56px; }
}

/* Ensure no long text/URLs break the layout */
.tool-description, .tool-result, pre, code {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-all;
  max-width: 100%;
}
