/* GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  min-height: 100vh;
}

/* SIDEBAR — DESKTOP */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 270px;
  background: #151a2d;
  height: 100vh;
  transition: all 0.4s ease;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 85px;
}

.sidebar .sidebar-header {
  display: flex;
  position: relative;
  padding: 25px 20px;
  align-items: center;
  justify-content: center;
}

.sidebar-header .toggler {
  height: 35px;
  width: 35px;
  color: #151a2d;
  border: none;
  cursor: pointer;
  display: flex;
  background: #fff;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: 0.4s ease;
}

.sidebar-header .sidebar-toggler {
  position: absolute;
  right: 20px;
}

.sidebar-header .menu-toggler {
  display: none;
}

.sidebar.collapsed .sidebar-header .toggler {
  transform: translate(-4px, 65px);
}

.sidebar-header .toggler:hover {
  background: #dde4fb;
}

.sidebar-header .toggler span {
  font-size: 1.75rem;
  transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-header .toggler span {
  transform: rotate(180deg);
}

.sidebar-nav .nav-list {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0 15px;
  flex-direction: column;
  transform: translateY(15px);
  transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-nav .primary-nav {
  transform: translateY(65px);
}

.sidebar-nav .nav-link {
  color: #fff;
  display: flex;
  gap: 12px;
  white-space: nowrap;
  border-radius: 8px;
  padding: 12px 15px;
  align-items: center;
  text-decoration: none;
  transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-nav .nav-link {
  border-radius: 12px;
}

.sidebar .sidebar-nav .nav-link .nav-label {
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-nav .nav-link .nav-label {
  opacity: 0;
  pointer-events: none;
}

.sidebar-nav .nav-link:hover {
  color: #151a2d;
  background: #fff;
}

.sidebar-nav .nav-item {
  position: relative;
}

.sidebar-nav .nav-tooltip {
  position: absolute;
  top: -10px;
  opacity: 0;
  color: #151a2d;
  display: none;
  pointer-events: none;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  background: #fff;
  left: calc(100% + 25px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  transition: 0s;
}

.sidebar.collapsed .sidebar-nav .nav-tooltip {
  display: block;
}

.sidebar-nav .nav-item:hover .nav-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(50%);
  transition: all 0.4s ease;
}

.sidebar-nav .secondary-nav {
  position: absolute;
  bottom: 30px;
  width: 100%;
}

/* MOBILE OVERLAY */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* TABLET + MOBILE — LIQUID GLASS */
@media (max-width: 1024px) {
    .sidebar {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: auto;
    width: calc(100% - 24px);
    height: 64px;
    border-radius: 18px;
    overflow: hidden;

    /* LIQUID GLASS */
    background: rgba(14, 15, 32, 0.52);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(91, 77, 219, 0.15),
      0 8px 32px rgba(0, 0, 0, 0.5),
      0 0 0 0.5px rgba(120, 108, 255, 0.12),
      0 0 60px rgba(120, 108, 255, 0.08);
    transition:
      height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.6s ease,
      border-color 0.3s ease;
  }
  
  .sidebar.menu-active {
    height: auto;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    scrollbar-width: none;
    border-color: rgba(120, 108, 255, 0.55);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      inset 0 -1px 0 rgba(91, 77, 219, 0.2),
      0 16px 60px rgba(0, 0, 0, 0.55),
      0 0 80px rgba(120, 108, 255, 0.14);
  }

  .sidebar.menu-active::-webkit-scrollbar {
    display: none;
  }

  .sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.18) 25%,
      rgba(180, 174, 255, 0.38) 50%,
      rgba(255, 255, 255, 0.18) 75%,
      transparent 100%
    );
    z-index: 10;
    pointer-events: none;
    border-radius: 18px 18px 0 0;
  }

  .sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(
      135deg,
      rgba(120, 108, 255, 0.09) 0%,
      transparent 45%,
      rgba(91, 77, 219, 0.06) 100%
    );
    pointer-events: none;
    z-index: 0;
  }

  /* HEADER */
  .sidebar .sidebar-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 9px 14px;
    background: transparent;
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-header .header-logo img {
    width: 52px;
    height: 52px;
  }

  .sidebar-header .sidebar-toggler,
  .sidebar-nav .nav-item:hover .nav-tooltip {
    display: none;
  }

  .sidebar-header .menu-toggler {
    display: flex;
    height: 34px;
    width: 34px;
    background: rgba(120, 108, 255, 0.18);
    border: 1px solid rgba(120, 108, 255, 0.32);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    transition: all 0.25s ease;
  }

  .sidebar-header .menu-toggler:hover {
    background: rgba(120, 108, 255, 0.32);
    border-color: rgba(120, 108, 255, 0.6);
    box-shadow: 0 0 16px rgba(120, 108, 255, 0.38);
  }

  .sidebar-header .menu-toggler span {
    font-size: 1.3rem;
  }

  /* Nav */
  .sidebar .sidebar-nav {
    position: relative;
    z-index: 1;
  }

  .sidebar-nav::before {
    content: '';
    display: block;
    height: 1px;
    margin: 0 14px 8px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(120, 108, 255, 0.3),
      rgba(180, 174, 255, 0.5),
      rgba(120, 108, 255, 0.3),
      transparent
    );
  }

  .sidebar .sidebar-nav .nav-list {
    padding: 4px 12px 14px;
    gap: 4px;
    transform: none;
  }

  .sidebar-nav .nav-link {
    gap: 12px;
    padding: 11px 14px;
    font-size: 0.95rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.88);
    transition: all 0.25s ease;
  }

  .sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(120, 108, 255, 0.22);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 4px 16px rgba(120, 108, 255, 0.2);
  }

  .sidebar-nav .nav-link .nav-icon {
    font-size: 1.35rem;
    color: rgba(180, 174, 255, 0.9);
  }

  .sidebar-nav .secondary-nav {
    position: relative;
    bottom: 0;
    margin: 16px 0 4px;
  }

  .sidebar-overlay {
    display: block;
  }
}

/* MOBILE */
@media (max-width: 600px) {
  .sidebar {
    top: 8px;
    left: 8px;
    right: 8px;
    width: calc(100% - 16px);
    border-radius: 16px;
  }

  .sidebar::before {
    border-radius: 16px 16px 0 0;
  }
  .sidebar::after {
    border-radius: 16px;
  }

  .sidebar.menu-active {
    max-height: calc(100vh - 16px);
  }

  .sidebar-nav .nav-link {
    font-size: 0.91rem;
    padding: 10px 12px;
  }
}
