/* Drawer Component - Tailwind Enhanced with Glassmorphism */
:root {
  --drawer-width: 380px;
}

.drawer {
  position: fixed;
  z-index: 99;
  height: 100%;
  width: 100%;
  max-width: var(--drawer-width);
  top: 0;
  right: 0;
  visibility: hidden;
  transition: visibility 0s 0.3s;
}

.drawer:focus {
  outline: none;
}

.drawer--is-visible {
  visibility: visible;
  transition: none;
}

.drawer--open-left {
  right: auto;
  left: 0;
}

.drawer__content {
  width: 320px;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  border-radius: 24px 0 0 24px;
  overflow: hidden;
  /* Glassmorphism effect */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.drawer--open-left .drawer__content {
  transform: translateX(-100%);
  border-radius: 0 24px 24px 0;
}

.drawer--is-visible .drawer__content {
  transform: translateX(0);
}

.drawer__body {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Custom scrollbar for glassmorphism */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.drawer__body::-webkit-scrollbar {
  width: 6px;
}

.drawer__body::-webkit-scrollbar-track {
  background: transparent;
}

.drawer__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.drawer__body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.drawer__close-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.drawer__close-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.drawer--modal {
  max-width: none;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s, visibility 0s 0.3s;
}

.drawer--modal.drawer--is-visible {
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background-color 0.3s;
}

.drawer--modal.drawer--open-left .drawer__content {
  right: auto;
  left: 0;
}

.drawer--modal .drawer__content {
  max-width: var(--drawer-width);
}

/* Enhanced menu animations for glassmorphism */
.accordion .collapse {
  transition: all 0.3s ease;
}

.accordion [data-toggle="collapse"] i.fas.fa-chevron-up,
.accordion [data-toggle="collapse"] i.fas.fa-chevron-down {
  transition: transform 0.3s ease;
}

.accordion [data-toggle="collapse"][aria-expanded="true"] i.fas.fa-chevron-up {
  transform: rotate(180deg);
}

.accordion [data-toggle="collapse"][aria-expanded="false"] i.fas.fa-chevron-down {
  transform: rotate(-90deg);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  :root {
    --drawer-width: 100vw;
  }
  
  .drawer__content {
    width: 100vw;
    border-radius: 0;
  }
  
  .drawer--open-left .drawer__content {
    border-radius: 0;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  .drawer__content {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}