/* ============================================================
   SIDEBAR.CSS — Grouped Navigation Sidebar
   startup.vinathis.com | v3.1 | 2025 — Green/Inox Theme
   ============================================================ */

/* === MENU TOGGLE BUTTON === */
.menu-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: rgba(22,163,74,0.12);
  border: 1.5px solid rgba(22,163,74,0.45);
  border-radius: 12px;
  color: #16a34a;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(22,163,74,0.15);
}
.menu-toggle:hover {
  background: rgba(22,163,74,0.22);
  border-color: #4ade80;
  box-shadow: 0 0 20px rgba(74,222,128,0.35);
  transform: scale(1.05);
}
.menu-toggle .icon-open  { display: block; }
.menu-toggle .icon-close { display: none; }
.sidebar-open .menu-toggle .icon-open  { display: none; }
.sidebar-open .menu-toggle .icon-close { display: block; }

/* === SIDEBAR OVERLAY (mobile) === */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: all;
}

/* === SIDEBAR PANEL === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width, 300px);
  background: var(--sidebar-bg, rgba(5,13,26,0.97));
  border-right: 1px solid rgba(255,255,255,0.07);
  z-index: 1080;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  overflow: hidden;
}
.sidebar-open .sidebar {
  transform: translateX(0);
}

/* === SIDEBAR HEADER === */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-title {
  flex: 1;
  min-width: 0;
}
.sidebar-title h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-title p {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.sidebar-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* === SIDEBAR SEARCH === */
.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  color: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.sidebar-search input::placeholder { color: rgba(255,255,255,0.3); }
.sidebar-search input:focus { border-color: rgba(0,212,170,0.5); }

/* === SIDEBAR SCROLL AREA === */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* === SIDEBAR GROUP === */
.sidebar-group { margin-bottom: 4px; }

.sidebar-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  border-radius: 0;
}
.sidebar-group-header:hover {
  background: rgba(255,255,255,0.04);
}
.sidebar-group-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.sidebar-group-label {
  flex: 1;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
}
.sidebar-group-count {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  padding: 1px 7px;
  border-radius: 99px;
}
.sidebar-group-chevron {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.sidebar-group.open .sidebar-group-chevron {
  transform: rotate(90deg);
}

/* === GROUP ITEMS === */
.sidebar-items {
  display: none;
  padding: 0 8px 4px;
}
.sidebar-group.open .sidebar-items {
  display: block;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.07);
}
.sidebar-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-item-name {
  flex: 1;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  transition: color 0.18s ease;
}
.sidebar-item:hover .sidebar-item-name {
  color: #fff;
}
.sidebar-item-ext {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

/* Hide items not matching search */
.sidebar-item.hidden { display: none !important; }
.sidebar-group.all-hidden { display: none !important; }

/* === SIDEBAR FOOTER === */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  flex-shrink: 0;
}
.sidebar-footer p {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.22);
  line-height: 1.5;
  margin: 0;
}
.sidebar-footer a {
  color: rgba(0,212,170,0.5);
}
.sidebar-footer a:hover { color: #00d4aa; }

/* === RESPONSIVE === */
@media (min-width: 1024px) {
  /* On large screens sidebar can push content - optional */
  .sidebar-overlay { display: none; }
}
@media (max-width: 768px) {
  :root { --sidebar-width: 280px; }
}
@media (max-width: 480px) {
  :root { --sidebar-width: 260px; }
  .menu-toggle { top: 12px; left: 12px; width: 42px; height: 42px; font-size: 1.1rem; }
}
