.template-bar {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    flex-shrink: 0;
    min-height: 36px;
    position: relative; /* Add this */
    z-index: 100; /* Add this - ensure bar is above other content */
}

.template-bar::-webkit-scrollbar {
    height: 3px;
}

.template-bar::-webkit-scrollbar-track {
    background: transparent;
}

.template-bar::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

/* Template Dropdown Groups */
.template-dropdown-group {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 101; /* Add this */
}
.template-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
}
.template-dropdown-trigger:hover {
    background: #3d3d3d;
    border-color: #666;
    color: #fff;
}

.template-dropdown-trigger.active {
    background: #094771;
    border-color: #007acc;
    color: #fff;
}

.template-dropdown-trigger i {
    width: 14px;
    height: 14px;
}

.template-dropdown-arrow {
    font-size: 8px;
    margin-left: 2px;
    opacity: 0.6;
}

/* Dropdown Menu */
.template-dropdown-menu {
    position: fixed;
    background: #252526;
    border: 1px solid #454545;
    border-radius: 6px;
    min-width: 200px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    display: none;
    padding: 4px 0;
    margin: 0; /* Remove any margin */
}
.template-dropdown-menu.show {
    display: block;
}

.template-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.template-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.template-dropdown-menu::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.template-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    color: #ccc;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
    white-space: nowrap;
}

.template-dropdown-item:hover {
    background: #094771;
    color: #fff;
}

.template-dropdown-item.active {
    background: #094771;
    color: #fff;
    font-weight: 500;
}

.template-dropdown-item i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.template-dropdown-item .item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-dropdown-item .item-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #444;
    color: #999;
    flex-shrink: 0;
}

.template-dropdown-item .item-badge.user {
    background: #0e639c;
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
}

.template-dropdown-divider {
    height: 1px;
    background: #444;
    margin: 4px 8px;
}

.template-dropdown-section-title {
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

/* Direct Template Buttons (for favorites/quick access) */
.template-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.template-btn:hover {
    background: #3d3d3d;
    border-color: #666;
    color: #fff;
}

.template-btn.active {
    background: #094771;
    border-color: #007acc;
    color: #fff;
}

.template-btn i {
    width: 13px;
    height: 13px;
}

/* Star button for quick-access */
.template-btn.starred {
    border-color: #d4a017;
}

.template-btn.starred::before {
    content: '★';
    font-size: 10px;
    margin-right: 2px;
    color: #d4a017;
}

/* Separator */
.template-separator {
    width: 1px;
    height: 18px;
    background: #444;
    margin: 0 2px;
    flex-shrink: 0;
}

/* New Project Button */
.template-new-btn {
    background: #0e639c;
    border-color: #007acc;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.template-new-btn:hover {
    background: #1177bb;
}

/* Overflow indicator */
.template-overflow-indicator {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 4px;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
}

.template-overflow-indicator:hover {
    background: #3d3d3d;
    color: #fff;
}

/* Context Menu */
.template-context-menu {
    position: fixed;
    background: #252526;
    border: 1px solid #454545;
    border-radius: 4px;
    padding: 4px 0;
    min-width: 150px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.template-context-menu-item {
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

.template-context-menu-item:hover {
    background: #094771;
}

.template-context-menu-item.danger {
    color: #f44747;
}

.template-context-menu-item.danger:hover {
    background: #5a1d1d;
}