/* ════════════════════════════════════════
   LEFT SIDEBAR — PANEL SYSTEM
   ════════════════════════════════════════ */

.ls-panels {
    position: relative;
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.28s cubic-bezier(.4, 0, .2, 1);
}

.ls-panels.ls-cat-open {
    transform: translateX(-50%);
}

.ls-panel {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.ls-panel--cat {
    overflow-y: auto;
    scrollbar-width: none;
}

.ls-panel--cat::-webkit-scrollbar {
    display: none;
}

.ls-nav-item--btn {
    background: none;
    border: none;
    cursor: pointer;
    width: calc(100% - 12px);
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

@media (min-width: 1081px) {
    .ls-cat-trigger {
        display: none;
    }
}

/* ── Category panel header ── */
.ls-cat-header {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid #f2f2f2;
    flex-shrink: 0;
    gap: 15px;
}

.ls-cat-back-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #6b6b6b;
    text-decoration: none;
    transition: color 0.15s;
    width: fit-content;
}

.ls-cat-back-link:hover {
    color: #292929;
    text-decoration: none;
}

.ls-cat-back-link svg {
    flex-shrink: 0;
}

.ls-cat-heading {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #292929;
    line-height: 1.2;
}

/* Collapsed sidebar state */
.left-sidebar:not(.ls-expanded) .ls-cat-back-link {
    display: none;
}

.left-sidebar:not(.ls-expanded) .ls-cat-heading {
    font-size: 11px;
    font-weight: 600;
    color: #6b6b6b;
    text-align: center;
    width: 100%;
}

/* ── Category accordion list area ── */
.ls-cat-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    padding-right: 0;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
}

.ls-cat-list::-webkit-scrollbar {
    width: 3px;
}

.ls-cat-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.ls-cat-list .topic-accordion-header {
    padding: 11px 14px;
    font-size: 14px;
}

.ls-cat-list .topic-accordion-tags {
    padding: 6px 14px 12px;
}

/* ── Dark mode ── */
html.dark .ls-cat-header {
    border-bottom-color: #2c2a25;
}

html.dark .ls-cat-back-link {
    color: #857f76;
}

html.dark .ls-cat-back-link:hover {
    color: #e6e2d8;
}

html.dark .ls-cat-heading {
    color: #e6e2d8;
}

html.dark .left-sidebar:not(.ls-expanded) .ls-cat-heading {
    color: #857f76;
}



/* ════════════════════════════════════════
   TOPIC ACCORDION SIDEBAR
   ════════════════════════════════════════ */
.topic-accordion {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
    padding-right: 4px;
}

.topic-accordion::-webkit-scrollbar {
    width: 3px;
}

.topic-accordion::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.topic-accordion-item {
    border-bottom: 1px solid #f2f2f2;
}

.topic-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #292929;
    text-align: left;
    transition: color 0.15s;
    border-radius: 6px;
}

.topic-accordion-header:hover {
    color: #000;
    background: #f9f9f9;
}

.topic-accordion-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: #6b6b6b;
}

.topic-accordion-arrow.open {
    transform: rotate(180deg);
}

.topic-accordion-tags {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 4px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
}

.topic-accordion-tags::-webkit-scrollbar {
    width: 3px;
}

.topic-accordion-tags::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

/* Category chip — inverted style to distinguish from tags */
.topic-cat-chip {
    background: #292929;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    transition: background 0.15s;
}

.topic-cat-chip:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

/* Tag chips — softer style */
.topic-tag-chip {
    background: #f2f2f2;
    color: #292929;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    transition: background 0.15s;
}

.topic-tag-chip:hover {
    background: #e6e6e6;
    color: #292929;
    text-decoration: none;
}

.topic-tags-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 0;
}

.topic-tags-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f2f2f2;
    border-top: 2px solid #6b6b6b;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Dark mode ── */
html.dark .topic-accordion-item {
    border-bottom-color: #2c2a25;
}

html.dark .topic-accordion-header {
    color: #ccc8be;
}

html.dark .topic-accordion-header:hover {
    background: #2a2822;
    color: #e6e2d8;
}

html.dark .topic-cat-chip {
    background: #e6e2d8;
    color: #1a1a1a;
}

html.dark .topic-cat-chip:hover {
    background: #fff;
    color: #1a1a1a;
}

html.dark .topic-tag-chip {
    background: #2a2822;
    color: #ccc8be;
}

html.dark .topic-tag-chip:hover {
    background: #2c2a25;
    color: #e6e2d8;
}

html.dark .topic-tags-spinner {
    border-color: #2c2a25;
    border-top-color: #ccc8be;
}
