/* ===== Layout wiring to template hooks ===== */
    :root { --sidebar-w: 260px; --header-h: 64px; }
        :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 (if your template styles it, this is a fallback) */
    .ai-search {
      max-width: 680px; width:100%;
      display:flex; gap:8px;
    }
    .ai-search input {
      border-radius: 9999px; padding: .65rem 1rem;
    }
    .ai-search .btn {
      border-radius: 9999px; padding: .55rem 1rem;
    }

    /* 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));
}
