.drawer {
  :global {
    .qwenpaw-drawer-body {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
      background-color: var(--colorBgBase, #fff);
    }
  }
}

@media (max-width: 768px) {
  .drawer {
    :global {
      .qwenpaw-drawer-content {
        border-radius: 0 !important;
      }
      .qwenpaw-drawer-mask {
        background: rgba(0, 0, 0, 0.45) !important;
      }
    }
  }
}

/* Header bar */
.header {
  display: flex;
  align-items: center;
  padding: 16px 16px 16px 20px;
  gap: 8px;
  background-color: var(--colorBgBase, #fff);
  flex-shrink: 0;
}

.headerLeft {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.headerTitle {
  font-size: 16px;
  font-weight: 500;
  line-height: 32px;
  color: var(--colorText, rgba(0, 0, 0, 0.88));
}

.headerInfoIcon {
  font-size: 20px;
  color: var(--colorTextSecondary, rgba(0, 0, 0, 0.45));
}

.headerRight {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pinActive {
  color: var(--color-primary, #ff9d4d);
}

/* Create new chat button area */
.createSection {
  flex-shrink: 0;
  padding: 0 12px 12px;
}

/* Search bar area */
.searchContainer {
  flex-shrink: 0;
  padding: 0 12px 8px;
}

.searchInput {
  border-radius: 6px;
  font-size: 12px;
}

.emptyState {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  font-size: 12px;
  color: var(--colorTextTertiary, rgba(0, 0, 0, 0.45));
}

.createButton {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  background: var(--colorPrimary, #ff9d4d);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.85;
  }
}

/* Session list wrapper */
.listWrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.list {
  padding: 0 12px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: transparent;

  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

/* Date group label (clickable to collapse/expand) */
.groupLabel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 8px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--colorTextTertiary, rgba(0, 0, 0, 0.45));
  user-select: none;
  transition: color 0.15s;

  &:hover {
    color: var(--colorTextSecondary, rgba(0, 0, 0, 0.65));
  }
}

.groupChevron {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* Top fade gradient overlay */
.topGradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(
    180deg,
    var(--colorBgBase, #fff) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Bottom fade gradient overlay */
.bottomGradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(
    0deg,
    var(--colorBgBase, #fff) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Footer area (reserved) */
.footer {
  flex-shrink: 0;
  padding: 20px 16px;
  background-color: var(--colorBgBase, #fff);
}

.footerText {
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  color: var(--colorText, rgba(0, 0, 0, 0.88));
}

/* Embedded panel mode (inline, no Drawer wrapper) */
.embeddedPanel {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background-color: var(--colorBgBase, #fff);
  border-left: 1px solid var(--colorBorderSecondary, rgba(0, 0, 0, 0.06));

  .createSection {
    padding: 0 16px 12px;
  }

  .list {
    padding: 0 16px;
  }

  .header {
    padding: 16px;
  }
}

/* Dark mode */
:global(.dark-mode) {
  .embeddedPanel {
    background-color: #141414;
    border-left-color: rgba(255, 255, 255, 0.08);
  }

  .drawer {
    :global {
      .qwenpaw-drawer-body {
        background-color: #141414;
      }
    }
  }

  .header {
    background-color: #141414;
  }

  .headerTitle {
    color: rgba(255, 255, 255, 0.95);
  }

  .headerInfoIcon {
    color: rgba(255, 255, 255, 0.5);
  }

  .topGradient {
    background: linear-gradient(180deg, #141414 0%, rgba(31, 31, 31, 0) 100%);
  }

  .bottomGradient {
    background: linear-gradient(0deg, #141414 0%, rgba(31, 31, 31, 0) 100%);
  }

  .footer {
    background-color: #141414;
  }

  .footerText {
    color: rgba(255, 255, 255, 0.95);
  }

  .groupLabel {
    color: var(--text-quaternary, rgba(255, 255, 255, 0.35));

    &:hover {
      color: var(--text-secondary, rgba(255, 255, 255, 0.55));
    }
  }

  .emptyState {
    color: var(--text-quaternary, rgba(255, 255, 255, 0.35));
  }

  .createButton {
    background: #c75c00;
  }
}
