/* css/sidebar.css */
.sidebar {
    width: 220px;
    background: #181818;
    border-right: 1px solid #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.sidebar-top {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-bottom {
    border-top: 1px solid var(--border);
    padding: 10px 0;
    background: #151515;
}

/* Label Items */
.label-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.1s;
    font-size: 14px;
    position: relative;
}

.label-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.label-item.active {
    background: #37373d;
    color: #fff;
    border-left: 3px solid var(--accent);
}

.label-item .icon {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.label-item .text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.root-label {
    font-weight: 600;
    color: var(--text);
}

.label-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.label-header {
    padding: 5px 15px;
    font-size: 11px;
    font-weight: bold;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-label-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 0 5px;
}

.add-label-btn:hover {
    color: var(--accent);
}

.label-actions {
    display: none;
    position: absolute;
    right: 5px;
}

.label-item:hover .label-actions {
    display: flex;
    gap: 5px;
}

.action-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: #333;
    color: #ccc;
    font-size: 10px;
}

.action-icon:hover {
    background: #555;
    color: white;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.sidebar-btn:hover {
    background: var(--bg-hover);
}

.sidebar-btn .icon {
    margin-right: 10px;
    font-size: 16px;
}

/* css/sidebar.css */
/* ... existing styles ... */

.label-count {
    font-size: 11px;
    color: #777;
    margin-left: 10px;
    margin-right: 5px;
    font-weight: normal;
}

/* Gmail Style: Hide the number when the edit/delete actions appear */
.label-item:hover .label-count {
    display: none;
}

/* Metadata Categories */
#metadata-list {
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.meta-category {
    font-size: 13px;
    color: #aaa;
    border-bottom: 1px solid #222;
}

.meta-header {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #181818;
}

.meta-header:hover {
    background: var(--bg-hover);
    color: #fff;
}

.meta-header .arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.meta-category.open .arrow {
    transform: rotate(180deg);
}

.meta-refresh-btn {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meta-refresh-btn:hover {
    color: #fff;
}

.meta-refresh-btn.spinning {
    animation: spin 1s linear infinite;
    color: var(--accent);
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.meta-category.open .arrow {
    transform: rotate(180deg);
}

.meta-sublist {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    background: #111;
    padding: 5px 0;
}

.meta-category.open .meta-sublist {
    display: block;
}

.meta-item {
    padding: 4px 15px 4px 25px;
    font-size: 12px;
    cursor: pointer;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.meta-count {
    color: #555;
    font-size: 10px;
}

.meta-item:hover .meta-count {
    color: #888;
}

.meta-item.active .meta-count {
    color: #aaa;
}

.meta-item:hover {
    color: #ddd;
    background: #222;
}

.meta-item.active {
    color: var(--accent);
    font-weight: bold;
    background: #252526;
}